But let’s say we now have like nine different states and we want to display them all at once.
What we usually do when we have multiple data points is take that svg, do a selectAll, bind our data and add a ton of circle elements or rect elements or whatever we’re looking to do. But we want multiple svg elements, not multiple circles!
But really, you just do the same thing.
Select the body tag, or the div that you’re going to put your svg elements into
selectAll the svgs inside of it
Bind your data
.enter and .append('svg'), giving you a separate svg for each data point.
Treat those svgs just like you would a single svg, except that the data is already bound!
Yeah, it’s horrifying looking, but you get my point. If you treat the svg same as you’d treat a circle or anything else, you can add tons of stuff inside.
Want to hear when I release new things? My infrequent and sporadic newsletter can help with that.