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)

5af4780a429745289c1fa238344ba6b4

Loading and Parsing CSV Data

0 stars0🌍 Public
JJames Rhodes
Last edited Apr 11, 2022
Created on Feb 6, 2022

This example demonstrates how to load and parse CSV data, displaying the dataset’s row count, column count, and file size in a large text block. It uses the `d3.csv` method to fetch a remote CSS named colors dataset and `d3.csvFormat` to calculate its size in kilobytes. The code also includes commented-out alternatives using the Fetch API with `async`/`await` and `d3.csvParse`. D3 v7 loads the data asynchronously via promises, with results rendered into a `<pre>` element.

AI-generated description