Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering data with React using D3 pie

Public visualization

Rendering data with React using D3 pie

0 stars1🌍 Public
Mmaxthamt
Last edited Mar 12, 2021
Created on Mar 12, 2021

A React component loads CSS named colors from a CSV file using `d3.csv` in a `useEffect` hook, storing the result in state. Once loaded, it renders an SVG pie chart by passing the data through `d3.pie` and drawing each slice with `d3.arc`, filling paths with the hex value from each row. The visualization shows all color categories as equal-size wedges, with the `d3.arc` generator set to an outer radius matching the chart width, producing a full-circle display.

AI-generated description

A program that uses React to render some data about CSS named colors using D3 utilities and uses React state to keep track of the data.

Comments

Sign in to join the discussion.

MIT Licensed