After joning data with my group I would like the elements in the enter
selection to be added to a group (g
-element) on top/highest up. Default is to append to the bottom.
The reason for this is that I want the object to visually appear below the all ready visible objects.
I know I can order and sort but I thought there might be an easier/better way to do this. I have done several manual things only to later find out "Oooh, they included a smart way to do that, EASILY."
D3 does have an insert
method: https://github.com/mbostock/d3/wiki/Selections#wiki-insert
For instance, insert("div", ":first-child")
will prepend child div
nodes to the current selection.
https://github.com/mbostock/d3/wiki/Selections#wiki-insert
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With