Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading Data with React

Public visualization

Viewing a saved revision (read-only)

5f983e9798824d618b61840718104d67

Fork of Loading Data with React

0 stars1🌍 Public
JJakub
Last edited Dec 10, 2021
Created on Dec 10, 2021

This example demonstrates loading and displaying CSS named colors from a remote CSV file. It shows a vertical stack of colored horizontal bars, one for each color, rendered as HTML divs whose background colors are set using the RGB hex values from the data. The React app uses the `useEffect` hook to fetch the CSV with `d3.csv` and stores the result in state via `setData`, initially showing a "Loading.." message. The code uses React 17, ReactDOM, and d3.v7, with the data sourced from a Gist.

AI-generated description