Skip to main content
100%

Loading Data with React & D3

✓ Published1🌍 Public
Bbakstorage00001
Last edited Feb 2, 2022
Created on Feb 2, 2022
Forked from Mouse Follower

This example demonstrates how to combine React hooks with D3 utilities for asynchronous data loading and display. The application fetches a CSV file containing CSS named colors using D3’s `csv` function within a `useEffect` hook, while React’s `useState` manages the loading state—showing “Loading…” until data arrives. Once loaded, it renders a summary message computed in `message.js`, reporting the file size in kilobytes (via `d3.csvFormat`), row count, and column count. The visualization uses React 16.9 and D3 v7, with the fetched data stored in component state and displayed in a styled `<pre>` element.

AI-generated description

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

MIT Licensed

Similar vizzes