Skip to main content
100%

Fork of Visualize data in React & D3 - use Pie chart

✓ Published1🌍 Public
Ssmile2git
Last edited May 27, 2021
Created on May 27, 2021

This example shows a pie chart of CSS named colors, where each slice represents one color and is filled with its corresponding RGB hex value. The chart is built by combining React for component structure and state management with D3 utilities for data loading and geometry. It uses `d3.csv` to fetch the color data from a GitHub gist, `d3.pie` to compute slice angles, and `d3.arc` to generate SVG path commands. The visualization renders as an SVG, centered on a full-screen canvas, with each slice equally sized because `pie().value(1)` assigns a constant weight.

AI-generated description

Loads data with D3 utilities and uses React to render the data.

MIT Licensed

Similar vizzes