activity 6_Task 1
✓ Published0🌍 Public
This visualization displays a horizontal bar chart comparing the populations of the top 20 countries in 2010, with bars sorted by population size. Built with React and D3 v7, it loads data from a CSV file via `d3.csv` and renders the chart as SVG. The chart uses `scaleBand` for the y-axis (country names) and `scaleLinear` for the x-axis (population), with bars drawn as SVG rectangles. The code demonstrates custom axis components, tick formatting that converts large numbers to "B" for billions, and tooltips on hover showing population values.
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.
MIT Licensed