I follow the excellent https://observablehq.com/@d3/selection-join to move to join paradigm.
Works fine until I want to make each node more complex (a group with a text inside). The root group is updated but not the child one.
Code snippet
see https://codepen.io/daohodac/pen/JjdJWEV (letters1 is preloaded. click on update to load the letters2 dataset)
const letters1 = "abcdefghijkl".split("").map((l,i) => ({l:l, color:'green', shift:0}));
const letters2 = "abcdefghijklmnopqrstuvwxyz".split("").map((l,i) => ({l:l, color:'red', shift:i*5}));
In this piece of code, the data is correctly updated on the root node (<g> shifts according to the new value of the shift) but the color of the inner text does not change on the preloaded letters. The data is correctly bound to <g>. How can I tell d3 to use it also on the <text> child element?