Closed
Description
as reported by @yurivish in https://observablehq.com/d/3264dbb558b44080, the following chart creates a spurious series, with a color (stroke) that is undefined. I've tweaked Yuri’s example to make the issue more visually salient, and to clarify that it is not the mix of z and fill that creates the problem. Inspecting the channels with mark.initialize reveals that the fill channel is ["A", "A"…, "B", "B", ...], but the stroke channel is full of [undefined, undefined…, "A", …, "B", …].

Plot.plot({
marks: [
Plot.areaY(
[
{
x: 0,
y: 5,
type: "B"
},
{
x: 5,
y: 5,
type: "B"
},
{
x: 5,
y: 5,
type: "A"
},
{
x: 10,
y: 5,
type: "A"
}
],
{
interval: 1,
x: "x",
y: "y",
fill: "type",
stroke: "type",
strokeWidth: 2,
strokeOpacity: 0.7
}
)
],
color: { legend: true }
})