Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Load Data with React & D3 Template

Public visualization

Viewing a saved revision (read-only)

e1f455a95377476d9e79d9f5b6f835e4

Load Data with React & D3 Template

0 stars0🌍 Public
AAndres de la Garza
Last edited Feb 28, 2021
Created on Feb 28, 2021

This example demonstrates a minimal template for loading a CSV dataset with D3 and displaying summary statistics about the loaded data. It fetches a remote CSV file from a GitHub gist using `d3.csv()` and, upon successful resolution, logs the data’s size in kilobytes, row count, and column count to the browser console. The page also contains a large empty `pre` element, though the code to populate it with the same statistics is commented out. The example highlights the asynchronous data-loading pattern in D3 v6 with a React-ready structure, with the actual data stored in React state via a commented-out `setData` call.

AI-generated description

Load Data with D3 and Prepare with React State to keep track of data.