Viewing a saved revision (read-only)
10323edbf7634825a3b5ad506b8f9e48
Activity-6_Task 1
This visualization is a horizontal bar chart displaying the 2020 population estimates for 30 countries, sourced from a CSV file hosted on GitHub. The chart uses green bars, with the length of each bar proportional to the population value, and includes a formatted x-axis that abbreviates large numbers (e.g., converting billions to "B"). The code leverages D3's `scaleBand` for the categorical country axis, `scaleLinear` for the population axis, and React's `useEffect` hook to asynchronously load and parse the data with `csv`. The rendering is done entirely through SVG elements, with the data plotted using `rect` marks and tooltips provided via `<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.