G (group)

The g element helps group together other elements.

It has no attributes of gis own, but all the styling and attributes that can be applied to it get passed on to contained elements.

Since this is just a grouping tool, it has no x an y attributes.

Another great advantage is that you can apply the same interactivity, styling or transformations to all elements inside it at once.

You can notice in the following example how all elements inside the group change color, except for the circle, that has his own fill styling defined.