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)

e21fea7ab57a495fab2dac9a387227e9

Fork of Loading and Parsing CSV Data

0 stars0🌍 Public
JJason Summercamp
Last edited Jun 14, 2022
Created on Jun 14, 2022

This example demonstrates the basic mechanics of loading and parsing CSV data in a web browser, displaying the file size, row count, and column count of the CSS Named Colors dataset from a GitHub gist. The primary implementation uses D3 v5’s `d3.csv` method with a promise chain, while commented-out alternatives show the same task using `fetch` with `async`/`await` and `d3.csvParse`, plus a nested promise “pyramid of doom” pattern. The rendered output is plain text in a large `<pre>` element, with a React-based counterpart provided in `index.js` using the `useEffect` hook to load data asynchronously.

AI-generated description