Skip to main content
100%

Ep21 United Nations Bar Chart

✓ Published1🌍 Public
SStoo Sepp
Last edited Oct 30, 2021
Created on Oct 30, 2021

This example displays a horizontal bar chart of the ten most populous countries in 2020, using data loaded from a CSV file of United Nations population estimates. The chart uses SVG rectangles, with each bar’s width scaled by population via `d3.scaleLinear` and its vertical position determined by `d3.scaleBand` based on country name. React manages the data-fetching state through a `useState` hook and `useEffect`, while `d3.csv` asynchronously loads and parses the dataset. The visualization updates only once when the component mounts, rendering a static comparison of national population sizes.

AI-generated description

a program that loads in data about CSS Named Colours using d3 with useState hook to update

MIT Licensed

Similar vizzes