View keybase.md

Keybase proof

I hereby claim:

  • I am jasondavies on github.
  • I am jasondavies (https://keybase.io/jasondavies) on keybase.
  • I have a public key whose fingerprint is 341D 39FF 0F5D 07C5 3BE7 9A5D BAE3 9383 18C9 0D61

To claim this, I am signing this object:

View README.md
View README.md

A version of Mike Bostock’s hexbin example, modified to use hexagons rotated by 90°. Aside from rotating the hexagon primitives, the only other change is to swap the meaning of x and y, for all inputs and outputs of the plugin.

View .gitignore
.DS_Store
build
node_modules
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.voronoi {
fill-opacity: .5;
}
.delaunay {
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style> body { font-family: sans-serif; } </style>
<body>
<script src="require.js"></script>
<script>
require.config({
paths: {
d3: "http://d3js.org/d3.v3.min"
}
View csv-benchmark
#!/usr/bin/env node
var d3 = require("./");
var csv = ["foo", "bar", "baz", "foobarbaz", "BLAHBLAH"].join(",") + "\n" +
d3.csv.formatRows(d3.range(10000).map(function() {
return d3.range(5).map(Math.random);
}));
benchmark("Slow", function() { parseSlow(csv); });
View README.md

A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.

D3’s implementation of the Sutherland–Hodgman algorithm only works for convex clip polygons, but we exploit the fact that Voronoi regions are guaranteed to be convex, and use each Voronoi region as a clip polygon, with the projected geographic boundary as a subject polygon.

In response to a question by Gonzalo Bellver.

View README.md

There seems to be a bug in voronoi clipping; setting .clipExtent([[-1, -10], [width + 1, height + 1]]) works around the issue for these particular points.

View .gitignore
build
node_modules