Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading data with D3 and React

Public visualization

Loading data with D3 and React

0 stars0🌍 Public
Ttatpiras
Last edited Sep 15, 2021
Created on Sep 14, 2021
Forked from React Starter

This example demonstrates how to combine React with D3 to load and display external data. The application uses React's `useState` and `useEffect` hooks to manage the data-loading state and trigger the data fetch. It calls D3’s `csv` function to retrieve a CSV file containing CSS named colors from a remote GitHub gist. While the data is being fetched, the interface shows a "loading" message; once the data arrives, it switches to "loaded". The page is rendered into the DOM using ReactDOM’s `render` method, with D3 and React loaded via CDN in the HTML file.

AI-generated description

React Starter code.

Comments

Sign in to join the discussion.

MIT Licensed