🌍 Public
Viewing a saved revision (read-only)
3e3271e66475469c841b95f6568a5baf
loading data with d3 - react
This example demonstrates how to load and summarize CSV data in a React application using D3 v7. It fetches a CSS named colors dataset from a GitHub gist and displays the file size, row count, and column count in large text. The code uses React hooks `useState` and `useEffect` to manage asynchronous data loading via the `d3.csv` function, while a separate `message.js` module formats the summary using `d3.csvFormat` and `data.length`/`data.columns.length`. Output renders as SVG-sized text in a `<pre>` element.
AI-generated description