Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of Loading Data with React & D3

Public visualization

Fork of Fork of Loading Data with React & D3

0 stars0🌍 Public
KKonJoDot
Last edited Oct 21, 2022
Created on Oct 21, 2022

This example displays a loading screen followed by a vertical stack of colored horizontal bars, one for each CSS named color. The page initially shows a large “Loading...” message, then renders the dataset by mapping each color’s RGB hex value to a thin div’s background. The code uses React’s `useState` and `useEffect` to asynchronously fetch the CSS named colors CSV via D3’s `csv` utility, then maps the resulting array to styled divs with a fixed width of 960 pixels and height of 4 pixels each.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed