Fork of Question 1.2
✓ Published0🌍 Public
This example displays a horizontal bar chart of population data for 20 countries in 2010. The visualization uses React with hooks (useState, useEffect) to load and parse CSV data via the d3.csv method, then renders SVG rectangles scaled with d3.scaleLinear and d3.scaleBand. Custom React components (AxisBottom, AxisLeft, Marks) generate the axes and bars, with D3’s format helper providing abbreviated tick labels like “1.5B” and native SVG <title> elements for 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