Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Loading and Parsing COVID Hospitalizations Data

Public visualization

Fork of Loading and Parsing COVID Hospitalizations Data

0 stars0🌍 Public
FFrancisco Contreras
Last edited Oct 9, 2022
Created on Oct 9, 2022

This example demonstrates how to load and parse a CSV dataset containing global COVID-19 hospitalization data from a GitHub gist, summing the latest column of case counts to display a single total in a large text element. It uses the D3.js v5 `d3.csv` method to fetch and parse the data asynchronously via a Promise, then applies a `reduce` operation to calculate the global case total. The code also includes commented-out alternatives using the Fetch API with `async`/`await` and `d3.csvParse`, along with a reference to the data columns.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed