Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering data with react

Public visualization

Rendering data with react

0 stars1🌍 Public
Nnahsiloh
Last edited Mar 30, 2021
Created on Mar 30, 2021

This example visualizes a dataset of CSS named colors as a color wheel, with each color occupying a segment of a circle. The React component manages the asynchronous loading of the CSV data using the `useState` and `useEffect` hooks, and renders the result as SVG paths. D3’s `csv` utility fetches the data, while the `arc` generator defines the pie-shaped segments, with the fill set to the corresponding hex value from each row.

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