🌍 Public
Viewing a saved revision (read-only)
d74b0df5449f4dcebfa5927a866c9b09
Loading Data With React & D3
This example demonstrates a donut chart visualization of CSS named colors, where each color appears as a slice in a circular layout. It loads data from a CSV file using `d3.csv` within a React component’s `useEffect` hook, then renders the slices as SVG paths using `d3.pie` and `d3.arc`. The chart fills each slice with its corresponding hex color value from the dataset, creating a colorful wheel that showcases all named CSS colors at a glance. The visualization uses React’s state management to handle the asynchronous data loading, showing a "Loading..." message until the data is ready.
AI-generated description