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
CChristian-SWS
Last edited Aug 23, 2023
Created on Aug 22, 2023

This example demonstrates how to load a CSV dataset from a GitHub gist and display a summary message using React state. It uses the `useState` hook to hold the fetched data and `useEffect` with an empty dependency array to call d3.csv once on component mount. The `message` function computes the number of rows, columns, and approximate file size using d3.csvFormat. The result updates a `<pre>` element, showing either loading text or the computed statistics, with React handling the rendering.

AI-generated description

A Programm that uses D3 utilities to load some data and uses React state t okeep track of the data...

Comments

Sign in to join the discussion.

MIT Licensed