Skip to content

An implicit group transform for z-less areas? #1770

Open
@mbostock

Description

@mbostock

The areaY mark gets an implicit stack transform that works well when there’s a z channel:

untitled (44)

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:

untitled (45)

Plot.areaY(industries, {x: "date", y: "unemployed"}).plot()

This is a little more visible when drawing a line:

untitled (46)

Plot.lineY(industries, {x: "date", y: "unemployed"}).plot()

If you want to draw a single shape, you need the group transform:

untitled (47)

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions