Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Dataviz-02-loadingDataInReact

Public visualization

Viewing a saved revision (read-only)

98e2797d7ef64e36b104abfcbd913e43

Dataviz-02-loadingDataInReact

0 stars0🌍 Public
GGokul
Last edited Jul 7, 2023
Created on Jul 7, 2023

This example demonstrates how to load and display a summary of CSS named colors data using React state management and D3 utilities. The application fetches a CSV file from a GitHub gist using D3’s `csv` function, storing the parsed result in React’s `useState` hook via `useEffect`. While loading, it displays a simple "Loading..." message. Once data arrives, the view shows the file size in kilobytes, row count, and column count, formatted with `d3.csvFormat` and rendered as text in a `<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.