🌍 Public
Viewing a saved revision (read-only)
81dc2bff718d4d0f99c8f2ccdddd2d90
Loading Data with React & D3
This example demonstrates how to load and summarize a CSV dataset using React and D3. It fetches CSS named colors data from a GitHub gist and displays a text summary showing the file size in kilobytes, row count, and column count. The code uses React hooks (useState, useEffect, useCallback) to manage state and trigger the data loading, while D3's csv function handles parsing. The result renders as an SVG-compatible pre element that updates from a loading message to the formatted data statistics once the fetch completes.
AI-generated descriptionA program that follows your mouse with a circle.