Plot.plot({
marks: [
Plot.ruleY([0, 1]),
Plot.lineY(
aapl,
Plot.mapY("quantile", { x: "Date", y: "Volume", strokeOpacity: 0.2 })
),
Plot.lineY(
aapl,
Plot.map(
{
title: (windowQuantileValues) =>
windowQuantileValues.map(
(wqv) => `The k=30 window quantile value is ${d3.format(".2")(wqv)}`
)
},
Plot.map(
{ y: Plot.window(30), title: Plot.window(30) },
Plot.map(
{ y: "quantile", title: "quantile" },
{ x: "Date", y: "Volume", title: "Volume", tip: true }
)
)
)
)
]
})