Skip to main content
100%

react first level drilldown map using zoom

✓ Published8🌍 Public
AAnimesh Nautiyal
Last edited Feb 23, 2023
Created on Oct 16, 2020

This example shows a first-level drilldown map of India that zooms into the selected state or district. Clicking a polygon triggers a smooth zoom animation that fits the clicked region’s bounding box, computed with `d3.geoPath().bounds`, before updating the rendered features. The map uses React state to toggle between state-level and district-level TopoJSON data, loaded via `d3.json`, while `d3.zoom` handles pan and scale transforms on the SVG. The `geoMercator` projection and `geoPath` render the geographic boundaries in a teal fill.

AI-generated description

react first level drilldown map using zoom

MIT Licensed

Similar vizzes