Skip to content

Instantly share code, notes, and snippets.

@HermanSontrop
Last active January 2, 2016 00:39
Show Gist options
  • Save HermanSontrop/8224652 to your computer and use it in GitHub Desktop.
Save HermanSontrop/8224652 to your computer and use it in GitHub Desktop.
d3 hello world example
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var w=960,h=500;
var svg = d3.select("body")
.append("svg")
.attr("width",w)
.attr("height",h);
svg.append("text")
.text("hello world!")
.attr("x",100)
.attr("y",100);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment