🌍 Public
Viewing a saved revision (read-only)
61ec48208bb4457791c8b03c32ea4c93
Axis with React and D3
This example visualizes the top 20 countries by 2020 population as a horizontal bar chart, using React for rendering and D3 for data loading and scales. It fetches CSV data with `d3.csv` and constructs band and linear scales via `d3.scaleBand` and `d3.scaleLinear`. Axes are hand-drawn as SVG lines and text elements, with ticks generated from `xScale.ticks()`. The React component manages state with hooks (`useState`, `useEffect`) and updates the SVG output accordingly.
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!