Skip to main content
100%

Fork of Loading and Parsing CSV Data

✓ Published0🌍 Public
MM
Last edited Mar 5, 2024
Created on Mar 4, 2024

This example demonstrates how to load and parse CSV data from a remote URL, displaying the file size, row count, and column count as text. It uses the D3.js v5 `d3.csv` method to fetch and parse the data, then formats the output with `d3.csvFormat` to calculate the kilobyte size. The data comes from a GitHub Gist containing animal information. Alternative commented-out approaches show fetching raw text with `fetch`, `async`/`await`, and `d3.csvParse`, as well as a nested promise pyramid, but the active code relies solely on `d3.csv` with its built-in promise handling. The result is rendered into a large-styled `<pre>` element.

AI-generated description
MIT Licensed

Similar vizzes