Skip to main content
100%

Loading Data with D3 and React

✓ Published0🌍 Public
KKenGondor
Last edited May 7, 2021
Created on May 6, 2021

This example shows a bar chart of the top 10 most populous countries for 2020, ranked by population, rendered as SVG in a React component. It demonstrates loading external CSV data with `d3.csv` in a React hook, then mapping that data to `scaleBand` and `scaleLinear` axes. Custom React components `AxisX` and `AxisY` programmatically draw ticks and labels using D3's scale methods, while bars are plain `<rect>` elements sized by the scales. The data originates from a UN population dataset hosted on GitHub.

AI-generated description

Smiley face implementation with React.

MIT Licensed

Similar vizzes