Public
Edited
Nov 4, 2022
Insert cell
Insert cell
CovidData.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
coviddata
Insert cell
oldestDate = {
let oldDate = new Date();
let newDate = new Date();
newDate.setFullYear(0);
coviddata.forEach(item => {
const itemDate = new Date(item.Date);
oldDate = oldDate.getTime() > itemDate.getTime() ? itemDate : oldDate;
});

coviddata.forEach(item => {
const itemDate = new Date(item.Date);
newDate = newDate.getTime() < itemDate.getTime() ? itemDate : newDate;
});

return [oldDate, newDate];
}
Insert cell
oldestDate1 = {
let oldDate = new Date();
coviddata.forEach(item => {
const itemDate = new Date(item.Date);
oldDate = oldDate.getTime() > itemDate.getTime() ? itemDate : oldDate;
});

return oldDate;
}
Insert cell
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(coviddata, {x: "cases", y: "deaths", fill: "Date"}),
]
})
Insert cell
Plot.plot({
marks: [
Plot.rectY(coviddata, Plot.binX({ y: "sum" }, { x: "date", y: "value" })),
Plot.frame({ stroke: "#d3d3d3" })
],
height: 50000,
width: 4000000,
marginLeft: 50,
marginRight: 1000,
marginTop: 50,
marginBottom: 50,
insetTop: 0,
insetBottom: 0,
insetLeft: 0,
insetRight: 0
})
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