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)

5df8e9490e484617850ecf0811e26580

Loading and Parsing CSV Data

0 stars1🌍 Public
MMichael Bergerson
Last edited Dec 22, 2020
Created on Dec 22, 2020

This example demonstrates how to load and parse CSV data, displaying a summary of the CSS Named Colors dataset that includes file size, row count, and column count. It uses `d3.csv` to asynchronously fetch the remote CSV file and parse it into a tabular structure, then formats the summary using `d3.csvFormat` and `Math.round`. The visualization appears as large text rendered in an HTML `<pre>` element. The code also includes commented alternatives using `fetch`, `async`, and `await` with `d3.csvParse`.

AI-generated description