Skip to content

Axis animation with subplots leaks to other axis #4153

Closed
@EmanueI

Description

@EmanueI

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));
}

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions