The Margin Convention
✓ Published1🌍 Public
This example shows a horizontal bar chart of the ten most populous countries, using UN population data for 2020. The chart applies a standard margin convention using D3’s `scaleBand` for the categorical country names and `scaleLinear` for population counts, rendered as SVG rectangles inside a translated group. The visualization is built with React, which manages the loading state via `useState` and `useEffect`, while D3’s `csv` utility fetches and parses the data before it is sliced and mapped to bars.
AI-generated descriptionA program that loads in some data about country populations using D3 utilities, and uses React to render the data as a bar chart.
MIT Licensed