Skip to main content
100%

Loading and Parsing CSV Data (less verbose)

✓ Published1🌍 Public
AAnthony Ynami
Last edited Feb 18, 2021
Created on Feb 18, 2021

This example shows the size and structure of a CSV file by displaying the number of kilobytes, rows, and columns in a large text element. It loads CSS named colors data from a remote GitHub gist using d3.csv, which returns a promise. The code then formats the parsed data back into a CSV string with d3.csvFormat to measure its byte length, and accesses the parsed array’s length and columns property for row and column counts. It highlights the less verbose promise-based approach over the commented-out fetch and async/await alternative with d3.csvParse.

AI-generated description

A Program that loads and parses some CSV data

MIT Licensed

Similar vizzes