🌍 Public
Viewing a saved revision (read-only)
29864b32dafa42c4889fabc1e51c2592
Task1_activity7
This example shows a horizontal bar chart ranking the populations of ten countries in the year 2000, using a dataset loaded from a GitHub-hosted CSV file. The bars are rendered as SVG rectangles via React components, with D3’s `scaleBand` and `scaleLinear` mapping country names and population values to positions and lengths. Axis components generate ticks and labels, while a `format` function converts numbers into abbreviated units like billions. The code initializes data asynchronously with `useEffect` and `csv`, and applies a custom CSS style for tick lines and bar fills.
AI-generated descriptionA demonstration of how to start using D3 version 6.