🌍 Public
Viewing a saved revision (read-only)
79cab11f2cd248648c3efefcf29f8935
activity6_q1.-2
This visualization displays the populations of 20 countries for the year 2010 using a horizontal bar chart, with each bar's length proportional to its population. The data is loaded from a CSV file using D3's `csv` function and rendered as SVG rectangles via React's declarative syntax. The chart employs D3's `scaleBand` for the categorical y-axis and `scaleLinear` for the quantitative x-axis. Formatting converts large numbers to abbreviated forms like "B" for billions, while tooltips show the exact values. Axes and bars are styled through CSS classes defined in the embedded stylesheet.
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.