Skip to content

Defaults for bin counts #363

@yurivish

Description

@yurivish

Filing this issue at Mike's suggestion in the d3 slack. I ran into some surprising behavior using Plot.binX without specifying any arguments (https://observablehq.com/d/cf5ba27c74172e3e) and Mike suggested adding a default to handle this case.

Right now this produces the expected plot:

Plot.rectY(data, Plot.binX({ y: 'count' })).plot()

While this produces an unexpected (not empty, but also not correct) plot:

Plot.rectY(data, Plot.binX()).plot()

One question would be what channels to default to count – in this case I wanted the y channel, but I'm not sure if that's always the right default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions