🌍 Public
Viewing a saved revision (read-only)
3e74ada2692d4a34b30da93c4e7be0f6
Axis with React
This example shows a horizontal bar chart of the top 10 countries by population in 2020, using data loaded from a CSV file via `d3.csv`. React renders an SVG containing scaleBand and scaleLinear axes, with custom tick marks and labels generated from `xScale.ticks()`. The bars are drawn as `<rect>` elements using D3’s scale functions, while React hooks (useState, useEffect) manage data loading and state. The chart updates automatically once the data arrives, displaying a clean, styled visualization with a left margin for country names.
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!