Skip to content

The interval option for line and area perhaps should round down rather than center #1931

Open
@mbostock

Description

@mbostock

Say you have an activity table that has active users by date and login. You might want to draw stacked dots, and then draw a line between active users. But if you use the interval option, you might be surprised that the line is shifted to the right to the middle of the day (noon) rather than the start of the day (midnight).

It’s the difference between this

Plot.lineY(activity, Plot.stackY({x: "date", interval: "day", z: "login"}))

and this

Plot.lineY(activity, Plot.binX({x: "x1", y: "first", filter: null}, Plot.stackY({x: "date", interval: "day", z: "login"})))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions