🌍 Public
Viewing a saved revision (read-only)
71d5a536cca84924a0b648ac61c9143b
d3 & react: loading data
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 descriptionA program that loads in some data using D3 utilities and uses React state to keep track of the data.