Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of react bar 2

Public visualization

Viewing a saved revision (read-only)

9dcb792c70aa4723883bf186154a7fc1

Fork of react bar 2

0 stars1🌍 Public
MMalcolm Mead
Last edited Jan 18, 2022
Created on Jan 18, 2022
Forked from react pie chart

This example shows a horizontal bar chart ranking the top 10 countries by 2020 population, with bars drawn as SVG rectangles inside a React component. The chart uses `d3.csv` to load UN population data from a gist URL, then transforms it with `scaleBand` for the y-axis and `scaleLinear` for the x-axis. The React app manages the data asynchronously via `useState` and `useEffect`, rendering a loading message until the data arrives. The visualization is a simple one: yellow bars extend from the left, sized proportionally to each country’s population.

AI-generated description

A bare minimum HTML page.