Skip to main content
100%

Loading data with setData

✓ Published1🌍 Public
NNita
Last edited Jul 18, 2020
Created on Jul 18, 2020
Forked from Loading data w

This example demonstrates how to load external CSV data into a React application using D3’s `d3.csv` method. The App component calls `d3.csv` inside a `useEffect`, stores the result in state with `setData`, and displays either a loading message or a text summary. The summary is generated by the `messageData` function, which uses `d3.csvFormat` to calculate file size in kilobytes and reports the row and column counts from the parsed data. The data source is a gist containing CSS named colors, fetched via a remote URL.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes