Skip to main content
100%

Loading data with react & d3

✓ Published1🌍 Public
Eekorre1001
Last edited Mar 23, 2021
Created on Mar 20, 2021

This example demonstrates how to load external CSV data with React and d3, displaying a summary message about the dataset. It uses React’s `useState` and `useEffect` hooks to fetch the CSS colors data from a GitHub gist and store it in component state. The `d3.csv` function retrieves the file, while the custom `message` function calculates and formats statistics like file size, row count, and column count. The result is rendered as plain text in a `<pre>` element, with a “Loading...” placeholder shown until the data arrives.

AI-generated description

Load in some Data using D3 and uses React state to keep track of the data about CSS colors.

MIT Licensed

Similar vizzes