Q1.2
✓ Published0🌍 Public
This example visualizes the top 20 countries by population for 2020 using a horizontal bar chart rendered with SVG in React. The visualization employs D3 v5 scales, including `scaleBand` for the y-axis and `scaleLinear` for the x-axis, with country names on the vertical axis and population values on the horizontal axis. Data loads from a remote CSV file via `d3.csv` and displays tick marks with blue lines. Population values are formatted using D3's `format('.2s')` to abbreviate large numbers into billions, and each bar includes a native SVG tooltip showing its exact value.
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