- D3 loves lists! When you do a
.data(blah).enter()
,blah
needs to be list. You spent quite a bit of time wondering why things didn't work because yourblah
s were maps/objects.- Speaking of lists, use D3's array functions
- This is the margin convention. Follow it. Saves a ton of headaches.
- This is a great resource for scaling functions.
- "Save" the element you're adding to add to it later.
- Be minful of SO answers; stuff that's OK with v3 might not be for v4.
const background = svg.add.....
background.add(object1)
background.add(object2)
background.add(object3)