Plot.plot({
width,
x: {
interval: "hour"
},
y: {
label: "Wait time (m)",
transform: (d) => d / 60,
domain: [0, 15]
},
color: {
scheme: "ylgnbu"
},
marks: [
Plot.lineY(
tripdata,
Plot.windowY(
{ k: 60 * 8, reduce: "p50", interval: "minute" },
{
strict: true,
curve: "catmull-rom",
x: "request_datetime",
y: "wait_time_seconds",
interval: "minute",
stroke: "black"
}
)
),
Plot.lineY(
tripdata,
Plot.windowY(
{ k: 60 * 8, reduce: "p90", interval: "minute" },
{
strict: true,
curve: "catmull-rom",
x: "request_datetime",
y: "wait_time_seconds",
interval: "minute",
stroke: "purple"
}
)
),
Plot.lineY(
tripdata,
Plot.windowY(
{ k: 60 * 8, reduce: "p95", interval: "minute" },
{
strict: true,
curve: "catmull-rom",
x: "request_datetime",
y: "wait_time_seconds",
interval: "minute",
stroke: "blue"
}
)
),
Plot.rect(
tripdata,
Plot.bin(
{ fill: "count" },
{
x: "request_datetime",
y: { thresholds: 3000, value: "wait_time_seconds" }
}
)
)
]
})