Distributions: Fix invalid selection and tooltip for some histograms - #7113
Merged
Conversation
VesnaT
self-requested a review
July 4, 2025 09:49
VesnaT
approved these changes
Jul 4, 2025
janezd
force-pushed
the
distributions-fix-offset
branch
from
July 10, 2025 15:41
5e6271e to
9907bfe
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7113 +/- ##
=======================================
Coverage 88.76% 88.77%
=======================================
Files 334 334
Lines 73659 73665 +6
=======================================
+ Hits 65386 65393 +7
+ Misses 8273 8272 -1 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_barmethod, and I also addedis_first_bar(however trivial it is) to make call arguments easier to understand.Includes