Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering data with React

Public visualization

Viewing a saved revision (read-only)

9a995c06908c405d9189103a056d06dc

Rendering data with React

0 stars1🌍 Public
Kkatebacon32
Last edited Apr 1, 2021
Created on Apr 1, 2021

This example renders the CSS named colors dataset as a vertical stack of colored horizontal stripes. It loads the data from a CSV file using D3's `csv` utility, stores it in React state with `useState`, and renders each row as a `<div>` element whose background color is set to the `'RGB hex value'`. The visualization demonstrates how React can manage asynchronous data loading and map data to SVG or HTML elements, using ReactDOM to mount the app.

AI-generated description

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