🌍 Public
Viewing a saved revision (read-only)
308a2d258aac40f9ba796d74967baa42
Loading Data with React & D3
This example demonstrates how to load and summarize external CSV data within a React application using D3. The interface displays a text summary of the dataset, including file size in kilobytes, row count, and column count, which updates once the data finishes loading. The code uses React hooks (`useState`, `useEffect`) to manage asynchronous state, fetches data via D3’s `csv` function from a GitHub gist containing CSS named colors, and formats the output with `d3.csvFormat`. A loading message appears while the request is pending, and the result is rendered inside a `<pre>` element.
AI-generated descriptionA program that follows your mouse with a circle.