Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

loadDataState

Public visualization

Viewing a saved revision (read-only)

8d20b5389fb04987b94a67c2fe21c498

loadDataState

0 stars1🌍 Public
MMatt Lane
Last edited Jul 28, 2022
Created on Jul 27, 2022
Forked from mouse

This example shows how React state manages the lifecycle of data loaded with D3. It displays a summary message (row and column counts) from a CSV file containing CSS named colors. The code uses React hooks (`useState`, `useEffect`) to fetch data asynchronously with `d3.csv` and store it in state. A loading indicator appears until the promise resolves, then the `message` utility formats the dataset’s dimensions for display.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

loading data w/ d3 utils && react state