Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React & d3

Public visualization

Viewing a saved revision (read-only)

a5bd62e317ce49d0a4ffa71151e7de1b

Loading Data with React & d3

0 stars0🌍 Public
CChristian-SWS
Last edited Aug 23, 2023
Created on Aug 22, 2023

This example demonstrates how to load a CSV dataset from a GitHub gist and display a summary message using React state. It uses the `useState` hook to hold the fetched data and `useEffect` with an empty dependency array to call d3.csv once on component mount. The `message` function computes the number of rows, columns, and approximate file size using d3.csvFormat. The result updates a `<pre>` element, showing either loading text or the computed statistics, with React handling the rendering.

AI-generated description

A Programm that uses D3 utilities to load some data and uses React state t okeep track of the data...