Plot.plot({
grid: true,
width: width,
marks: [
Plot.line(dfSeattleWeather,
Plot.windowY({x: "date", y: "temp_max", k: kValue, stroke: "salmon"})),
Plot.line(dfSeattleWeather,
Plot.windowY({x: "date", y: "temp_min", k: kValue, stroke: "steelblue"})),
Plot.areaY(dfSeattleWeather,
Plot.windowY({x: "date", y1: "temp_min", y2: "temp_max", k: kValue, fillOpacity: 0.2, fill: "lightgray", curve: "step"})),
Plot.line(dfSeattleWeather,
Plot.windowY({x: "date",
y: d => {
return (d["temp_max"] + d["temp_min"]) / 2
},
k: kValue}))
]
})