| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
#7717) `ax.limitRange` could silently flip axis orientation while clamping. When no user range is set, `_cleanRange` installs the DFLTRANGEX = [-1, 6] default, and then `limitRange` applies minallowed/maxallowed on top of that default. If minallowed exceeded the default max (or maxallowed fell below the default min), the clamp produced an inverted range (e.g. minallowed=7 yielded [7, 6]). Downstream, `getAutoRange` inferred `axReverse = true` from this state and reversed the final autoranged output - flipping the axis even though the user never asked for it. Instead of flipping, when clamping collapses or inverts the range, extend the opposite end to preserve the original orientation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers: - minallowed > default range max (the original #7717 case) - minallowed = default range max (degenerate clamp boundary) - minallowed well above default range max - autorange:'reversed' + minallowed (must stay reversed) - maxallowed < default range min (symmetric case) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous baselines locked in the #7717 bug: the non-reversed xaxis panels were rendering with axis ticks in descending order (10, 9, 8, 7, 6). With the limitRange orientation fix, those panels now render in the intended ascending order while the xaxis2 panels (explicit autorange:'reversed') remain descending as expected. Regenerated via kaleido in circleci/python:3.8.9 with: python3 test/image/make_baseline.py = allowed-range allowed-range-small Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@bpostlethwaite I'm still in the process of reviewing, but looking at the updated image baselines, I think this change is causing autorange: 'reversed' to be incorrectly ignored. In the allowed-range baseline, xaxis2 (which is the x axis of the lower left plot) is set to autorange: 'reversed' which should mean the axis values are decreasing left-to-right (as they are in the current baseline) but the updated baseline has them swapped. |
Sorry, something went wrong.
There was a problem hiding this comment.
@bpostlethwaite I take back my initial comment -- the lower left plot is xaxis which should not be reversed, so the new mock is correct. Likewise for the second mock, the lower right polar plot should not be reversed, so the new mock is correct.
I don't totally follow the logic and I think there's probably a clearer way to handle setting these bounds, but the existing logic is already a bit convoluted so it's not really any worse. LGTM!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #7717
Root cause
ax.limitRange could silently flip axis orientation while clamping. When no user range is set, _cleanRange installs the DFLTRANGEX = [-1, 6] default, then limitRange applies minallowed/maxallowed on top of it. If minallowed exceeded the default max (or maxallowed fell below the default min), the clamp produced an inverted range (e.g. minallowed=7 → [7, 6]). Downstream, getAutoRange inferred axReverse = true from that state and reversed the final output — flipping the axis even though the user never asked for it.
Fix
When clamping would collapse or invert the range, extend the opposite end instead of flipping, preserving the original orientation. Explicit autorange: 'reversed' still reverses as expected.
Commits