Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading Data with React & D3

Public visualization

Viewing a saved revision (read-only)

c5f5b5ef91f047aabf9d92cde5e51372

Fork of Loading Data with React & D3

0 stars0🌍 Public
JJusung
Last edited Dec 28, 2021
Created on Dec 28, 2021

This example demonstrates a minimal React application that loads a dataset of CSS named colors from a remote CSV file and displays its key statistics. The code uses React hooks, specifically `useState` and `useEffect`, to manage asynchronous data loading, while the `csv` function from D3 v5 fetches and parses the file. After loading, a text summary shows the file size in kilobytes, row count, and column count, using `d3.csvFormat` to compute the byte length. During the fetch, a simple "Loading..." placeholder is rendered, highlighting the interplay between React state and D3's data utilities.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.