Q1.2
✓ Published0🌍 Public
This example displays a horizontal bar chart of population data for 20 countries in 2010, using green bars sorted alphabetically by country name. It loads CSV data from a GitHub repository via D3's `csv` function and renders the chart as SVG through React components. The code imports React, ReactDOM, and D3 v5 functions including `scaleBand`, `scaleLinear`, `scaleLinear`, `max`, and `format`, with custom `AxisBottom`, `AxisLeft`, and `Marks` components handling tick marks, labels, and 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