π Public
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.
MIT Licensed
Comments
Sign in to join the discussion.