Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix range defaults to take into account minallowed and maxallowed values #6796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revise default values when maxallowed-minallowed<1
  • Loading branch information
archmoj committed Nov 24, 2023
commit aadbd545563cf16e8e786c90e5a97fa12cef91b7
16 changes: 14 additions & 2 deletions 16 src/plots/cartesian/set_convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,20 @@ module.exports = function setConvert(ax, fullLayout) {
if(maxallowed !== undefined && rng[1] > bounds[1]) range[axrev ? 0 : 1] = maxallowed;

if(range[0] === range[1]) {
if(minallowed !== undefined) range[axrev ? 1 : 0] = ax.l2r(minallowed + 1);
if(maxallowed !== undefined) range[axrev ? 0 : 1] = ax.l2r(maxallowed - 1);
var minL = ax.l2r(minallowed);
var maxL = ax.l2r(maxallowed);

if(minallowed !== undefined) {
var _max = minL + 1;
if(maxallowed !== undefined) _max = Math.min(_max, maxL);
range[axrev ? 1 : 0] = _max;
}

if(maxallowed !== undefined) {
var _min = maxL + 1;
if(minallowed !== undefined) _min = Math.max(_min, minL);
range[axrev ? 0 : 1] = _min;
}
}
};

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.