Skip to main content
100%

Axis with React and D3

✓ Published1🌍 Public
LLisa Wagner
Last edited Aug 24, 2021
Created on Aug 24, 2021

This example displays a horizontal bar chart comparing the 2020 populations of the top ten countries from a UN dataset, loaded via `d3.csv`. Using React for the user interface and D3's `scaleBand` and `scaleLinear` for axis scaling, the SVG renders tick marks and labels from `xScale.ticks()`. D3's `max` function determines the domain, and React’s `useState` and `useEffect` manage asynchronous data loading, with the bars themselves drawn as `rect` elements.

AI-generated description

A program that loads in some data about CSS named colours using D3 utilities, and uses React to render the data as a radial burst!

MIT Licensed

Similar vizzes