🌍 Public
Viewing a saved revision (read-only)
aef2f955f0874b46bac375d6e69e423d
Loading data with React
This example demonstrates how to load a CSV dataset of CSS named colors using React state and D3’s `csv` utility. The app fetches the data once via `useEffect`, stores it in a `useState` hook, and displays a text summary showing file size in kilobytes, row count, and column count. The rendering relies on React’s `ReactDOM.render` and the `d3.csvFormat` method for calculating the file size, with a loading message shown until the asynchronous data request resolves.
AI-generated descriptionA program that loads in some data about CSS named Colors using some d3 utilities and uses React Sate to keep track of the data