Skip to content
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

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

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Nov 23, 2023

Fixes #6765.
@plotly/plotly_js

@archmoj archmoj added bug something broken status: reviewable labels Nov 23, 2023
@@ -447,6 +447,11 @@ module.exports = function setConvert(ax, fullLayout) {

if(minallowed !== undefined && rng[0] < bounds[0]) range[axrev ? 1 : 0] = minallowed;
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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if maxallowed-minallowed<1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.
Addressed in aadbd54

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Something went wrong with axis scaling' error when using minallowed or maxallowed go outside range defaults
2 participants