Skip to content

Instantly share code, notes, and snippets.

@sephcoster
Last active August 29, 2015 14:14
Show Gist options
  • Save sephcoster/c5ca5c8f0d5427b04f83 to your computer and use it in GitHub Desktop.
Save sephcoster/c5ca5c8f0d5427b04f83 to your computer and use it in GitHub Desktop.
D3 Square Blocks
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.axis path {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
</style>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
function() {
var margin = {top: 20, right: 20, bottom: 20, left: 60},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment