Skip to content

Axis animation with subplots leaks to other axis #4153

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

Closed
EmanueI opened this issue Aug 28, 2019 · 1 comment · Fixed by #4167
Closed

Axis animation with subplots leaks to other axis #4153

EmanueI opened this issue Aug 28, 2019 · 1 comment · Fixed by #4167
Assignees
Labels
bug something broken

Comments

@EmanueI
Copy link

EmanueI commented Aug 28, 2019

Every button here should only animate a single axis:
https://jsfiddle.net/9onwtvgu/

But clicking the first button also animates the second and third axis and clicking the second button also animates the third axis.

The problem seems to be that editX and editY are not initialised to null here:

plotly.js/src/plots/plots.js

Lines 2424 to 2436 in fbbcd20

var editX;
if(xr0 && xr1 && (xr0[0] !== xr1[0] || xr0[1] !== xr1[1])) {
editX = {xr0: xr0, xr1: xr1};
}
var editY;
if(yr0 && yr1 && (yr0[0] !== yr1[0] || yr0[1] !== yr1[1])) {
editY = {yr0: yr0, yr1: yr1};
}
if(editX || editY) {
axEdits.push(Lib.extendFlat({plotinfo: plotinfo}, editX, editY));
}

The same problem might be found here as well (but not related to animations, I assume):

plotly.js/src/plots/plots.js

Lines 2521 to 2533 in fbbcd20

var editX;
if(xr0[0] !== xr1[0] || xr0[1] !== xr1[1]) {
editX = {xr0: xr0, xr1: xr1};
}
var editY;
if(yr0[0] !== yr1[0] || yr0[1] !== yr1[1]) {
editY = {yr0: yr0, yr1: yr1};
}
if(editX || editY) {
axEdits.push(Lib.extendFlat({plotinfo: plotinfo}, editX, editY));
}

@etpinard
Copy link
Contributor

Thanks for reporting!

@etpinard etpinard added the bug something broken label Aug 29, 2019
@etpinard etpinard self-assigned this Sep 5, 2019
etpinard added a commit that referenced this issue Sep 5, 2019
- this commits fixes both the `Plotly.animate` and
  the `Plotly.react` case.
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 a pull request may close this issue.

2 participants