🌍 Public
Viewing a saved revision (read-only)
e56c6d05c5c94e2aa3cc5cace0fd8f63
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.