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)

cc8f397c3b8b4aa09a75e2962098ac8e

Loading and Parsing CSV Data

0 stars23🌍 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.