Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

dv2020-ep16-viz17 - Loading Data into React

Public visualization

dv2020-ep16-viz17 - Loading Data into React

0 stars1🌍 Public
Zzach b.
Last edited Mar 14, 2023
Created on Mar 12, 2023

This example demonstrates how to load and parse a CSV dataset within a React application, displaying basic statistics about the data as text. It uses D3’s `csv` function to fetch the file from a GitHub gist and React’s `useState` and `useEffect` hooks to manage the asynchronous data loading and trigger a re-render once the data arrives. The `message` function formats the output using `d3.csvFormat`, showing the file size in kilobytes, the number of rows, and the number of columns, while initially displaying a "loading..." placeholder.

AI-generated description

Uses D3 and React to load, parse, and present data stats.

Episode 16

Comments

Sign in to join the discussion.

MIT Licensed