Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading and Parsing CSV Data

Public visualization

Viewing a saved revision (read-only)

2b06c5b165ab4b42a42c287474ff41e4

Fork of Loading and Parsing CSV Data

0 stars0🌍 Public
RRoman Tolmachev
Last edited Aug 26, 2024
Created on Aug 26, 2024

This example demonstrates how to load and parse a CSV file containing CSS named colors, displaying summary statistics about the dataset in a large text element. The code uses D3 v5’s `d3.csv` method to fetch the remote data asynchronously and then computes the file size in kilobytes, row count, and column count using `d3.csvFormat` and the parsed array’s properties. Alternative approaches using `fetch` with `async`/`await` and `d3.csvParse` are also included as commented-out code, along with a nested-promise “pyramid of doom” example for comparison.

AI-generated description