Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React & D3

Public visualization

Viewing a saved revision (read-only)

90fedd73807a433891a13fbd7baba3b6

Loading Data with React & D3

0 stars1🌍 Public
WWolfgang
Last edited Mar 19, 2021
Created on Mar 19, 2021
Forked from Mouse Follower

This example demonstrates how to load and summarize a CSV dataset within a React application using D3 utilities. It displays the file size in kilobytes, number of rows, and number of columns from the CSS named colors dataset hosted on GitHub. The code uses the `useState`, `useEffect`, and `useCallback` hooks to manage asynchronous data loading, with the `csv` function from D3 fetching the remote data and storing it in React state. The resulting summary is rendered as text within a `<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.