Skip to content
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

docs: explain why there will be fewer bins than specified in maxbins #6990

Merged
merged 1 commit into from
Oct 25, 2020
Merged

docs: explain why there will be fewer bins than specified in maxbins #6990

merged 1 commit into from
Oct 25, 2020

Conversation

joelostblom
Copy link
Contributor

I find this a bit unclear currently, and also often get asked what determines the actual number of bins. This PR is my understanding of https://observablehq.com/@d3/d3-bin, particularly this section:

Unexpected? The result is not guaranteed to yield the exact number of buckets we asked for. That number is only an indication, passed to the threshold generator. As you change that value with the slider, you might notice the reason why this happens: the domain gets sliced at “nicely-rounded” values — using d3.ticks — and these rounded values do not fall exactly on the bin’s domain.

Also PRed in vega vega/vega#2944


Please:

  • Make the pull requests (PRs) atomic (fix one issue at a time). Multiple relevant issues that must be fixed together? Make atomic commits so we can easily review each issue.
  • Provide a concise title as a semantic commit message (e.g. "fix: correctly handle undefined properties") so we can easily copy it to the release note.
    • Use imperative mood and present tense.
  • Mention relevant issues in the description (e.g., Fixes #1 / Fixes part of #1).
  • Lint and test (Run yarn test).
  • Rebase onto the latest master branch.
  • Review your changes before sending the PR (to ensure code quality).
  • For new features:
    • Add new unit tests.
    • Update the documentation under site/docs/ + add examples.

@domoritz domoritz changed the title Mention why there will be fewer bins than specified in maxbins. docs: explain why there will be fewer bins than specified in maxbins Oct 25, 2020
@domoritz domoritz merged commit 1202029 into vega:master Oct 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants