🌍 Public
Viewing a saved revision (read-only)
a1c7e4fa2d284fd0aa1bcc7034427e5a
dv2020-ep16-viz17 - Loading Data into React
This example demonstrates how to load and parse a CSV dataset within a React application, displaying basic statistics about the data as text. It uses D3’s `csv` function to fetch the file from a GitHub gist and React’s `useState` and `useEffect` hooks to manage the asynchronous data loading and trigger a re-render once the data arrives. The `message` function formats the output using `d3.csvFormat`, showing the file size in kilobytes, the number of rows, and the number of columns, while initially displaying a "loading..." placeholder.
AI-generated descriptionUses D3 and React to load, parse, and present data stats.