Skip to main content
100%

Fork of Loading Data with React & D3

✓ Published0🌍 Public
MMaxim
Last edited Jun 18, 2021
Created on Jun 18, 2021

This example demonstrates how React and D3 can work together to load and summarize data from an external API. The visualization shows the result of fetching a JSON dataset from an Azure-hosted solar financial analysis endpoint, then displaying the file size in kilobytes and the number of top-level keys in the data object. Using React’s `useState` and `useEffect` hooks, the app triggers a D3 `json()` request, stores the response in component state, and conditionally renders a loading message or the computed summary. The code uses ReactDOM for rendering and the `encodeURI` and `JSON.stringify` methods to calculate the data size.

AI-generated description

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

MIT Licensed

Similar vizzes