The Margin Convention
✓ Published1🌍 Public
This visualization displays a horizontal bar chart of the ten most populous countries, using the United Nations 2019 population estimates. The chart is rendered as SVG elements within a React component. The data is loaded using `d3.csv`, with the y-axis scaled by country name via `d3.scaleBand` and the x-axis scaled by population count using `d3.scaleLinear`. React's `useState` and `useEffect` manage data loading and state, while D3's `max` function determines the chart’s domain. The visualization follows a margin convention with a 20-pixel inset on all sides of the 960x500 SVG canvas.
AI-generated descriptionA program that loads in some data using d3 utilities, and uses react state to keep track of the data.
MIT Licensed