Skip to content

When explicit bin thresholds are specified, but no domain is specified, the last bin is dropped #733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mbostock opened this issue Feb 3, 2022 · 1 comment
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

mbostock commented Feb 3, 2022

E.g., https://observablehq.com/d/748823354c2435e1

untitled-246

Plot.plot({
  x: {
    domain: [0, 24]
  },
  marks: [
    Plot.rectY(
      data,
      Plot.binX(
        { y: "count" },
        {
          x: (d) => d.timestamp.getHours(),
          thresholds: d3.range(1, 24)
        }
      )
    )
  ]
})
@mbostock mbostock added the bug Something isn’t working label Feb 3, 2022
@mbostock
Copy link
Member Author

mbostock commented Feb 3, 2022

It’s not a bug. You have to specify the domain explicitly or there’s no way to know how big the last bin should be.

@mbostock mbostock closed this as completed Feb 3, 2022
This was referenced Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

1 participant