Created
December 16, 2011 03:32
-
-
Save micahasmith/1484318 to your computer and use it in GitHub Desktop.
d3.js data example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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