Created
April 10, 2013 13:20
-
-
Save u110/5354552 to your computer and use it in GitHub Desktop.
Introduction of d3.js http://d3js.org/
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
<html> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
</head> | |
<body> | |
<p>this is a test01.</p> | |
<p>this is a test02.</p> | |
<p>this is a test03.</p> | |
<script> | |
// var paragraphs = document.getElementsByTagName("p"); | |
// for (var i = 0; i < paragraphs.length; i++) { | |
// var paragraph = paragraphs.item(i); | |
// paragraph.style.setProperty("color", "white", null); | |
// } | |
d3.selectAll("p").style("color", "white"); | |
// d3.select("body").style("background-color", "black"); | |
// d3.selectAll("p").style("color", function() { | |
// return "hsl(" + Math.random() * 360 + ",100%,50%)"; | |
// }); | |
// d3.selectAll("p").style("color", function(d, i) { | |
// return i % 2 ? "#fff" : "#eee"; | |
// }); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment