Skip to main content
100%

Loading Data with React / Pie Chart

✓ Published1🌍 Public
JjohnmurphyLC
Last edited May 28, 2023
Created on May 28, 2023

This example demonstrates loading data asynchronously in a React application using D3’s `csv` function, which fetches a remote dataset of CSS named colors and their RGB hex values. Once loaded, the data is displayed as a series of horizontal color swatches stacked vertically, with each row’s background color set to its corresponding hex value from the dataset. The app manages loading state with React’s `useState` and `useEffect` hooks, showing a simple “Loading…” message until the data arrives, and renders the final result as a block of SVG-ready DOM elements rather than an actual pie chart.

AI-generated description

A program that loads in some data using D3 utilities, and uses React render the data.

MIT Licensed

Similar vizzes