click-to-zoom w. shadow & transition
✓ Published0🌍 Public
PPatrick Wojda
Last edited Sep 27, 2016
Created on Sep 26, 2016
Clicking a US state zooms the map to that state with a smooth transform transition, dims all other states, and applies a drop-shadow filter to highlight the selected state. Clicking the background resets the view and restores full opacity. The example renders SVG paths from TopoJSON state boundaries using `d3.geo.path` and an Albers USA projection, animating the zoom with `transition.attr`. A custom `moveToFront` selection method brings the active state to the top of the SVG stack.
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.
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/2206590'>click-to-zoom via transform</a>
gpl-3.0 Licensed