Skip to main content
100%

Loading data with react and d3

✓ Published0🌍 Public
Ppianojoel
Last edited Oct 8, 2021
Created on Oct 8, 2021

This example demonstrates loading a remote CSV dataset into a React application using D3’s `csv` method within a `useEffect` hook, then displaying summary statistics—file size in kilobytes, column count, and row count—as large text. The code initializes a state variable with `useState`, asynchronously fetches the data from a GitHub gist, and renders a loading message until the data arrives. It uses React 16.13.1, D3 v6, and defines a reusable `message` function that formats the data summary with `d3.csvFormat`.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes