Skip to main content
100%

Gist 5562531

✓ Published0🌍 Public
RRandomEtc
Last edited May 12, 2013
Created on May 12, 2013

This visualization displays United States zip codes as individual points on an Albers USA projection, highlighting locations that match a user’s typed input. It shows a map of the country where each of the roughly 43,000 ZIP code locations is drawn as a single pixel-sized square, with matching entries turning red in real time. The code uses deeply nested SVG `<g>` elements and CSS classes to target only the changed digits, rather than redrawing the entire map. It relies on D3’s `d3.nest` for hierarchical grouping, `d3.geo.albersUsa` for projection, and transitions on rectangle fills to animate the highlighting effect.

AI-generated description

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.

Similar vizzes