Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of Loading Data with React & D3

Public visualization

Viewing a saved revision (read-only)

588c08fe9ff541a3b49ff4238bc13e55

Fork of Fork of Loading Data with React & D3

0 stars1🌍 Public
Vvram80
Last edited Feb 28, 2021
Created on Feb 28, 2021

This example visualizes CSS named colors as horizontal bars, with each bar’s background color set to the color’s RGB hex value from the dataset. It uses React’s `useState` and `useEffect` hooks to manage asynchronous data loading, and D3’s `csv` utility to fetch the color data from a GitHub gist URL. While the data is loading, the display shows the text “Loading...” in large font. Once loaded, the bars render in a vertical stack, demonstrating how React state updates trigger re-renders with D3-loaded data.

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.