diff --git a/D3.md b/D3.md index a5ac1b1..9b68978 100644 --- a/D3.md +++ b/D3.md @@ -111,6 +111,15 @@ d3.selectAll('circle')//make a "ghost call" to all circles, even if there are no .remove(); //removes those elements ``` +To bind data to elements by something other than index: + +```javascript +.data(data, function(d){ + //match data based on d.id, not index + return d.id +}); +``` + ## Linear Scale A scale will map a data value to a visual value.