Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading Data with React & D3

Public visualization

Viewing a saved revision (read-only)

34cd63f6944f49fca8389adb3bac661a

Fork of Loading Data with React & D3

0 stars0🌍 Public
Vvitsenklavitsen
Last edited Mar 6, 2021
Created on Mar 6, 2021

This example loads CSS named color data from a CSV file using D3’s `csv` utility and manages the asynchronous result with React’s `useState` and `useEffect` hooks. While the data is pending, a "Loading..." message appears. Once loaded, it renders an SVG donut chart where each slice represents one color, filled with its own RGB hex value and positioned using D3’s `pie` and `arc` generators. The visualization directly maps the dataset’s categorical entries to equal-sized arcs, effectively showcasing the full palette.

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.