Skip to main content
100%

Loading and Parsing CSV Data

✓ Published23🌍 Public
Wwenleicao
Last edited Aug 30, 2019
Created on Aug 30, 2019

This example demonstrates how to load and parse CSV data using D3.js v5, displaying the file size, row count, and column count of the dataset in a large text format. The code uses `d3.csv()` to fetch and parse a CSV file containing CSS named colors from a GitHub Gist, then formats the summary with `d3.csvFormat()` and `Math.round()` to calculate kilobytes. It also includes commented-out alternatives using the Fetch API with `async`/`await` and `d3.csvParse()` for comparison, showing different approaches to handling asynchronous data loading in modern JavaScript.

AI-generated description

A program that loads and parses some CSV data.

MIT Licensed

Similar vizzes