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 stars0🌍 Public
AA
Last edited Jul 17, 2021
Created on Jul 17, 2021
Forked from Pathetic Bar Chart

This example visualizes the top 10 most populous countries as a pathetic bar chart, displaying horizontal bars without any axes or labels. Using React with hooks, the code loads UN World Population Prospects 2019 data via `d3.csv`, then renders SVG rectangles scaled with `scaleBand` and `scaleLinear`. The chart computes bar widths from each country’s 2020 population and positions them vertically with `yScale`. React’s `useState` and `useEffect` manage the asynchronous data loading, while `ReactDOM.render` mounts the visualization.

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