Skip to main content
100%

Render data with React & D3 (codeAlong)

✓ Published1🌍 Public
Ttomahawk-jupiter
Last edited Jun 4, 2021
Created on Jun 4, 2021

This example uses React state and the `useEffect` hook to load CSS named colors from a CSV file via `d3.csv`, preventing repeated fetches on re-render. Once loaded, React renders the data as a radial burst of pie slices using `d3.pie` and `d3.arc`, with each slice’s fill set to its corresponding `RGB hex value`. The visualization leverages SVG inside a React component, demonstrating a simple integration of D3’s layout and shape utilities for data-driven rendering.

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 that data.

Using useEffect from React stops the data from loading repeatedly with every state change. Without this it will re-load constantly.

Use React to render the data onto the page as a radial burst.

MIT Licensed

Similar vizzes