Skip to main content
100%

9.-Loading Data with React and D3

✓ Published0🌍 Public
JJorge MataH
Last edited Oct 14, 2021
Created on Oct 12, 2021

This example demonstrates how to load and summarize a CSV dataset in a React application using D3 utilities. It fetches named CSS color data from a GitHub gist via `d3.csv` and stores the parsed rows in React state with the `useState` and `useEffect` hooks. While the data loads, the app displays a "Loading..." message; once received, it uses the `message` function to report the dataset’s size in kilobytes (via `d3.csvFormat`), row count, and column count in a large monospace `<pre>` element.

AI-generated description

A program that loads in some data using D3 utilities, and uses React state to keep track of the data.

MIT Licensed

Similar vizzes