Skip to content

Instantly share code, notes, and snippets.

@drsm79
Last active September 6, 2016 10:01
Show Gist options
  • Save drsm79/5336218 to your computer and use it in GitHub Desktop.
Save drsm79/5336218 to your computer and use it in GitHub Desktop.
d3
<html>
<head>
<script type="text/javascript" src="d3.v3.js" charset="UTF-8"></script>
</head>
<body>
<div id="d3workspace"></div>
<script type="text/javascript">
// Pick the #d3workspace element
d3.select('#d3workspace')
// We're going to work with a p element
.selectAll("p")
// bind some data to it
.data(["World"])
// 'enter' into the the data
.enter()
// append a paragraph element
.append("p")
// render text into that element
.text(function(d) {
console.log("I'm processing data with d3!!");
return "Hello " + d + "!";
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment