Skip to main content
100%

Loading Data with React & D3

✓ Published1🌍 Public
Ccaineosborne
Last edited Jan 11, 2022
Created on Jan 11, 2022
Forked from Mouse Follower

This example demonstrates how to load and display metadata about a CSV dataset using React and D3. It shows the number of columns, rows, and file size in kilobytes after fetching a colors dataset from a GitHub gist via the `csv` method from `d3`. The React `useState` hook tracks the data, initially `null`, while `useEffect` triggers the asynchronous load. The `message` utility, using `d3.csvFormat`, calculates the size, and the view renders either the statistics or a "Loading..." placeholder.

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