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)

c1b3c01f9a2f4c4fa066bfb2811259df

Fork of Loading Data with React & D3

0 stars0🌍 Public
TTina Nemati
Last edited May 29, 2023
Created on May 29, 2023

This example displays a pie chart of CSS named colors, with each slice filled using its corresponding RGB hex value from the loaded dataset. The visualization uses React state and the `useEffect` hook to asynchronously fetch CSV data via `d3.csv`, then renders the chart as SVG paths. The pie layout is generated with `d3.pie()` and sectors are drawn using `d3.arc()`, with all geometry centered within a 960×500 viewport.

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.