Last active
December 22, 2015 17:00
-
-
Save Butterwell/1a3c01791071baa5a997 to your computer and use it in GitHub Desktop.
Hexes Only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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