🌍 Public
Viewing a saved revision (read-only)
5c07e6750d514bc5ab0f229a073ce29f
activity questi1 answer
This example shows a horizontal bar chart of population estimates for 20 countries in 2020, with each bar labeled by country name and population value formatted in billions. The chart uses React with D3 v5, where `scaleBand` positions countries along the vertical axis and `scaleLinear` maps population counts to bar widths. Data is loaded asynchronously from a CSV file via `d3.csv`, and the bars render as SVG rectangles with tooltips displaying the formatted population values. Custom `AxisBottom` and `AxisLeft` components generate the tick marks 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.