Skip to main content
100%

Visualize Data React + D3

✓ Published1🌍 Public
Yyjhouma
Last edited Feb 7, 2022
Created on Feb 4, 2022

Using React 17 with hooks and D3 v6, this example loads CSS color names and their RGB hex values from a GitHub-hosted CSV via D3's `csv` method. The app displays each color as a thin 960-pixel-wide horizontal bar, stacking them vertically to form a complete spectrum. A conditional `useEffect` hook fetches the data asynchronously, and React renders the loading state with a `pre` element until the dataset arrives. The visualization simply maps each CSV row to a colored `div`, showing the full range of named CSS colors in a single view.

AI-generated description

A program to load a data from MDN: CSS Color using D3 and uses React to render said data

MIT Licensed

Similar vizzes