Skip to main content
100%

Fork of Axes with React & D3

✓ Published0🌍 Public
SSimón
Last edited Feb 8, 2023
Created on Feb 6, 2023

This example displays the top 10 most populous countries from the United Nations World Population Prospects 2019 dataset as a horizontal bar chart, with axes rendered manually. It uses React hooks (`useState`, `useEffect`) to load and parse CSV data via `d3.csv`, then builds the chart with SVG elements. The x-axis is generated by mapping `d3.scaleLinear` ticks to SVG groups with lines and text, while the y-axis uses `d3.scaleBand` domain values for country labels. Bars are drawn as `rect` elements sized by population, showing the ranking without gridlines or interaction.

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