Skip to main content
100%

Fetching CSV

✓ Published0🌍 Public
Aalvinthai
Last edited Jun 22, 2016
Created on Jun 22, 2016

This example shows how to load and parse three CSV files in parallel, then displays the sum of their `number` fields in a large heading. It uses the Fetch API and Promises to request the files, and d3-dsv’s `d3_dsv.csvParse` to convert each response text into an array of objects. After all three fetches complete via `Promise.all`, the code reads the first row’s `number` value from each parsed dataset, adds them together, and updates the page’s result span. The data sources are three local CSV files, each containing a single numeric value.

AI-generated description

This example demonstrates using the Fetch API and Promises, in conjunction with d3-dsv, to load a few CSV files in parallel. Compare this to using d3-queue, which also allows configurable concurrency.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/44466fb0ff73bd630172020fc66df1dc'>Fetching CSV</a>

gpl-3.0 Licensed

Similar vizzes