🌍 Public
Viewing a saved revision (read-only)
6d3aa33e51f64cddbad8cb5a990691f2
activity 6_Task 1
This example shows the population of 20 countries in 2010 as a horizontal bar chart, with country names on the y-axis and population values on the x-axis. The visualization uses React to render SVG elements, with D3 v5’s `scaleBand` and `scaleLinear` for positioning and a custom `tooltipFormat` that abbreviates large numbers. Data is loaded as CSV using `d3.csv` and sliced to the first 20 rows, while axis ticks are generated with `xScale.ticks()` and labeled via the `format` API.
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.