mySelection.data( dataCalculator, [ keyCalculator ] ) in D3.js

Set the data array for the selection based on existing data.

Arguments

nametypedescription
dataCalculator Function
keyCalculator Function [optional] This function is yielded the values of the array and must return a unique string for each.
Return Type
Selection

Description

For more details see https://github.com/mbostock/d3/wiki/Selections#wiki-data.

See Also