Skip to main content
100%

Fork of Axes with React & D3

✓ Published0🌍 Public
MMehdi Neysi
Last edited May 29, 2021
Created on May 29, 2021

This example shows a horizontal bar chart ranking the top 10 countries by 2020 population, using data from a CSV file on UN population statistics. The chart renders as SVG, with axes drawn manually: x-axis ticks and gridlines are generated from `xScale.ticks()`, while y-axis labels are placed using a `scaleBand`. The code integrates React hooks (`useState`, `useEffect`) with D3 v5 functions (`csv`, `scaleLinear`, `scaleBand`, `max`) to load data asynchronously and compute scales, then uses React to map data to `<rect>` and `<text>` elements.

AI-generated description
MIT Licensed

Similar vizzes