Activity-8 Q1.2
✓ Published0🌍 Public
This example presents a horizontal bar chart showing the populations of 20 countries for the year 2010, using data from a remote CSV file. The visualization uses D3 v5 within a React framework, rendering a scalable vector graphic (SVG) with green bars. It employs D3’s `scaleBand` for the categorical country axis and `scaleLinear` for the population scale, while the `AxisBottom` and `AxisLeft` modules generate tick marks. The code also demonstrates custom formatting, converting values to billions with the `format` function, and uses React's `useData` hook to load and process the data.
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