Skip to main content
100%

Loading Data with React & D3

✓ Published0🌍 Public
LLei Lei
Last edited Jan 30, 2022
Created on Jan 30, 2022
Forked from Mouse Follower

This example demonstrates how to load and summarize external data within a React component using D3 utilities. It fetches a CSV file of CSS named colors via D3’s `csv` method, stores the result in React state with `useState` and `useEffect`, and then displays a simple text summary of the dataset. The message shows the file size in kilobytes, row count, and column count, computed by combining `d3.csvFormat` with basic string operations. The code relies on React 16.9 hooks and D3 v7, with the data sourced from a GitHub gist.

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