🌍 Public
Viewing a saved revision (read-only)
fca6cab242e74fcd8080f709718b3d6a
In the Margins
This example visualizes the top 10 most populous countries in the world using a horizontal bar chart. The bars are rendered as SVG rectangles, with their lengths scaled proportionally to each country’s 2020 population estimate from the UN Population data. The code uses React with hooks like `useState` and `useEffect` to load and manage the data, and D3 modules such as `scaleBand` and `scaleLinear` for positioning and scaling. The chart is drawn entirely with SVG, with margins applied to the axis area.
AI-generated descriptionReact Starter code.