Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Map with React & D3 using useRef hook

Public visualization

Viewing a saved revision (read-only)

43ffac06afc04cc4a0a94eaadc1714b0

Map with React & D3 using useRef hook

0 stars0🌍 Public
AAnimesh Nautiyal
Last edited Nov 3, 2020
Created on Nov 3, 2020

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 description

Map