Loading Data with React & D3
This example demonstrates loading a CSV dataset into a React application using D3 utilities, displaying a text summary of the data’s size and structure. It shows how React state manages the asynchronous data-fetching lifecycle, with a loading message shown until the data arrives. The code uses `d3.csv` to fetch the CSS named colors dataset from a GitHub gist, then formats the result with `d3.csvFormat` to compute kilobyte size, row count, and column count. React's `useState` and `useEffect` hooks trigger the fetch and store the parsed data, while the final output renders as SVG text via a `<pre>` element.