Zoom to Bounding Box II d3v4
A choropleth-style map of U.S. states loads with a free pan-and-zoom interface. Clicking a state smoothly zooms to fit that state’s bounding box using a 750-millisecond transition, while a red highlight marks the active state; clicking the background resets the view. The visualization uses D3 v4’s `d3.zoom`, `d3.geoPath` with an Albers USA projection, and TopoJSON state boundaries. Zoom transitions interpolate between `d3.zoomIdentity` transforms, and stroke widths scale inversely with the zoom level for crisp rendering.
AI-generated descriptionA variant of the Zoom to Bounding Box example that uses zoom transitions to smoothly interpolate between different views. This example also allows you to freely pan and zoom with the mouse (or touch).
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/9656675'>Zoom to Bounding Box II</a>
forked from <a href='http://bl.ocks.org/Fil/'>Fil</a>'s block: <a href='http://bl.ocks.org/Fil/652458d1831e41de6efe1d453152131b'>Zoom to Bounding Box II d3v4</a>