Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Visualizing Data with React & D3

Public visualization

Viewing a saved revision (read-only)

520996a5baf04c408f19efb8ce307c05

Visualizing Data with React & D3

0 stars1🌍 Public
MMGamboa
Last edited May 5, 2021
Created on May 5, 2021

This example displays a pie chart of CSS named colors, loaded from a CSV file. Each slice represents a color, and its fill is the color’s hex value. The code uses D3 v6 utilities `d3.csv` to fetch the data and `d3.pie` along with `d3.arc` to compute the pie geometry. React manages the application state, initially showing a “Loading…” message while the CSV is fetched, then rendering the chart as SVG paths.

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.