🌍 Public
Viewing a saved revision (read-only)
21415daeac4f40b4a147d5d3c788e666
Loading data with React and D3
This example demonstrates loading a dataset of CSS named colors via `d3.csv`, then displaying its file size, row count, and column count. The app uses React’s `useState` and `useEffect` hooks to asynchronously fetch the CSV and update the UI, rendering the summary as a large `<pre>` element. It combines React’s state management with D3’s `csvFormat` utility to calculate file size directly from the fetched data.
AI-generated descriptionA program that loads in some data about CSS named colours using d3 utilities, and uses React state to keep track of the data.