Fork of Making a bar chart
✓ Published0🌍 Public
This example uses React to render a horizontal bar chart of the 12 most populous countries, based on 2020 UN population estimates loaded from a CSV file with D3’s `csv` function. The chart displays each country’s name on the vertical axis, scaled with `scaleBand`, and its population on the horizontal axis, scaled with `scaleLinear`. SVG `<rect>` elements are generated directly in JSX, with widths computed from the population values. The code also includes a simple loading state and uses React’s `useState` and `useEffect` hooks to manage asynchronous data fetching.
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