Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created June 26, 2013 13:46
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 tmcw/5867483 to your computer and use it in GitHub Desktop.
Save tmcw/5867483 to your computer and use it in GitHub Desktop.
{
"libraries": [
"d3"
],
"mode": "javascript",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
}
/* css goes here */
<!-- html goes here -->
<div id='list'>
</div>
/* javascript goes here */
var items = [1,2,3,4];
var divs = d3.select('#list')
.selectAll('div.item')
.data(items);
divs.enter()
.append('div').attr('class', 'item');
divs.text(String);
divs.exit().remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment