Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Rendering data with react

Public visualization

Viewing a saved revision (read-only)

42917a0e7f1d45908d6322c7816482ec

Fork of Rendering data with react

0 stars0🌍 Public
SSreekar Reddy
Last edited May 15, 2021
Created on May 15, 2021

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 description

A program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.