Skip to main content
100%

Loading Data with React and D3

✓ Published1🌍 Public
Ccoltonjcox92
Last edited Jan 26, 2022
Created on Jan 23, 2022
Forked from Mouse Follower

This example shows how React state manages asynchronous data loading from a CSV file of CSS color names. The app displays a text summary indicating the file size in kilobytes, row count, and column count. Using React’s `useState` and `useEffect` hooks, it calls `d3.csv` to fetch the remote dataset and stores the parsed result in state. While loading, the interface shows “Loading…”; once resolved, it passes the data to a helper function that computes the statistics using `d3.csvFormat`. The visualization renders as plain text within a `<pre>` element.

AI-generated description

A program that [displays a range of CSS colors] (https://gist.github.com/coltonjcox92/a75ff0066168073dd2c4ac2c24cb6e59) using D3 utilities, and uses React state to keep track of the data.

MIT Licensed

Similar vizzes