Closed
Description
Currently the rect mark is a bit pedantic regarding band scales — it generally requires that you specify x1, x2, y1, y2 explicitly. So in a situation like this, you see nothing:
Plot.plot({
marks: [
Plot.rectX(data, {x1: "start", x2: "end", y: "name"})
]
})
You have to switch to barX to see what you likely intend:
Plot.plot({
marks: [
Plot.barX(data, {x1: "start", x2: "end", y: "name"})
]
})
A related question is whether we could automatically infer the band scale for y (rather than the default point). That would also be necessary for the rect to appear.
Another possibility, to at least show something that maybe guides someone to a better outcome, would be to apply default negative insets in the case whether the rect would otherwise have zero width or height.
Plot.plot({
marks: [
Plot.rectX(data, {x1: "start", x2: "end", y: "name", inset: -0.5})
]
})