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)

308a2d258aac40f9ba796d74967baa42

Loading Data with React & D3

0 stars1🌍 Public
GGonzalo Alarcón Usui
Last edited Dec 2, 2021
Created on Dec 2, 2021
Forked from Mouse Follower

This example demonstrates how to load and summarize external CSV data within a React application using D3. The interface displays a text summary of the dataset, including file size in kilobytes, row count, and column count, which updates once the data finishes loading. The code uses React hooks (`useState`, `useEffect`) to manage asynchronous state, fetches data via D3’s `csv` function from a GitHub gist containing CSS named colors, and formats the output with `d3.csvFormat`. A loading message appears while the request is pending, and the result is rendered inside a `<pre>` element.

AI-generated description

A program that follows your mouse with a circle.