🌍 Public
Viewing a saved revision (read-only)
c8c158bbad064762a2f350915c7b7a31
Rendering Data With React
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 descriptionExample of rendering data using React