Skip to content

Distributions: Fix invalid selection and tooltip for some histograms #7113

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Jun 24, 2025

Issue

Fixes #7102.

When all instances in a particular bar had the same value (up to the precision shown in the label), bars were shifted for one-half width to the left for cleaner visualization.

However, the position of the bar was then used to determine the bin thresholds, hence shifting it into the previous bin.

I also strongly suspect that padding between bars also caused some instances to be skipped in other histograms, too.

Description of changes

Although we could "unoffset" the bar, a cleaner solution is to store the actual range into each bar to make it independent of visualization, that may include other offsets and paddings in the future.

Unrelated: I cleaned the code so that is consistently uses _is_last_bar method, and I also added is_first_bar (however trivial it is) to make call arguments easier to understand.

Includes
  • Code changes
  • Tests

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.

Distributions: selection doesn't match output
1 participant