π Public
Viewing a saved revision (read-only)
658573558f074cab83626b601d3ede6b
Map with React & D3 using useRef hook
A world map visualizes country-level metrics such as population, name length, and GDP, colored on a grayscale-to-red gradient. Clicking a country zooms the projection to focus on that selection. Built with React and D3 v5, the example uses `useRef` and a custom `useResizeObserver` hook to track container dimensions, `geoMercator().fitSize` for projection, `geoPath` for rendering, and `scaleLinear` for the color scale with transitions on attribute updates.
AI-generated descriptionMap