Pathetic Bar Chart
✓ Published1🌍 Public
This example uses React and D3 to render a horizontal bar chart of the ten most populous countries from a UN population dataset. The visualization shows country names on the y-axis and population totals on the x-axis, with each bar’s length proportional to its population value. The code loads CSV data via `d3.csv`, assigns ordinal y-axis scales using `d3.scaleBand`, and a linear x-axis scale constructed with `d3.scaleLinear` and `d3.max`. React’s `useEffect` hook triggers the asynchronous data fetch, and the final SVG is built by mapping over the data to output `rect` elements.
AI-generated descriptionA program that loads in some data about CSS named colors using D3 utilities, and uses React to render the data as a radial burst!
MIT Licensed