Skip to content

Instantly share code, notes, and snippets.

@micahasmith
Created December 16, 2011 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micahasmith/1484318 to your computer and use it in GitHub Desktop.
Save micahasmith/1484318 to your computer and use it in GitHub Desktop.
d3.js data example
//select all divs
d3.selectAll('div')
//map some data to those divs, in order that they were found in the DOM
.data(["hello","world","hi"])
//and now do something to the divs with that data
//perhaps, put the data in the divs
//so this function param "d" is actually the data for that div
.html(function(d) {
return d;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment