🌍 Public
Viewing a saved revision (read-only)
5ba5ced167ce4f2bb9540c45f5b1ff8a
Pie chart using data loaded with React and D3
HHeidi Stockton
Last edited Apr 22, 2021
Created on Apr 22, 2021
Forked from Loading Data with React and D3 (attempt 2)
This example displays a pie chart where each slice represents a named CSS color from a dataset loaded via `d3.csv`. The chart renders as SVG using React components, with `d3.pie()` computing the arc angles and `d3.arc()` generating the path shapes. React state manages the asynchronous data loading, and each slice’s fill color directly uses the `RGB hex value` from the CSV data.
AI-generated descriptionA program that loads in some data using D3 utilities, and uses React state to keep track of the data.