Skip to content

Instantly share code, notes, and snippets.

@dribnet
Created December 18, 2012 08:18
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 dribnet/4326085 to your computer and use it in GitHub Desktop.
Save dribnet/4326085 to your computer and use it in GitHub Desktop.
d3 http://bl.ocks.org/ template

A simple template for blocks gists. Replace the code, drop a new 230x120 png, and of course update this README. After updating, look for the result on the blocks account page.

<!DOCTYPE html>
<meta charset="utf-8">
<style>
/* css goes here */
body {
font: 40px sans-serif;
}
div#target {
text-align: center;
background-color: lightblue;
}
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<div id="target">
<!-- d3 goodness here -->
</div>
<script>
/* d3.js code goes here */
d3.select("#target")
.style("width", "230px")
.style("height", "120px")
.selectAll("div")
.data(["hello", "world"])
.enter().append("div")
.text(function(d) { return d; });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment