task 1 question 2
✓ Published0🌍 Public
This example displays a horizontal bar chart of the top 20 countries by 2010 population, sourced from a CSV file accessed via a GitHub URL and loaded with `d3.csv`. It uses React and `d3.scaleBand` and `d3.scaleLinear` to position bars, with `AxisBottom` and `AxisLeft` components rendering tick marks and labels. Bars are drawn as SVG `<rect>` elements with a native `<title>` tooltip showing the formatted population value via `d3.format` (displaying “B” for billions), while axis styling uses blue tick lines and light green bars.
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