🌍 Public
Fork of Loading Data with React & D3
This example demonstrates the use of React state to manage asynchronous data loading in a D3 visualization. It fetches a CSV file containing CSS named colors from a GitHub gist and displays a summary of the data, including its size in kilobytes, row count, and column count. The code uses React's `useState` and `useEffect` hooks to trigger the load and store the result, while D3's `csv` utility parses the remote data. The rendered output is plain text within a `<pre>` element, constructed by the `message` function, which also employs `d3.csvFormat` to calculate the data's byte size.
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.