🌍 Public
Viewing a saved revision (read-only)
7c62428dc29a4cb98a4655b4d21b9522
Activity 6_Task 1
This visualization displays the populations of 30 countries for the year 2020 as a horizontal bar chart, with each bar’s length proportional to its population value. The chart is rendered as an SVG using React components, with D3 v5’s `scaleBand` and `scaleLinear` handling the y-axis categories and x-axis scaling respectively. Population values are formatted with D3’s `format('.2s')` to abbreviate large numbers, converting gigabytes to billions for tick labels. The data is loaded via `d3.csv` from a GitHub-hosted CSV file, and axis ticks and bars are styled with custom CSS classes.
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.