activity_6 fork
✓ Published1🌍 Public
This example shows a horizontal bar chart ranking the populations of thirty countries in 2020, using a React component that renders an SVG. The code imports D3’s `scaleBand`, `scaleLinear`, `max`, `format`, and `csv` to load data from a GitHub-hosted CSV, scale the values, and create tick labels formatted in billions. Custom React components render the axes and marks, with bars colored green and blue tick lines, while a `<title>` element provides 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.
MIT Licensed