Skip to main content
100%

Loading Data with React & D3

✓ Published1🌍 Public
IIsh Takkar
Last edited Jun 20, 2021
Created on Jun 20, 2021

This example demonstrates loading a CSV dataset of CSS named colors using D3’s `csv` utility and managing the asynchronous state with React’s `useState` and `useEffect` hooks. Once loaded, the data is rendered as a pie chart in SVG, where each slice is colored with the hex value from its corresponding row, using d3’s `pie` and `arc` generators. The chart fills the browser window, centered on the screen, and displays a “Loading…” message until the data arrives.

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.

MIT Licensed

Similar vizzes