🌍 Public
Viewing a saved revision (read-only)
9c898492c80b4a618dbafaa831913f98
Loading data with React and D3
A donut chart of CSS named colors loads and renders as a circular spectrum of 148 colored arcs. The example demonstrates asynchronous data loading with React hooks and D3. It uses `useState` and `useEffect` to fetch a CSV file via `d3.csv`, then maps each row to an arc via `d3.pie` and `d3.arc`. Each path is filled with the row’s ’RGB hex value’ and rendered in an SVG. React 17 manages the component lifecycle while D3 v6 handles the data parsing and geometry.
AI-generated descriptionCSS named color data visualisation.