🌍 Public
Loading Data with React & D3
This example demonstrates how to load and display a summary of CSS named colors data using React and D3. It fetches a CSV file from a GitHub gist via D3’s `csv` utility, then stores the parsed dataset in React state with the `useState` and `useEffect` hooks. While the data loads, the interface shows a “Loading…” message. Once available, the component renders a plain-text summary—computed with `d3.csvFormat`—reporting the dataset’s size in kilobytes, row count, and column count, all displayed in a large monospace `<pre>` element.
AI-generated descriptionA program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.
MIT Licensed
Comments
Sign in to join the discussion.