Skip to main content
Public

Share visualization

Loading preview…

Loading and Parsing CSV Data

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Loading and Parsing CSV Data

23
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.

Comments

Sign in to join the discussion.

MIT Licensed