🌍 Public
Viewing a saved revision (read-only)
aa6907f8d4ee49daa32bbeb621f163ee
Activity 6_Q1
This example shows a horizontal bar chart of the populations of 20 countries in 2010, with a green fill for each bar and a tooltip displaying the formatted population value. The chart uses React to render SVG elements, with D3’s `scaleBand` and `scaleLinear` for positioning and the `format` function to abbreviate tick labels (e.g., “1.2B”). Data is loaded from a CSV via D3’s `csv` function, and custom `AxisBottom`, `AxisLeft`, and `Marks` components generate the chart’s axes and rectangles.
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.