🌍 Public
Viewing a saved revision (read-only)
f2a9e9a7190048e79f000a43b88f11c9
activity 6_Task 1
This example shows a horizontal bar chart of population data for 20 countries in 2010, with countries listed along the y-axis and population values along the x-axis. The visualization uses React components to render SVG elements, with D3’s scaleBand and scaleLinear mapping data to positions and widths. The code imports csv from d3 to load the dataset from a GitHub gist, while AxisBottom and AxisLeft components generate tick marks and labels. Bars are drawn as SVG rectangles with a light green fill, and hovering reveals a tooltip with formatted 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.