Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading and Parsing CSV Data

Public visualization

Viewing a saved revision (read-only)

8c45b3e02e5b4fb988d520bd95e98dd9

Fork of Loading and Parsing CSV Data

0 stars0🌍 Public
AAnHaiTrinh
Last edited May 2, 2023
Created on May 2, 2023

This example demonstrates how to load and parse CSV data using D3’s `csv` function within a React component. It fetches a dataset of CSS named colors, then displays a summary of the parsed data—including its size in kilobytes, row count, and column count—as plain text. The code uses React’s `useState` and `useEffect` hooks to manage asynchronous data loading, while D3 v5’s `d3.csvFormat` computes the file size. The visualization relies on React for rendering and D3 for data parsing and formatting.

AI-generated description