Skip to main content
100%

load data with d3 and update with react

✓ Published0🌍 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.

MIT Licensed

Similar vizzes