This animated bar chart is adapted from Mike Bostock's sample bar chart to allow redrawing and animated transitions.
This file contains hidden or 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
| TILE_SIZE = 256.0 | |
| PX_TO_COORD = 1.0 / TILE_SIZE | |
| RAD_2_DEG = 180.0 / Math::PI | |
| DEG_2_RAD = Math::PI / 180.0 | |
| TWO_PI = Math::PI * 2.0 | |
| MAX_ZOOM = 20 | |
| module TileMaps | |
| def lng_lat_to_mercator(lng, lat) | |
| # turn degrees into radians |
This file contains hidden or 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
| var data = [ ], | |
| width = 500, | |
| height = 500, | |
| id = 0; | |
| function addRandom() { | |
| data.push({ | |
| x: width * Math.random(), | |
| y: height * Math.random(), | |
| r: 10 * Math.random(), |
An exploration of Mike Bostock's take on Ben Fry’s zipdecode, inspired by Nelson Minar’s reimplementation. This one uses deeply nested SVG elements and classes to target only the things that need to change.
Nesting the SVG made DOM creation bearable, but this is still too slow. Use Mike's canvas approach if you're looking for the "best" way to do this.
Fine-grained control of randomly entering and exiting things in D3.js, for impeccable object constancy. Adapted from an example co-authored with Mike Bostock.
Tissot's Indicatrix rendered with D3.
NB:- see Jason's comment about these not being "true" Tissot indicatrices.
This file contains hidden or 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
| // TODO: options parser with overrides for projection, area etc. | |
| if (process.argv.length != 4) { | |
| console.error("usage: node convert.js <input.json> <output.json>"); | |
| process.exit(1); | |
| } | |
| require('d3') | |
| require('./node_modules/d3-plugins/simplify/simplify.js') | |
| var fs = require('fs'); |
Number of responses by zip code from the USGS' site from the 2011-11-05 3.2 quake near Piedmont, CA, USA, via Yahoo! Pipes.
This file contains hidden or 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
| --- | |
| BUNDLE_WITHOUT: "" |