Skip to content

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

Merged
janezd merged 1 commit into
biolab:masterfrom
janezd:distributions-fix-offset
Jul 10, 2025
Merged

Distributions: Fix invalid selection and tooltip for some histograms#7113
janezd merged 1 commit into
biolab:masterfrom
janezd:distributions-fix-offset

Conversation

@janezd

@janezd janezd commented Jun 24, 2025

Copy link
Copy Markdown
Contributor
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

@VesnaT
VesnaT self-requested a review July 4, 2025 09:49
@janezd
janezd force-pushed the distributions-fix-offset branch from 5e6271e to 9907bfe Compare July 10, 2025 15:41
@codecov

codecov Bot commented Jul 10, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.77%. Comparing base (2af0b98) to head (9907bfe).
⚠️ Report is 57 commits behind head on master.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@janezd
janezd merged commit c84075b into biolab:master Jul 10, 2025
20 of 30 checks passed
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

2 participants