🌍 Public
Viewing a saved revision (read-only)
f35365b319574224a708b214eb4ba2c5
Fork of Pathetic Bar Chart
This example displays the ten most populous countries as horizontally oriented bars without axes or labels, using a simple SVG bar chart. It loads United Nations World Population Prospects 2019 data via `d3.csv`, then sorts the first ten rows by population. React state management with `useState` and `useEffect` handles the asynchronous data loading, while D3’s `scaleBand` and `scaleLinear` map countries and population values to screen coordinates. The bars are rendered as SVG `<rect>` elements, with each bar’s width proportional to its country’s 2020 population estimate.
AI-generated descriptionA program that shows the top 10 most populous countries as a pathetic bar chart with no axes.