Created
December 17, 2012 21:30
-
-
Save tmcw/4322455 to your computer and use it in GitHub Desktop.
Something about d3 I did not understand.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
body { | |
font:normal 14px/20px 'Georgia', serif; | |
} | |
</style> | |
</head> | |
<body> | |
<div id='container'> | |
<h1>Something about d3 I did not understand</h1> | |
</div> | |
<script src='http://d3js.org/d3.v3.min.js'></script> | |
<script> | |
var ol = d3.select('#container') | |
.selectAll('ol') | |
.data(['hello']) | |
.enter() | |
.append('ol'); | |
var abc = ol.selectAll('li') | |
.data(['a', 'b', 'c']) | |
.enter() | |
.append('li') | |
.text(String) | |
.attr('class', String); | |
ol.select('li.c').text(String); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment