Skip to main content
100%

Fork of Axes with React & D3

✓ Published0🌍 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.

MIT Licensed

Similar vizzes