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

1
KKirsten Lund
Last edited Feb 10, 2021
Created on Feb 8, 2021
Forked from Mouse follow

This example demonstrates how to load and summarize CSS named colors data within a React application using D3 utilities. It displays a text summary showing the dataset size in kilobytes, row count, and column count, with a "Loading..." placeholder before the data arrives. The code uses React’s `useState` and `useEffect` hooks to manage async state, and D3’s `csv` function to fetch the remote CSV file, while `d3.csvFormat` computes the summary metrics.

AI-generated description

Loading data about CSS named colors using D3 utilities - plus React state to keep track of the data.

<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/JMvnd1CIRNo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -->

Comments

Sign in to join the discussion.

MIT Licensed