Activity6_population_Q1.1
✓ Published0🌍 Public
This example shows the population of ten countries in the year 2000 using a horizontal bar chart, where bar length encodes population and a tooltip displays the formatted value. The visualization is built with React and D3 v5, using `d3.scaleBand` for the country categories on the y-axis and `d3.scaleLinear` for the population scale on the x-axis. The chart loads CSV data from a GitHub repository via `d3.csv`, formats axis tick labels with `d3.format`, and renders the bars and axes as SVG elements. The code demonstrates the use of local ES6 modules for axis and mark components, alongside React’s `useData` hook for data loading.
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