Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data with React & D3

Public visualization

Loading Data with React & D3

0 stars0🌍 Public
PPirialMersus
Last edited Jun 28, 2022
Created on Jun 28, 2022

This example demonstrates how to load and display a summary of CSS named colors data using React and D3. It fetches a CSV file from a GitHub gist via D3’s `csv` utility, then stores the parsed dataset in React state with the `useState` and `useEffect` hooks. While the data loads, the interface shows a “Loading…” message. Once available, the component renders a plain-text summary—computed with `d3.csvFormat`—reporting the dataset’s size in kilobytes, row count, and column count, all displayed in a large monospace `<pre>` element.

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.

Comments

Sign in to join the discussion.

MIT Licensed