-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 reverse autorange on cartesian axes with breaks #4639
Conversation
- ensure account for lBreaks sign - improve and simplify l2p and p2l functions on axis with breaks - reduce extra logic to handle y-axis
|
||
if(ax._breaks.length) { | ||
for(i = 0; i < ax._breaks.length; i++) { | ||
brk = ax._breaks[i]; | ||
ax._lBreaks += (brk.max - brk.min); | ||
ax._lBreaks += brk.max - brk.min; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small recommendation: I think it would be best to keep ax._lBreaks
positive-definite. So many below this loop we could have
ax._lBreaks = Math.abs(ax._lBreaks)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that at one point. However, allowing negative helped handling reversed cases much easier. For now I added a comment in front of _lBreaks
description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I added a comment in front of
_lBreaks
description.
That's great!
💃 - thanks very much @archmoj long live plotly.js! |
A follow up of remaining work #4614 related to
autorange: 'reversed'
cases on axes withbreaks
as well as some simplification for
l2p
&p2l
functions.@plotly/plotly_js