🌍 Public
Viewing a saved revision (read-only)
fa25085a06c24e0bbed74c947654d730
Fork of Rendering Data w/ React
This example visualizes CSS named colors as a donut chart, with each color’s name and value displayed as a slice. The code loads color data from a CSV file using `d3.csv`, stores it in React state with `useState` and `useEffect`, and renders the chart as SVG paths. Each slice’s angle is computed from the index of the color in the dataset, and its fill is set to the corresponding hex value using the `arc` and `pie` functions from D3 v6. The chart is centered within a fixed 960×500 viewport.
AI-generated descriptionA program that loads in some data about CSS Named Colors using D3 Utilities, and uses React state to keep track of the data