Skip to main content
100%

Loading and Parsing CSV Data

✓ Published0🌍 Public
FFulvio Vigilante
Last edited Jul 14, 2021
Created on Jul 14, 2021
Forked from HTML Starter

This example demonstrates the loading and parsing of CSV data using D3.js, displaying the file size, row count, and column count of the parsed dataset on a web page. The code fetches a CSV file containing CSS named colors from a GitHub Gist URL using `d3.csv`, which returns a promise with the parsed data array. It then calculates the formatted string length with `d3.csvFormat`, accesses the `data.length` and `data.columns` properties, and injects the resulting message into a `<pre>` element via `document.getElementById`. The page includes commented-out alternatives using the Fetch API, `async/await`, and `d3.csvParse` for comparison.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes