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)

ff6601480c76440881106aed54547aa7

Fork of Loading Data with React & D3

0 stars0🌍 Public
SSreekar Reddy
Last edited May 11, 2021
Created on May 11, 2021

This example shows a React component that loads a CSV file of CSS named colors using D3’s `csv` utility, then displays a summary message about the dataset. The data resides in React state via the `useState` hook, with `useEffect` triggering the asynchronous fetch on mount. The rendered output shows file size in kilobytes, row count, and column count, computed using `d3.csvFormat` and array properties. While loading, the component displays the text “Loading...”, and the final message is rendered inside a `<pre>` element styled with a large font size.

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.