Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading Data with React & D3

Public visualization

Fork of Loading Data with React & D3

0 stars1🌍 Public
Rrstrauss127
Last edited Apr 28, 2022
Created on Apr 28, 2022

This example displays the full set of CSS named colors as a color wheel, with each color occupying a slice of a circular pie chart. The code loads CSV data from a GitHub gist using `d3.csv` within a React component, managing the asynchronous data with `useState` and `useEffect`. It then uses `d3.pie` and `d3.arc` to compute the slice geometries, rendering each slice as an SVG `<path>` filled with its corresponding hex value. The original manual arc calculation is replaced by the D3 pie layout.

AI-generated description

Radial colors!! A program that loads & renders in some [data about CSS named colors] (https://gist.github.com/curran/b236990081a24761f7000567094914e0) using D3 utilities, and uses React state to keep track of the data.

Comments

Sign in to join the discussion.

MIT Licensed