Open
Description
The areaY mark gets an implicit stack transform that works well when there’s a z channel:
Plot.areaY(industries, {x: "date", y: "unemployed", z: "industry"}).plot()
But when there isn’t a z channel, stacking doesn’t really help, because you’re still drawing a single shape for the entire dataset, resulting in zigzags:
Plot.areaY(industries, {x: "date", y: "unemployed"}).plot()
This is a little more visible when drawing a line:
Plot.lineY(industries, {x: "date", y: "unemployed"}).plot()
If you want to draw a single shape, you need the group transform:
Plot.areaY(industries, Plot.groupX({y: "sum"}, {x: "date", y: "unemployed"})).plot()
Maybe areaX and areaY could apply a group transform by default (using groupY and groupX respectively) when no fill, stroke, or z channel is present?