🌍 Public
Viewing a saved revision (read-only)
1c8987ac397e4b2db5445b47011d7f94
Axis with React and D3
This example displays a horizontal bar chart of 2019 UN population data for nine countries, using a linear x-axis for population values and a banded y-axis for country names. The visualization renders as SVG and combines React state management with D3 utilities: `csv` loads the dataset, `scaleLinear` and `scaleBand` construct the axes, and `max` computes the domain. React's `useState` and `useEffect` handle data loading, while manual tick generation from `xScale.ticks()` draws grid lines and labels.
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.