Rendering data with react
This example renders the CSS named color palette as a vertical sequence of 960-pixel-wide, 4-pixel-tall color swatches, one per row. It shows how D3’s `csv` loader fetches the dataset from a GitHub gist, while React’s `useEffect` and `useState` manage the asynchronous data loading and render each row as a styled `<div>` in an SVG-capable layout. The code uses React 16.9, ReactDOM, and D3 6.6, with the raw CSV parsed for each color’s `RGB hex value` to set the background color. A simple loading state displays until the data arrives.