🌍 Public
Viewing a saved revision (read-only)
c78e12633fc646068375488eedba8017
Activity_6_tut-1
A horizontal bar chart displays the 2020 population for the top 30 countries, sorted by country name with bars extending left-to-right. The visualization uses React with D3 v5's `scaleBand` for the y-axis and `scaleLinear` for the x-axis, rendering SVG rectangles via the `Marks` component. Population values are loaded from a CSV, formatted with `d3.format`, and converted from raw numbers to billions using a custom tick formatter that replaces 'G' with 'B'. The chart includes styled axis ticks, a labeled x-axis, and tooltips showing the formatted population on hover.
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.