Skip to main content
100%

Loading Data with React & D3

✓ Published1🌍 Public
KK3zter
Last edited Dec 16, 2021
Created on Dec 16, 2021
Forked from Mouse Follower

This example demonstrates how to load external CSV data in a React component using D3, displaying the dataset’s size, row count, and column count as formatted text. The code uses React hooks (`useState`, `useEffect`) to fetch the data via `d3.csv` from a GitHub gist URL, storing the parsed result in state. Once loaded, the `message` function formats the summary using `csvFormat`, showing the file size in kilobytes, the number of rows (entries), and the number of columns from the parsed data’s `.columns` property. Before data arrives, the UI shows a “Loading...” placeholder, set against a full-screen preformatted text layout.

AI-generated description

Loads in some data using D3 and uses react state to track the data

MIT Licensed

Similar vizzes