-
All operations in the library are chained to the
d3
instance. -
D3 is modularized, so you can only import the modules you need to reduce your build size.
-
.data()
is chained to a selection, and binds it with the data passed in as an argument. -
.enter()
reconciles the data and elements that data is bound to: it creates any necessary extra elements if there is a mismatch between those and the number of data items via.append()
.
- Don't use arrow functions for input interactions, the scoping of
this
in that instance leads to problems.
- It will save you a lot of aggravation, especially when you need to transform data in some way, to set accessor functions for certain data points.
-
Scales exist to convert values from whatever domain they originally belong to, to a pixel domain.
-
scaleLinear()
deals with numbers that, well, scale in a linear fashion -
scaleTime()
works with units of time
-
select()
selects the element passed into this method as an argument. -
selectAll()
selects all specified elements.
timeParse()
takes a string and converts it into a date object.