Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Ep21 United Nations Bar Chart

Public visualization

Viewing a saved revision (read-only)

ec8a2ef53ca241a7b01a000230a3af46

Ep21 United Nations Bar Chart

0 stars1🌍 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