Public
Edited
Apr 16, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
uploadedCsv = d3.csvParse(await FileAttachment('earth_moon_2020.csv').text(), d => {
return {
date: new Date(d.date),
value: +d.diff_km
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
q9 = d3.quantile(uploadedCsv.map(d => d.value),0.9);
Insert cell
d3 = require("d3@6")
Insert cell
Insert cell
hosts = Array.from(new Set(onlineCsv[0].map(d => d.entity)))
Insert cell
Insert cell
inlineCsv.slice(0,-1) // gets all elements in array except the last one
Insert cell
Insert cell
function getFlagEmoji(countryCode) {
// data has the country code on char 2-4
const codePoints = countryCode.substring(2,4)
.toUpperCase()
.split('')
.map(char => 127397 + char.charCodeAt());
return String.fromCodePoint(...codePoints);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html`<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono&display=swap" rel="stylesheet">`
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