A test for wrapping using the d3.geo.tile plugin.
Based on Mike Bostock’s example.
A test for wrapping using the d3.geo.tile plugin.
Based on Mike Bostock’s example.
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.
.DS_Store | |
build | |
node_modules |
A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.
[D3’s implementation](Sutherland–Hodgman algorithm) 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.
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.
build | |
node_modules |
A demonstration of D3’s vertically-oriented bullet charts, based on this example.
Based on Mike Bostock’s [World Map][0], modified to automatically colour countries such that no adjacent countries share the same colour.
This is done by extracting the topology via [TopoJSON][1] and greedily picking colours until the constraint is fulfilled.
See also: [Graph coloring][2] on Wikipedia.
Update: Greedily colouring is now performed in a single line, thanks to Mike Bostock!
Trying to figure out if there’s a problem with Australia
Note how the geodesic is always a straight line under the orthographic projection, since it is always going through the centre. (Except for the initial view centred at (0°, 0°), which is not on the geodesic). This is true for all azimuthal projections.
A version of Mike Bostock’s animated world countries, which uses a more accurate spherical interpolation.