Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering data with React

Public visualization

Viewing a saved revision (read-only)

1e4441d4bc7149b586915eac757e0310

Rendering data with React

0 stars1🌍 Public
Kkragovic
Last edited Mar 30, 2021
Created on Mar 30, 2021

This example displays a vertical stack of colored horizontal bars, one for each named CSS color, loaded from a CSV file. Using React with hooks like `useState` and `useEffect`, the app asynchronously fetches the data via `d3.csv` and renders each row as a div with a background color set from the `RGB hex value` column. While the data is loading, a “Loading...” message appears, and the final visualization fills the viewport with sequential color swatches.

AI-generated description

A program that loads in some data using D3 utilities, and uses React state to keep track of the data.