🌍 Public
Viewing a saved revision (read-only)
a0a9204e680f410ca5b0840cc013e630
Activity6_q1.2
A horizontal bar chart displays the population of 20 countries in 2010, with each bar’s length proportional to its population value. The chart uses React to render SVG elements, with D3’s `scaleBand` and `scaleLinear` mapping country names and population values to pixel positions. Data is loaded via `d3.csv` from a GitHub-hosted CSV file, and axes are built using custom React components. Tick labels are formatted with `d3.format` to abbreviate large numbers (e.g., converting “G” to “B” for billions).
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.