Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading Data with React & D3

Public visualization

Viewing a saved revision (read-only)

48f0fab8e9de45e49765502807a51f0d

Fork of Loading Data with React & D3

0 stars0🌍 Public
HHowardHan99
Last edited Oct 16, 2021
Created on Oct 16, 2021

This example demonstrates how React and D3 can work together to load and summarize a dataset of CSS named colors. The application uses D3’s `csv` utility to fetch the remote data and React’s `useState` and `useEffect` hooks to manage the asynchronous loading state. Once the data arrives, a custom `message` function computes and displays the file size in kilobytes, the number of rows, and the number of columns using `d3.csvFormat` and array properties. A large monospaced `pre` element renders the result, with “Loading...” shown before the fetch completes.

AI-generated description

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