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)

7ed2d61da9a245fda0c93b59802fd63d

Loading and Parsing CSV Data

0 stars0🌍 Public
NNelson M
Last edited Nov 17, 2023
Created on Nov 17, 2023

This example demonstrates how to load and parse CSV data from a remote source, displaying the file size, row count, and column count of the CSS Named Colors dataset. The code uses `d3.csv` to fetch and parse the data asynchronously, then computes metrics using `d3.csvFormat` and the resulting data array’s properties. An alternative approach with the Fetch API, `async/await`, and `d3.csvParse` is also included in commented-out form. The parsed information is rendered into a large `<pre>` element, highlighting the simplicity of D3’s data-loading utilities.

AI-generated description