click-to-zoom via transform
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Mar 26, 2012
Clicking a US state zooms to that state via a SVG transform transition, while clicking the background resets the view. The map renders TopoJSON data through `d3.geo.albersUsa` projection and `d3.geo.path`, with state borders drawn from a topology mesh. An orange highlight marks the active state, and stroke width inversely scales with zoom. The interaction uses a `g.transition()` to animate `translate` and `scale` attributes over 750 milliseconds.
AI-generated descriptionPart of a series of examples. See:
- mousewheel-zoom + click-to-center via projection
- click-to-center via projection
- click-to-center via transform
- click-to-zoom via transform
More recently, see the Zoom to Bounding Box example.
gpl-3.0 Licensed