fix(stats): end box plot whiskers at observed inliers - #2033
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Fixes #1731.
When a sample contains outliers,
computeStatscurrently returns the theoretical Tukey fences as box-plot whiskers, even if no observation lies there. For[-100, 1, 2, 3, 4, 5, 6, 7, 8, 9], this produces -5.5 and 14.5 instead of 1 and 9.Use the first and last sorted non-outlier observations for the box-plot endpoints. Reuse the observations already selected for binning; histogram bounds, bin counts, quartiles and outlier classification retain their existing behavior.
Regression coverage includes lower, upper and two-sided outliers, values exactly on the fences, input preservation and unchanged histogram bins. The three outlier cases fail on the base revision and pass with this change. The zero-IQR work in #2024 remains separate.
Validation (Windows, Node 24.15, Yarn 4.10.3):
@visx/statstests passed.findcleanup and the package helper's inline environment assignment do not run in Windows shells; I ran the remaining type checks and Babel steps directly without changing build scripts.Prepared with Codex assistance.