Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

UN Population Bar Chart

Public visualization

Viewing a saved revision (read-only)

945e793e221a403ba12c0e35a4569a20

UN Population Bar Chart

0 stars1🌍 Public
SSun Hwy (David) Kim
Last edited Apr 4, 2022
Created on Apr 4, 2022

This example shows a horizontal bar chart of the top 10 countries by population from the UN’s 2019 dataset. It uses React state to load and store the CSV data, while D3’s `scaleBand`, `scaleLinear`, and `max` utilities compute the bar positions and widths. The SVG bars render across the full window height, sized proportionally to each country’s 2020 population. The code loads the data asynchronously with `d3.csv` and displays a loading message before the chart appears.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.