Skip to main content
Public

Share visualization

Loading preview…

Loading Data with React and D3

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Loading Data with React and D3

1
Sstephanie0215
Last edited Sep 28, 2022
Created on Sep 28, 2022
Forked from Mouse Follower

This example demonstrates how to load external data in a React application using D3 utilities, displaying dataset metrics such as file size, row count, and column count once the data arrives. The code uses React’s `useState` and `useEffect` hooks to manage the asynchronous loading of a CSV file from a GitHub gist via `d3.csv`, storing the parsed result in component state. While loading, a simple "Loading..." message appears, and after fetching, the `message` function formats the data summary into a large `<pre>` element. React 16.9 and D3 v7 are the primary libraries, with SVG reserved but not actively used for rendering.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed