Skip to main content
100%

Fork of Rendering data with React and D3

✓ Published0🌍 Public
YYibo Zhang
Last edited Jan 13, 2022
Created on Jan 13, 2022

This example shows a horizontal bar chart of the top 10 countries by 2020 population, rendered as SVG rectangles. It loads UN population data from a CSV file using `d3.csv`, then maps the data to React state with `useState` and `useEffect`. The chart uses `d3.scaleBand` for the y-axis country categories and `d3.scaleLinear` for the x-axis population values, with each bar’s width and position computed from these scales. React renders the SVG elements, while D3 handles data parsing and scaling.

AI-generated description

Rendering Data with React and D3

MIT Licensed

Similar vizzes