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)

a7b9f01a32cf4f37a34a7e75c6b534f2

Loading and Parsing CSV Data

0 stars0🌍 Public
JJunyanL
Last edited Jan 8, 2020
Created on Jan 8, 2020

This example demonstrates how to load and parse CSV data using D3.js, displaying the file size, row count, and column count of the dataset. It uses `d3.csv` to fetch and parse the local `beijing.csv` file, which contains air quality measurements. The parsed data is then processed with `d3.csvFormat` to calculate the size, while `data.length` and `data.columns.length` provide the row and column counts. The result is displayed as large text in a `<pre>` element, highlighting the simplicity of D3’s data-loading API. An alternative approach using `fetch` and `d3.csvParse` is also included as commented code.

AI-generated description

A program that loads and parses some CSV data: CSS Named Colors.