🌍 Public
Viewing a saved revision (read-only)
75e20c7aa67e49edbb31e4dec7cef2a3
Activity6_Question1.2
This example displays a horizontal bar chart of population data for 20 countries in 2010, with each bar’s length proportional to the country’s population. The visualization uses React components to render SVG elements, with D3 v5’s `scaleBand` and `scaleLinear` handling the y- and x-axis mappings, respectively. Data is loaded via D3’s `csv` method from a GitHub-hosted dataset, and the bars include a native SVG `<title>` element for tooltips. The axes are customized with pink tick lines and a formatted tick label that converts values into billions (e.g., using `format('.2s')`).
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.