Public
Edited
Mar 22, 2023
Insert cell
Insert cell
data = avalanches_322
Insert cell
avalanches_322.forEach(d => {
const date = new Date(d.Date);
if(date.getMonth >= 6){
d["Season"] = `${date.getFullYear()}-${String(date.getFullYear() +1).slice(2,4)}`
}
else{
d["Season"] = `${date.getFullYear() - 1}-${String(date.getFullYear()).slice(2,4)}`
}
d["c"] = 1;
})
Insert cell
data
Insert cell
Plot.plot({
y: {
grid: true
},
color: {
legend: true
},
marks: [
Plot.areaY(season.get("2022-23"), Plot.stackY({ y: "count" }, {x: "Date", fill: "Weak Layer", title: "industry"})),
Plot.ruleY([0])
]
})
Insert cell
avalanches_3-22.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
region = d3.group(avalanches_322, d => d.Region)
Insert cell
slc = region.get("Salt Lake")
Insert cell
season = d3.group(slc, d => d.Season)
Insert cell
d3.rollup(season.get("2022-23"), d => d["Date"])
Insert cell
season.get("2022-23").map(d => d.Date.toLocaleDateString('en-US'))
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