Activity-6-Q1.2
✓ Published0🌍 Public
This example displays a horizontal bar chart showing the population of the first 20 countries from a 2010 CSV dataset, using an SVG rendering approach within a React application. The chart incorporates D3.js v5 scales, including `scaleBand` for the categorical y-axis and `scaleLinear` for the quantitative x-axis, with axes formatted using D3's `format` function to abbreviate large numbers. Each bar includes a tooltip showing the population value via the SVG `<title>` element, while the data is loaded from a GitHub-hosted CSV file using `d3.csv` and processed asynchronously with React hooks.
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