Skip to main content
100%

Loading & parsing CSV data

✓ Published0🌍 Public
Ccharles-duron
Last edited Nov 6, 2022
Created on Nov 1, 2022
Forked from HTML Starter

This example demonstrates how D3 loads and parses external CSV data by fetching a remote file and displaying a summary of its contents. The code uses `d3.csv()` to retrieve the dataset from a GitHub gist URL, then calculates and presents the file size in kilobytes, the number of rows, and the number of columns directly on the page. The resulting message is rendered inside an HTML `<pre>` element via the `textContent` property, with `d3.csvFormat()` used to measure the data’s string length for the size calculation. The example also defines an unused `fetchText` helper with the Fetch API.

AI-generated description

Program loading and parsing CSV data

MIT Licensed

Similar vizzes