🌍 Public
Viewing a saved revision (read-only)
828185de6b2c4fd384ae7b1f18e01b3e
Loading data with React & D3
A React application demonstrates how to load and summarize a CSV dataset using D3 utilities. The app fetches CSS named colors from a GitHub gist via `d3.csv()` and manages the asynchronous result with React's `useState` and `useEffect` hooks. On load, it displays a text summary generated by a `message` function, which reports the data's size in kilobytes, row count, and column count using `d3.csvFormat()`. The interface shows a simple loading message until the data arrives, then renders the computed statistics in a large `<pre>` element.
AI-generated descriptionA program that loads in some data using D3 utilities, and uses React state to keep track of the data.