Skip to main content
100%

Loading Data with React & D3

✓ Published1🌍 Public
Kkeitheade
Last edited Nov 4, 2021
Created on Nov 4, 2021
Forked from React Starter

This example demonstrates a data-loading workflow where D3’s `csv` function fetches a dataset of CSS named colors and their hex values from a GitHub gist. The React app uses `useState` and `useEffect` to manage the asynchronous data fetch, displaying a “Loading...” message until the data arrives. Once loaded, each row renders as a thin horizontal rectangle with its background color set to the corresponding `RGB hex value` field. The visualization uses React’s `map` method to create stacked color swatches, showing a flat, ordered list of all colors in the CSV.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes