🌍 Public
Viewing a saved revision (read-only)
729fc8f295ff4fefae578afe343d738a
Fork of Fork of Loading Data with React & D3
This example displays the CSS named colors as a full-circle pie chart, with each color represented by a single slice. The visualization uses React hooks (`useState`, `useEffect`) to load the CSV data asynchronously via `d3.csv`, then renders SVG paths generated with `d3.pie` and `d3.arc`. The chart centers on a 960×500 SVG canvas, and each slice’s fill directly uses the RGB hex value from the data. While the code includes a loading message, the final chart demonstrates how D3’s layout functions integrate with React’s declarative rendering model.
AI-generated description