Plot.plot({
width,
height: 600,
x: {label: null},
color: {legend: true, label: "Opened"},
marks: [
Plot.areaY(
issues.flatMap((i) =>
d3
.utcDays(i.created_at, i.closed_at ?? new Date("2024-10-18"))
.map((at) => ({created_at: i.created_at, at}))
),
Plot.binX(
{y: "count", filter: null},
{
x: "at",
fill: (d) => d3.utcWeek(d.created_at),
reverse: true,
curve: "step",
tip: {format: {x: null, z: null}},
interval: "day"
}
)
)
]
})