Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

d3 & react: loading data

Public visualization

d3 & react: loading data

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed