Using d3 v3 to set and use .datum() on elements
With d3 v3, when you set .datum() on an element created from blah.selectAll("blahblah").enter(),
the datum is bound to the element, and can be used later.
With d3 v4, when you set .datum() on an element created from blah.selectAll("blahblah").enter(),
the element is bound to the .data() of the .enter(), and any .datum() you set cannot be used later,
unless you create a new selection that's not bound to the data.
Compare this example to d3 v4 set datum.
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js