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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more