Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React and D3

Public visualization

Loading Data with React and D3

0 stars0🌍 Public
Bbingsen0806
Last edited Jun 15, 2021
Created on Jun 15, 2021
Forked from Mouse Follower

This example shows a pie chart of CSS named colors, with each slice filled using the color’s RGB hex value from a CSV dataset loaded via D3’s `csv` utility. React’s `useState` and `useEffect` manage the asynchronous data loading, displaying a “Loading…“ message until the data arrives. The SVG pie chart is generated with D3’s `pie` and `arc` functions, and each segment is rendered as an SVG `path` element with a fill color taken directly from the dataset’s `RGB hex value` column.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed