🌍 Public
Viewing a saved revision (read-only)
d35ce0bf9ee247709b7f92a155a8a5cc
activity 6_Task 1
This example shows a horizontal bar chart comparing the populations of ten countries in the year 2000. The bars are rendered as SVG rectangles, with the x-axis using a linear scale for population values and the y-axis using a band scale for country names. The visualization is built with React and D3 v5, using `scaleBand` and `scaleLinear` to position the marks, and custom `AxisBottom` and `AxisLeft` components to draw the axes and tick labels. Data is loaded from a remote CSV file using D3’s `csv` function, and the population values are formatted using D3’s `format` with a `.2s` abbreviation that converts gigabytes to billions.
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.