🌍 Public
Viewing a saved revision (read-only)
a50d1323de9244a9ab1e8fe4b62e6b95
Activity6_population
This example shows a horizontal bar chart of the populations of 20 countries in 2010, ordered by country name. The chart uses D3’s `scaleBand` and `scaleLinear` to map countries and population values to SVG rectangles, with axes built from custom React components. Population values are formatted with D3’s `format` function, converting values like “1.2G” to “1.2B”. The data is loaded asynchronously from a CSV file via `d3.csv`, and the rendering is done through React with SVG, using a light green fill for the bars and tooltips provided by SVG `<title>` elements.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.