activity 6_Task 1
✓ Published0🌍 Public
This example shows a horizontal bar chart of population data for 20 countries in 2020, encoded with SVG rectangles whose lengths reflect population values. The chart uses d3.scaleBand for the categorical country axis and d3.scaleLinear for the population scale, with d3.format for axis tick labels. Data loads from a remote CSV via d3.csv in a custom useData hook, while React manages component state. The code demonstrates modular ES6 imports, including local axis and mark components, and includes an SVG title tooltip for each bar.
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