Skip to main content
100%

Loading Data with React and D3

✓ Published0🌍 Public
JJasmine Ye Han
Last edited Jan 2, 2022
Created on Jan 1, 2022
Forked from Mouse Follower

This example demonstrates how to load external data in a React application using D3 utilities, displaying the dataset’s size in kilobytes, row count, and column count as formatted text. The code uses React’s `useState` and `useEffect` hooks to manage the asynchronous loading state, while `d3.csv` fetches the CSS named colors dataset from a GitHub gist. The `d3.csvFormat` function calculates the data size for the message. Rendering is handled through React DOM, producing an SVG-backed text output that transitions from a “Loading…” placeholder to the final statistics.

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