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)

7360e17a869e48c4a01ff2d381bb03e2

Fork of Loading Data with React & D3

0 stars1🌍 Public
TTanupat B.
Last edited Mar 19, 2022
Created on Mar 19, 2022

This example displays CSS named colors as a full-circle pie chart, where each slice is colored with its corresponding hex value. It uses React hooks, specifically `useState` and `useEffect`, to asynchronously load the CSV data with D3’s `csv` function. The chart is rendered as SVG, with D3’s `arc` and `pie` generators computing the slice paths, and each path’s fill set from the `RGB hex value` column in the dataset.

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.