🌍 Public
Viewing a saved revision (read-only)
7a8423cded3d4e08ad7ca06bd42c9892
Activity6Question1(2)
This chart displays the top 20 countries by their 2010 population as a horizontal bar chart, built with React and rendered as SVG. It uses d3’s `scaleBand` for the y-axis (country names) and `scaleLinear` for the x-axis (population), with the data loaded via `d3.csv` from a GitHub-hosted CSV file. The bars are colored green, and hovering over a bar reveals its exact population via an SVG `<title>` tooltip, with tick labels formatted using d3’s `format('.2s')` to abbreviate large numbers (e.g., "1.5B").
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.