🌍 Public
Viewing a saved revision (read-only)
c87c56133b3541629cc27a57a8cf80ac
Activity6_question1.2
This example displays a horizontal bar chart of the population for the top 20 countries in 2010, sorted by country name. Each bar’s length encodes the population value, with a tooltip revealing the precise number on hover. The visualization is built with React, using D3 v5’s `scaleBand` and `scaleLinear` for positioning, and renders SVG `<rect>` elements for the marks. The data is loaded from a CSV file using D3’s `csv` function, and custom axis components generate the ticks and labels.
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.