Skip to main content
100%

dv2020-ep16-viz17 - Loading Data into React

✓ Published1🌍 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

MIT Licensed

Similar vizzes