Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Episode 16 - Loading Data in React

Public visualization

Episode 16 - Loading Data in React

0 stars0🌍 Public
Zzjulijie0618
Last edited Jan 15, 2022
Created on Jan 15, 2022

This example demonstrates loading a CSV dataset in a React application and displaying a summary of its contents. The code uses React hooks (`useState`, `useEffect`) to fetch the data asynchronously with D3’s `csv` function, then renders a formatted message showing the file size in kilobytes, row count, and column count. The data source is a GitHub gist containing CSS named colors, rendered as SVG text in a `<pre>` element. The visualization relies on React 17, D3 v7, and the `d3.csvFormat` API for calculating the data size.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed