Skip to main content
100%

Rendering data with React

✓ Published1🌍 Public
LLewis Ward
Last edited Jun 26, 2021
Created on Jun 26, 2021

This example displays a vertical sequence of 4-pixel-tall color bands, each representing a CSS named color from a CSV file, forming a full-width spectrum across the screen. The visualization loads the data from a remote CSV containing color names and their RGB hex values using D3’s `csv` function. React manages the asynchronous data loading through `useState` and `useEffect`, rendering each row as a styled `<div>` with its background color set to the hex value. The page uses React 16.9 and D3 v7, with the `Loading...` placeholder shown until the data arrives.

AI-generated description

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

MIT Licensed

Similar vizzes