🌍 Public
Viewing a saved revision (read-only)
d63ebd9f0d76479584aa03b573f0c6ec
Activity6-Tutorial
This example shows a horizontal bar chart of 2020 population figures for 30 countries, with bars colored light green and a blue axis. It uses React with D3 v5 scales—`scaleBand` for the categorical country axis and `scaleLinear` for the population axis—to render SVG rectangles via the `Marks` component. Axis labels are generated with custom `AxisBottom` and `AxisLeft` components, and population values are formatted using D3’s `format('.2s')` to display abbreviations like "B" for billions. Data is loaded asynchronously from a CSV file via `d3.csv`.
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.