🌍 Public
Viewing a saved revision (read-only)
f6c20ce74f9b408ab95cf157f3397754
Summarising Coronavirus CSV Data
This example fetches the John Hopkins Coronavirus time-series CSV and displays a single summary message: the total global deaths and the latest date column, formatted with commas. It uses D3 v5’s `d3.csv` to parse the remote data, then maps over rows to sum the final column’s values with a reduce operation. The result is rendered as large red text in a `<pre>` element, updating the DOM via `document.getElementById`. The code also comments alternative approaches using `fetch`, `async/await`, and `d3.csvParse`.
AI-generated description