mySelection.datum( func ) in D3.js

Set the data associated with elements in the selection based on existing data.


func Function This function is invoked for each selected element, being passed the previous datum d and the current index i, with the this context as the current DOM element. The return value of this function is used to set each element’s data. A null value will delete the bound data.
Return Type


For more details see

See Also