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)

3ecfc1336a8b4a0090f9a5531552720a

Loading Data with React & D3

0 stars0🌍 Public
Qqtrfx
Last edited Jun 17, 2023
Created on Jun 17, 2023
Forked from Mouse Follower

This example demonstrates how to load a CSV dataset from a remote URL and display summary statistics about it, including file size, row count, and column count. The visualization uses React state to manage the data, with the `useEffect` hook triggering the `d3.csv` utility to fetch the dataset asynchronously. Once loaded, the data is formatted using `d3.csvFormat` to calculate its size in kilobytes. The interface renders the computed statistics in a large monospace `<pre>` element, initially showing “Loading…” until the data arrives. The example pulls the CSS named colors dataset from a GitHub gist.

AI-generated description

A program that loads in some data using D3 utilities, and uses React state to keep track of the data.