🌍 Public
Rendering Data into React Program and D3 PieArc II
DDavid
Last edited Mar 25, 2021
Created on Mar 25, 2021
Forked from Rendering Data into React Program and D3 II
This example renders CSS named colors from a CSV file as a pie chart using React and D3. The `pie` layout and `arc` generator create a donut chart with an inner radius of 120, while React’s `useState` and `useEffect` load the data asynchronously via `d3.csv`. Each color’s hexadecimal value fills its corresponding SVG path. The visualization demonstrates combining React’s component model with D3’s data-joining utilities for declarative SVG rendering.
AI-generated descriptionA program that loads in some data about CSS named colors using d3 utilities, and uses React to render the data.
MIT Licensed
Comments
Sign in to join the discussion.