Skip to content

Instantly share code, notes, and snippets.

@Butterwell
Last active December 22, 2015 17:00
Show Gist options
  • Save Butterwell/1a3c01791071baa5a997 to your computer and use it in GitHub Desktop.
Save Butterwell/1a3c01791071baa5a997 to your computer and use it in GitHub Desktop.
Hexes Only
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke-linejoin: round;
stroke: #000;
}
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/d3.hexbin.v0.min.js"></script>
<script>
var width = 971;
var height = 600;
var hexbin = d3.hexbin()
.size([width, height])
.radius(40);
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
var mesh = hexbin.mesh()
svg.append("path")
.attr("d", mesh)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment