🌍 Public
Fork of Loading Data with React & D3
This example demonstrates how React manages asynchronous data loading for a D3 visualization. It fetches a CSV file of CSS named colors using the `csv` utility from D3 v5, then displays summary statistics about the dataset—size in kilobytes, row count, and column count—in a simple text format. The React `useState` hook tracks the loaded data, while `useEffect` triggers the D3 fetch operation once on component mount. The `message` helper formats the statistics using `d3.csvFormat` to calculate byte length.
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.