Skip to main content
100%

Rendering DATA with React

✓ Published1🌍 Public
Ssinghjy
Last edited Mar 7, 2021
Created on Mar 7, 2021

This example shows the CSS Named Colors dataset rendered as a stacked sequence of 960-pixel-wide horizontal strips, one per color, with each strip’s background fill set directly from its RGB hex value. Using React’s `useState` and `useEffect`, the app fetches the CSV via `d3.csv`, then maps each row to a `<div>` element whose inline style sets the background color. The code relies on React 16.9, ReactDOM, and d3.v6, with no SVG or canvas—only plain HTML `<div>` elements. A loading state displays “Loading..” until the data arrives.

AI-generated description

Uses react to render the data A program that loads in data using d3 utilities and react state to keep track of our data

MIT Licensed

Similar vizzes