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)

ab119e8b29dc476e97098c9af31c73ba

Loading and Parsing CSV Data

0 stars1🌍 Public
Mmarouan-ben
Last edited Sep 11, 2023
Created on Sep 11, 2023

This example demonstrates loading and parsing CSV data, displaying a message that reports the file size in kilobytes, the row count, and the column count of the dataset. The code uses D3 v5’s `d3.csv` function to fetch a remote CSV file containing CSS named colors from a GitHub gist, then applies `d3.csvFormat` to compute the size and accesses the parsed data’s length and `columns` property. Comments in the code also illustrate alternative approaches using `fetch`, `async`/`await`, and `d3.csvParse` for manual text handling.

AI-generated description