Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React and D3

Public visualization

Loading Data with React and D3

0 stars0🌍 Public
HHeidi Stockton
Last edited Apr 21, 2021
Created on Apr 21, 2021

This example demonstrates how to load external data into a React application using D3 utilities. It fetches a CSV file containing named colors from a GitHub gist via `d3.csv`, then stores the resulting promise data in React state with the `useState` hook. The app renders the raw data object to the screen rather than visualizing it, and the stripped-down SVG markup in `index.html` suggests a possible future plot. It uses React 16.9, D3 v6, and SVG rendering, with dynamic sizing based on `window.innerWidth` and `window.innerHeight`.

AI-generated description

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

Comments

Sign in to join the discussion.

MIT Licensed