Skip to main content
100%

Loading Data with React and D3

✓ Published1🌍 Public
VValentine Solonechnyi
Last edited Jul 23, 2020
Created on Jul 23, 2020

This example demonstrates how React and D3 can work together to load and summarize external data. The app uses D3’s `csv` function to fetch a named CSS colors dataset from a GitHub gist, storing the result in React state via the `useState` and `useEffect` hooks. While the data loads, the interface displays the word “Loading”; once received, a preformatted text block reports the dataset’s column names and its approximate size in kilobytes, calculated with `d3.csvFormat` and `Math.round`. The rendering relies on React DOM, with D3 handling only the asynchronous data request.

AI-generated description

A program that loads data with some D3 utilities and then uses React <State> on that Data.

MIT Licensed

Similar vizzes