🌍 Public
Viewing a saved revision (read-only)
3db1bffd9bae46c188ad42b16bcae501
Axes with React and D3
This example displays horizontal bar charts of the top ten countries by 2020 population from a United Nations CSV dataset. It uses React state to load the data through D3's `csv` utility, then renders an SVG with D3's `scaleBand` and `scaleLinear` for the axes. The code draws axis lines and tick labels via `.ticks()`, and creates the bars as SVG `rect` elements.
AI-generated descriptionA program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data