Skip to main content
100%

Loading data with React & d3

✓ Published0🌍 Public
Jjeffmesie
Last edited Aug 26, 2021
Created on Aug 26, 2021

This example demonstrates how to load and manage data in a React application using d3 utilities, with React state tracking the loaded dataset. The visualization renders an empty SVG container (960 by 500 pixels) that will display the data once fetched, using `useState` and `useCallback` hooks to handle asynchronous data loading. The code imports React and ReactDOM directly via UMD bundles from unpkg, along with the React 16.9.0 production build, and uses d3’s data-loading functions to populate the state with the dataset. The app component returns a placeholder for the visualization, with the data variable ready to be passed to d3 for rendering.

AI-generated description

A program that loads in data using d3 utilities and uses React 'state' to keep track of the data

MIT Licensed

Similar vizzes