Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

load data with d3 and update with react

Public visualization

Viewing a saved revision (read-only)

7b611b366dd14114b5e9b44aefd5c414

load data with d3 and update with react

0 stars0🌍 Public
Ssabrinamochi
Last edited Mar 11, 2021
Created on Mar 11, 2021
Forked from mouse follower

This example demonstrates a minimal React-based data loading flow, where a Web page displays either "Loading..." or "yay" based on whether asynchronous CSV data has been fetched. The React component uses `useState` to hold the loaded dataset and `useEffect` to call D3’s `csv()` method on a remote URL containing named CSS colors. Once the data arrives, React re-renders the paragraph, proving D3 and React can work together for data acquisition and UI updates. The page uses D3 v6 and React 16.9, with an SVG placeholder for a smiley face.

AI-generated description

Smiley face implementation with React.