Skip to content

Instantly share code, notes, and snippets.

View jasondavies's full-sized avatar
💭
💡

Jason Davies jasondavies

💭
💡
View GitHub Profile
@jasondavies
jasondavies / README.md
Last active August 29, 2015 13:58 — forked from mbostock/README.md
Voronoi Clip Bug

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.

@jasondavies
jasondavies / .gitignore
Last active October 27, 2019 19:48 — forked from mbostock/.block
Ocean
build
node_modules
@jasondavies
jasondavies / README.md
Last active June 13, 2019 23:16 — forked from mbostock/.block
Vertical Bullet Charts
@jasondavies
jasondavies / README.md
Last active December 15, 2015 13:58
IRI Retrieval Bug
@jasondavies
jasondavies / index.html
Last active December 14, 2015 11:58
d3.geo viewport clipping
<!DOCTYPE html>
<script>window.top.location.replace("http://www.jasondavies.com/maps/clip-extent/")</script>
@jasondavies
jasondavies / README.md
Created December 2, 2012 11:54 — forked from mbostock/.block
World Map

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!

@jasondavies
jasondavies / README.md
Created December 2, 2012 10:04 — forked from jasondavies/README.md
Australia↔Austria

Trying to figure out if there’s a problem with Australia↔Austria spherical linear interpolation in the [World Countries][1] example, as hinted at by Hadley Wickham.

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.

@jasondavies
jasondavies / README.md
Created December 1, 2012 18:19 — forked from mbostock/.block
World Countries
@jasondavies
jasondavies / us-boundary.json
Created November 30, 2012 00:08 — forked from mbostock/us-boundary.json
Shared Data
{"type":"MultiPolygon","coordinates":[[[[-155.59,20.14],[-155.58,20.13],[-155.57,20.13],[-155.56,20.14],[-155.55,20.14],[-155.53,20.14],[-155.49,20.11],[-155.45,20.11],[-155.34,20.06],[-155.21,20],[-155.17,19.97],[-155.09,19.88],[-155.08,19.87],[-155.08,19.84],[-155.08,19.77],[-155.07,19.74],[-155.06,19.74],[-155.02,19.75],[-154.99,19.74],[-154.98,19.73],[-154.98,19.72],[-154.97,19.67],[-154.96,19.65],[-154.92,19.61],[-154.87,19.59],[-154.79,19.54],[-154.8,19.52],[-154.81,19.5],[-154.82,19.48],[-154.83,19.46],[-154.91,19.42],[-154.92,19.41],[-155.01,19.33],[-155.02,19.33],[-155.05,19.32],[-155.07,19.32],[-155.1,19.3],[-155.17,19.28],[-155.19,19.28],[-155.27,19.28],[-155.29,19.27],[-155.3,19.27],[-155.32,19.25],[-155.35,19.22],[-155.37,19.22],[-155.38,19.21],[-155.4,19.2],[-155.42,19.18],[-155.44,19.17],[-155.49,19.14],[-155.5,19.14],[-155.55,19.1],[-155.55,19.08],[-155.57,19.03],[-155.61,18.97],[-155.63,18.96],[-155.64,18.95],[-155.66,18.93],[-155.67,18.93],[-155.67,18.94],[-155.69,18.96],[-155.71,18.99],[-15
@jasondavies
jasondavies / README.md
Created November 16, 2012 23:20 — forked from mbostock/.block
World Boundaries TopoJSON