Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Pathetic Bar Chart

Public visualization

Fork of Pathetic Bar Chart

0 stars1🌍 Public
Kkrithika
Last edited Nov 23, 2021
Created on Nov 23, 2021
Forked from Pathetic Bar Chart

This example displays the ten most populous countries as a pathetic bar chart with no axes or labels, using horizontal rectangles sized by each country’s 2020 population estimate. The visualization is built with React and D3 v5, where `d3.csv` loads the United Nations World Population Prospects data, `d3.scaleBand` positions the bars vertically, and `d3.scaleLinear` maps population values to bar widths. Rendered as an SVG, the chart updates from a loading state once the data is fetched, using React’s `useState` and `useEffect` hooks. Data is sorted by population in descending order before the top ten are selected.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.

Comments

Sign in to join the discussion.

MIT Licensed