Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React and D3

Public visualization

Viewing a saved revision (read-only)

006d962fb99146b3b187b53fa24d3920

Loading Data with React and D3

0 stars0🌍 Public
MMichael Bergerson
Last edited Dec 23, 2020
Created on Dec 23, 2020
Forked from Mouse Follower

This example demonstrates how to load and display CSV data within a React application using D3 utilities. The app fetches a dataset of CSS named colors from a GitHub gist via the `d3.csv` method, storing the result in React state with the `useState` and `useEffect` hooks. Once loaded, a summary message is rendered as large SVG text, showing the file size in kilobytes, row count, and column count using `d3.csvFormat`. While data is loading, the display simply shows the text “loading,” providing a clear visual state transition.

AI-generated description

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