Skip to main content
100%

Loading data with React and d3

✓ Published1🌍 Public
SSophia Cofone
Last edited May 20, 2022
Created on May 20, 2022
Forked from Mouse Follower

This example demonstrates how to load and summarize external data within a React application using d3 utilities. A small React component uses the `useState` hook to manage data and the `useEffect` hook to trigger a d3 `csv` request, fetching a CSS named colors dataset from a GitHub gist. While the data loads, the app displays a "Loading..." message, then renders a plain-text summary computed by a custom `message` function, which formats the raw CSV via `d3.csvFormat` to report the file size in kilobytes, the total row count, and the number of columns.

AI-generated description

Program that loads in some data using d3 utilities and uses React state to keep track of the data.

MIT Licensed

Similar vizzes