You can affect multiple element with a single statement. If you wanted to do the same at each level, you would have to change the center of the circle and completely change the coordinates of the path attribute.
Ah oui je vois la confusion. Non, pour les PAIRES de balises, les attributs se mettent dams la balise ouvrante, donc cela donne ici <g transform=...>...</g>.
In const i = icon.append("g"), i is really an ALIAS referring to the element. If you remove the g element from icon itself, i's content will go away too!=
Non, en fait les attributs se placent DANS la balise. La balise c'est <circle/> (parce que c'est une balise simple). Du coup quand je rajoute les attributs ça donne: <circle fill="blue"/>. Par contre pour <g>...</g> (qui une paire de balise), cela donne <g fill="white">...</g>. C'est plus clair?