Skip to main content
100%

d3 & react: loading data

✓ Published1🌍 Public
Wwannurmawaddah
Last edited Sep 29, 2020
Created on Sep 29, 2020

This example demonstrates a minimal React application that loads a CSV dataset of CSS named colors using D3’s `csv` function, then displays a summary message in a large `<pre>` element. The data is fetched from a GitHub gist and stored in React state via the `useState` and `useEffect` hooks. While the data loads, the app shows a “Loading...” placeholder. Once fetched, the `message` function calculates and renders the file size in kilobytes, row count, and column count using `d3.csvFormat` for byte-length estimation.

AI-generated description

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

--
Datavis 2020 #16

MIT Licensed

Similar vizzes