Conversation
The match group defaults kept the hasRange flag across groups. After one group with a set range, every later group without a range got autorange false, and its axes fell back to the default [-1, 4] range. A 2x2 grid with shared x and y axes and a set x range shows the problem. Reset the flag for each group. Read the range from the axis that supplied the value, because the loop variable holds the last axis of the group, which can differ from the axis with the range. Fixes plotly#8053
Contributor
|
Thanks for the PR! Our team will take a look and follow up. |
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.
Fix axis defaults so that a set range in one match group no longer turns off autorange in other match groups.
Fixes #8053
In
constraints.js, thehasRangeflag was initialized once for all match groups. After one group with an explicit range, each later group without a range gotautorange: false, and its axes fell back to[-1, 4]. A 2x2 grid with shared x and y axes and a set x range shows the problem. The fix resets the flag for each group. The fix also reads the range from the axis that supplied the value. Before, the check readaxIn, which holds the last axis of the loop and can be a different axis. The existing test "should match set axis range value for matching axes" relied on the stale flag for the{x3, y3}group, and it passes with the corrected check.Tests: new case in
axes_test.js. Theaxes,cartesian, andplot_apisuites pass locally, except for 2axestests (tickson ... rotate labels,insiderange react to new data) that also fail onmainon my machine.