Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React & D3 (information csv data permis US)

Public visualization

Viewing a saved revision (read-only)

5e7649e751d84f09bdc724e20e4a440b

Loading Data with React & D3 (information csv data permis US)

0 stars1🌍 Public
Ddassermouna
Last edited Jul 23, 2021
Created on Jul 4, 2021

This example demonstrates loading a real-world US permanent visa dataset using D3’s `csv` utility within a React application. The visualization presents a plain-text summary of the raw CSV data, displaying its size in kilobytes, row count, and column count. The code uses React’s `useState` and `useEffect` hooks to manage asynchronous data loading and re-render the page once the data arrives. The dataset is fetched from a remote Gist URL, and the summary is generated using `d3.csvFormat` to measure the data size before calculating the descriptive statistics.

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.