Skip to main content
100%

Loading and Parsing CSV Data

✓ Published0🌍 Public
JJohn Patrick Banas
Last edited Sep 10, 2021
Created on Sep 9, 2021
Forked from HTML Starter

This example demonstrates how to load and parse a CSV file using D3 v5, displaying the file size, row count, and column count in large text. It uses `d3.csv` to fetch and parse the dataset asynchronously via a promise, then formats a summary message with `d3.csvFormat` to calculate kilobyte size. The data source is a GitHub-hosted CSV containing CSS named colors. An alternate approach using the Fetch API with `async` and `await`, plus `d3.csvParse`, is included as commented-out code for comparison.

AI-generated description
MIT Licensed

Similar vizzes