Published
Edited
Mar 20, 2022
Insert cell
Insert cell
data = FileAttachment("fwd@4.json").json()
Insert cell
since2021 = data
.filter(fwd => fwd.t)
.map(fwd => ({...fwd, date: new Date(fwd.t * 1000)}))
.filter((fwd) => fwd.date.getFullYear() >= 2021)
Insert cell
Plot.plot({
y: {
grid: true,
nice: true
},
x: {
nice: true
},
color: {
legend: true
},
marks: [
Plot.rectY(since2021, Plot.binX({ y: "count" }, { x: "date", fill: "s" })),
Plot.ruleY([0])
],
color: {
scheme: "viridis",
nice: true,
legend: true
}
})
Insert cell
{
return Plot.plot({
y: {
grid: true,
nice: true
},
x: {
nice: true
},
color: {
legend: true
},
marks: [
Plot.rectY(since2021, Plot.binX({ y: "count" }, { x: "d", fill: "a" })),
Plot.ruleY([0])
],
color: {
scheme: "turbo",
nice: true,
legend: true
}
});
}
Insert cell
Insert cell
Plot.plot({
y: {
grid: true,
nice: true
},
x: {
nice: true
},
color: {
legend: true
},
marks: [
Plot.rectY(since2021, Plot.binX({ y: "count" }, { x: "date", fill: "d" })),
Plot.ruleY([0])
],
color: {
scheme: "inferno",
nice: true,
legend: true
}
})
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