🌍 Public
Viewing a saved revision (read-only)
010ee92be53d401da0d0b9d1b839df3c
Loading data with react and D3
This example demonstrates how to load external CSV data using D3 utilities within a React application. It fetches a dataset of CSS named colors from a GitHub gist and displays summary statistics about the data, including file size in kilobytes, row count, and column count. The React `useState` and `useEffect` hooks manage the asynchronous data loading, while `d3.csv` and `d3.csvFormat` handle parsing and formatting. The result is rendered as SVG text showing either a loading message or the computed data metrics.
AI-generated descriptionA prog that load in some data using D3 utilities, and uses React state to keep track of the data.