Skip to content

Instantly share code, notes, and snippets.

@milroc
Forked from milroc/README.md
Created July 6, 2012 22:34
Show Gist options
  • Save milroc/3063137 to your computer and use it in GitHub Desktop.
Save milroc/3063137 to your computer and use it in GitHub Desktop.
bl.ocks template

Template for creating bl.ocks.

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="style.css"/>
</head>
<body>
<script src="http://mbostock.github.com/d3/d3.js?2.7.2"></script>
<script src="src.js"></script>
<script src="test.js"></script>
<script src="lib.js"></script>
</body>
</html>
d3.helper = {};
d3.helper.property = function(value) {
return function(_) {
if (!arguments.length) return value;
value = _;
return this;
};
};
function chartType() {
function chart(selection) {
//render chart
}
return chart;
}
body {
background-color: #FFF;
}
var data = [];
d3.select("body").append("svg")
.data(data)
.call(chartType);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment