Skip to main content
100%

Loading Data with d3 & React

✓ Published1🌍 Public
MMrinal Roy
Last edited Mar 18, 2021
Created on Mar 18, 2021
Forked from Mouse Follower

This example demonstrates how to load CSV data asynchronously in a React component using d3.csv, displaying the dataset’s size, column count, and row count in a large <pre> element. The React useState hook manages the fetched data, initially showing a “loading” message until the promise resolves. The code imports ReactDOM and d3’s csv parser directly from CDN links. The data originates from a GitHub gist containing CSS named colors. The output updates responsively once the fetch completes, converting the parsed CSV back to text with d3.csvFormat to calculate its kilobyte size.

AI-generated description

A program that follows your mouse movement

MIT Licensed

Similar vizzes