Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Loading and Parsing CSV Data

Public visualization

Viewing a saved revision (read-only)

f016370b9ae94c8ba8960e52a0aba822

Loading and Parsing CSV Data

0 stars0🌍 Public
Ssofia-martinovich
Last edited Mar 17, 2021
Created on Mar 7, 2021

This example demonstrates loading and parsing CSV data by displaying summary statistics about the parsed dataset. It shows the file size in kilobytes, the number of rows, and the number of columns for a CSV of slum population data loaded from a GitHub gist. The code uses `d3.csv` with a Promise-based `.then()` callback to fetch and parse the remote CSV file. Alternatively, commented-out code shows the same process using the Fetch API with `async`/`await` and `d3.csvParse`, highlighting two approaches to asynchronous data loading in D3 v5 and React.

AI-generated description