Cap discrete OOB PMF bars with a y-axis break marker - #5122
Draft
lsabor wants to merge 2 commits into
Draft
Conversation
When a discrete question forecast has a below-lower-bound or above-upper-bound mass that far exceeds the tallest in-bounds bar, the entire in-bounds distribution gets visually squashed. Clamp OOB bar heights in the PMF chart at OOB_BAR_DISPLAY_RATIO (=2) times the tallest in-bounds bar and draw a zigzag axis-break marker on top of any clamped bar, with the true PMF value labeled above the break. Fixes #5117 Co-authored-by: Luke Sabor <32885230+lsabor@users.noreply.github.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
The axis-break marker for out-of-bounds discrete PMF bars never rendered: the bar's clamp cap and the Y-axis domain top used different, unrelated multipliers of the in-bounds max, so a clamped bar (and its marker) always extended past the visible plot and got clipped by the SVG viewport. Unifies the axis top and clamp cap into a single value, and reworks the break itself: instead of an overlaid color patch (which either mismatched the real background or clipped off-canvas), the OOB bar's own path is drawn with a real gap — a literal hole punched out with diagonal cut edges, anchored just above the tallest in-bounds bar, so the removed segment truly shows the page background through it. The axis also reserves extra headroom and hides regular tick labels above the break, leaving only the bar's true value annotated there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
Contributor
Author
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 #5117
Summary
For discrete questions, when a below-lower-bound or above-upper-bound PMF bar far exceeds the tallest in-bounds bar, the whole in-bounds distribution gets visually squashed. This PR clamps OOB bars at
OOB_BAR_DISPLAY_RATIO * inbound max(default = 2) and renders a zigzag axis-break marker on top, with the true PMF value labelled above the break.Test plan
Generated with Claude Code