Skip to main content
100%

Fork of Rendering Data w/ React

✓ Published0🌍 Public
PpyDimi
Last edited Mar 3, 2021
Created on Mar 3, 2021

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 description

A program that loads in some data about CSS Named Colors using D3 Utilities, and uses React state to keep track of the data

MIT Licensed

Similar vizzes