Skip to main content
Public

Share visualization

Loading preview…

Rendering Data with React & D3

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Rendering Data with React & D3

0
GGregS1290
Last edited Oct 27, 2021
Created on Oct 25, 2021

This example visualizes the 148 named CSS colors as a donut chart, with each slice filled by its corresponding RGB hex value. Using React state to manage data loading, it fetches a CSV via `d3.csv` and renders an SVG through `ReactDOM`. The pie layout is computed with `d3.pie`, while each segment’s path is generated by `d3.arc`, producing a colorful circular spectrum that maps each color name to its visual representation.

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.

Comments

Sign in to join the discussion.

MIT Licensed