Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React & D3

Public visualization

Viewing a saved revision (read-only)

3389e6c4e6fd4a9097e7223da0c618db

Loading Data with React & D3

0 stars1🌍 Public
KKirsten Lund
Last edited Feb 10, 2021
Created on Feb 8, 2021
Forked from Mouse follow

This example demonstrates how to load and summarize CSS named colors data within a React application using D3 utilities. It displays a text summary showing the dataset size in kilobytes, row count, and column count, with a "Loading..." placeholder before the data arrives. The code uses React’s `useState` and `useEffect` hooks to manage async state, and D3’s `csv` function to fetch the remote CSV file, while `d3.csvFormat` computes the summary metrics.

AI-generated description

Loading data about CSS named colors using D3 utilities - plus React state to keep track of the data.

<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/JMvnd1CIRNo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> -->