🌍 Public
Viewing a saved revision (read-only)
528b0105a81a48738253067bab1c3450
The margin convection
This example displays a horizontal bar chart ranking the top ten countries by population in 2020, using data loaded from a CSV file. The visualization uses React state to asynchronously fetch the data with `d3.csv`, then renders SVG bars whose widths are scaled by a `scaleLinear` and whose positions are set by a `scaleBand`. The chart is framed with margins and uses a `g` element transformed to align the plot area.
AI-generated descriptionA program that loads in some data using d3 utilities, and uses React state to keep track of data