Published
Edited
Feb 4, 2022
1 fork
6 stars
Insert cell
Insert cell
Insert cell
// let’s fetch this rather large dataset from the https://covid19.who.int/ home page.
// note: we use fetchp, which acts as a CORS-enabled proxy when developing this notebook
// this cell works only if our notebook is published with a custom URL.
allData = fetchp(
"https://covid19.who.int/page-data/table/page-data.json"
).then((d) => d.json())
Insert cell
// extract this interesting subset about vaccination
data = allData.result.pageContext.rawDataSets.vaccineData.data
Insert cell
// deploy the subset as a csv
deploy("data.csv", async (req, res) => {
res.header("Cache-control", `public, max-age=${1 * 3600}`); // 1 hour cache on the CDN
res.header("Content-Type", "text/plain");
res.send(aq.from(data).toCSV());
})
Insert cell
// deploy the subset as an apache arrow file
deploy("data.arrow", async (req, res) => {
res.header("Cache-control", `public, max-age=${1 * 3600}`); // 1 hour cache on the CDN
res.header("Content-Type", "application/octet-stream");
res.header("Content-Disposition", `attachment; filename="data.arrow"`);
res.send(aq.from(data).toArrowBuffer());
})
Insert cell
Insert cell
Insert cell
import { deploy } from '@endpointservices/serverless-cells'
Insert cell
import { fetchp } from "@tomlarkworthy/fetchp"
Insert cell
aq = require('arquero')
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more