Fork of Fork of activity 6_Question 1B
✓ Published0🌍 Public
This example displays a horizontal bar chart of population data for 20 countries in 2010, using SVG rendering within a React framework. The chart reads a CSV file from a GitHub URL, which is fetched and parsed using D3's `csv` function, then processed with a custom `useData` hook. It builds scales with D3's `scaleBand` and `scaleLinear` functions to position bars and axes, and formats x-axis tick labels using D3's `format` function. User interaction is limited to tooltips showing each bar's value via an SVG `<title>` element.
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.
MIT Licensed