Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Axes with React & D3

Public visualization

Viewing a saved revision (read-only)

069040913f3c4d3d9552eb6e3462c243

Fork of Axes with React & D3

0 stars0🌍 Public
Jjamesbrittan
Last edited Apr 19, 2021
Created on Apr 19, 2021

This example displays the top 10 most populous countries as a horizontal bar chart with axes, using React state and hooks alongside D3 for data loading and scales. The `d3.csv` function fetches UN population data from 2019, while `d3.scaleBand` and `d3.scaleLinear` position bars and ticks. SVG rendering is managed by React, with D3’s `max` computing the domain. The code manually draws axis tick marks and labels, creating the grid lines shown in red.

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.