Skip to main content
Public

Share visualization

Loading preview…

Loading Data with React & 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 & D3

0
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.

Comments

Sign in to join the discussion.

MIT Licensed