Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading data with React and D3

Public visualization

Viewing a saved revision (read-only)

2c6ca9dca5fa4a14a5c857e37ce62eb8

Loading data with React and D3

0 stars2🌍 Public
AAlex Stulov
Last edited Jul 8, 2021
Created on Jul 8, 2021
Forked from Mouse follower

This example demonstrates how to load and display a CSV dataset in a React application, showing a text summary of the data size, row count, and column count once the file is fetched. The code uses React’s `useState` and `useEffect` hooks to manage the asynchronous loading state, while D3’s `d3.csv` fetches the data from a GitHub gist URL and `d3.csvFormat` converts it back to a string to calculate its size in kilobytes. The visualization initially displays “Loading…” and updates to the summary once the data arrives.

AI-generated description

Mouse follower