Skip to main content
100%

Zoom to Bounding Box II - Updated for d3 v4

✓ Published0🌍 Public
GGerardoFurtado
Last edited May 29, 2018
Created on May 29, 2018

This example demonstrates zooming and panning over a map of the United States, where clicking a state smoothly transitions the view to focus on that state’s bounding box. The visualization also supports free-form mouse or touch dragging and zooming. Built with d3.v4 and TopoJSON, it uses `d3.geoAlbersUsa` for the projection and `d3.geoPath` to render state shapes. Zoom interactions are handled via `d3.zoom` with a `d3.zoomIdentity` transform, and transitions animate the view using `zoom.transform`. The underlying GeoJSON data comes from a TopoJSON file of US states.

AI-generated description

Updated variant of Zoom to Bounding Box II for d3 v4 which is also a 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/iamkevinv/'>iamkevinv</a>'s block: <a href='http://bl.ocks.org/iamkevinv/0a24e9126cd2fa6b283c6f2d774b69a2'>Zoom to Bounding Box II - Updated for d3 v4</a>

gpl-3.0 Licensed

Similar vizzes