🌍 Public
Viewing a saved revision (read-only)
159f3c91c29c4a56b9d317683d56fde8
T8-Q1
This example displays a horizontal bar chart of population data for 30 countries in 2020, using D3 v5 within a React framework to render SVG elements. Bars are colored green, with a blue axis line and formatted tick labels that abbreviate large numbers (e.g., “B” for billions). The code builds scales with `d3.scaleBand` and `d3.scaleLinear`, computes the domain from the CSV data, and uses React components for axes and marks. Data is fetched from a GitHub-hosted CSV file and processed by the `useData` hook.
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.