Skip to content

Instantly share code, notes, and snippets.

@bycoffe
Created May 16, 2013 14:50
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 bycoffe/5592270 to your computer and use it in GitHub Desktop.
Save bycoffe/5592270 to your computer and use it in GitHub Desktop.
vertices = [];
for (i=0; i<turnoutData.length; i++) {
vertices.push([x(turnoutData[i].date), y(turnoutData[i].registered_voters_percent)])
}
svg.selectAll("path.cell")
.data(d3.geom.voronoi(vertices))
.enter().append("path")
.attr({
"class": "cell",
d: function(d, i) {
return "M" + d.join("L") + "Z";
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment