Skip to main content
100%

Fork of Axes with React & D3

✓ Published0🌍 Public
PPratik Raja
Last edited Aug 9, 2024
Created on Aug 9, 2024

This example renders a horizontal bar chart of the top 10 most populous countries using React and D3. The chart displays a bar for each country’s 2020 population from the United Nations World Population Prospects 2019 dataset, retrieved via `d3.csv`. It manually constructs axes without D3’s axis components, using `scaleBand` for the categorical y-axis, `scaleLinear` for the quantitative x-axis, and generating tick lines and text labels from `xScale.ticks()`. The visualization is rendered as SVG with React state management and `useEffect` for data loading.

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