🌍 Public
Viewing a saved revision (read-only)
42917a0e7f1d45908d6322c7816482ec
Fork of Rendering data with react
This example renders a horizontal bar chart of the top 10 countries by 2020 population from a UN dataset. The chart uses Unicode text as a loading message before the data arrives. The implementation employs D3 v5 utilities like `csv`, `scaleBand`, `scaleLinear`, and `max` to load and scale the data, while the React `useState` and `useEffect` hooks manage the asynchronous data fetching and SVG rendering. The code also includes an unused `pieArc` defined with D3's `arc` function.
AI-generated descriptionA program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.