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?
Here are some good links:
Good discussion on D3 "data()": Understanding how D3.js binds data to nodes
D3 for Mere Mortals
Mike Bostock's D3 Wiki
Per the latter:
# selection.data([values[, key]])Joins the specified array of data with the current selection. The specified values is an array of data values, such as an array of numbers or objects, or a function that returns an array of values.
...
# selection.datum([value])Gets or sets the bound data for each selected element. Unlike the selection.data method, this method does not compute a join (and thus does not compute enter and exit selections).