🌍 Public
Viewing a saved revision (read-only)
d06075c822a14e389d80c7d3ea34dc3a
Activity 6_Task 1
This example shows a horizontal bar chart of the 20 most populous countries in 2010, with population values on the x-axis and country names on the y-axis. It uses React with D3 v5’s `scaleBand` and `scaleLinear` to position bars, while custom `AxisBottom` and `AxisLeft` components render tick marks and labels. Data is loaded asynchronously from a CSV via `d3.csv` and `useEffect`, with population converted from thousands. A `Marks` component draws each rectangle and includes a `title` element for hover tooltips.
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.