Skip to main content
Public

Share visualization

Loading preview…

Parsing CSV Data With D3

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

Parsing CSV Data With D3

0 stars0Public
CChris Briggs
Last edited Nov 13, 2021
Created on Nov 13, 2021

This example shows how to parse CSV data with D3, displaying the file size, row count, and column count of a remote dataset fetched from a TinyURL-shortened URL. The code uses `d3.csv` to load and parse the data asynchronously via a Promise, then accesses `data.length` and `data.columns` to summarize the dataset. It also includes commented alternatives using `fetch`, `async/await`, and `d3.csvParse` for manual text parsing, and a nested-callback "pyramid of doom" pattern. The rendered output is plain text inside a styled `<pre>` element.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed