Can someone please explain the difference between datum() and data() in D3.js? I see both being used and I am not sure why you should choose one over the other?
I found the correct answer here from Mike himself:
D3 - how to deal with JSON data structures?
If you want to bind your data to a single SVG element, use
(...).data([data])
or
(...).datum(data)
If you want to bind your data to multiple SVG elements
(...).data(data).enter().append("svg")
.....
2.1m questions
2.1m answers
60 comments
57.0k users