Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering Data With React

Public visualization

Rendering Data With React

0 stars1🌍 Public
JJames Rhodes
Last edited Feb 13, 2022
Created on Feb 13, 2022

This example shows a horizontal bar of CSS colors, one stripe per color, rendered as a 960-pixel-wide strip of 4-pixel-tall divs. It fetches a CSV of CSS color names and hex values from a GitHub gist using `d3.csv`, then maps each row to a React component. The React app uses `useEffect` and `useState` to load the data asynchronously, displaying a “Loading…” message until the data arrives, and `ReactDOM.render` mounts the component to the DOM.

AI-generated description

Example of rendering data using React

data MDN: CSS Colors

Comments

Sign in to join the discussion.

MIT Licensed