Skip to content

Commit 3d5bfcd

Browse files
committed
Still update layout objects if there's no transitioned axis
1 parent 3b85f7f commit 3d5bfcd

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/plots/cartesian/transition_axes.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,23 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
100100
var updatedAxisIds = Object.keys(updates);
101101
var affectedSubplots = computeAffectedSubplots(fullLayout, updatedAxisIds, updates);
102102

103+
function updateLayoutObjs () {
104+
function redrawObjs(objArray, method) {
105+
var i;
106+
for(i = 0; i < objArray.length; i++) {
107+
var obji = objArray[i];
108+
109+
method(gd, i);
110+
}
111+
}
112+
113+
redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));
114+
redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));
115+
redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw'));
116+
}
117+
103118
if(!affectedSubplots.length) {
119+
updateLayoutObjs();
104120
return false;
105121
}
106122

@@ -196,7 +212,6 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
196212

197213
ticksAndAnnotations(subplot.xaxis, subplot.yaxis);
198214

199-
200215
var xa2 = subplot.xaxis;
201216
var ya2 = subplot.yaxis;
202217

0 commit comments

Comments
 (0)