Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading Data in React

Public visualization

Loading Data in React

0 stars0🌍 Public
RRiccardo De Lucia
Last edited Aug 26, 2021
Created on Aug 26, 2021

This example demonstrates how to load and summarize CSS named colors data within a React application. It displays a text summary showing the data’s size in kilobytes, row count, and column count, prefixed by a loading message until the data arrives. The code uses React hooks (useState, useEffect) to manage state, and D3’s csv function to asynchronously fetch a remote CSV file. The message formatting relies on d3.csvFormat to calculate the data 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.

Comments

Sign in to join the discussion.

MIT Licensed