Skip to content

Commit c532ca2

Browse files
committed
Still update layout objects if there's no transitioned axis
1 parent 700c088 commit c532ca2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/plots/cartesian/transition_axes.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,21 @@ 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+
method(gd, i);
108+
}
109+
}
110+
111+
redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));
112+
redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));
113+
redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw'));
114+
}
115+
103116
if(!affectedSubplots.length) {
117+
updateLayoutObjs();
104118
return false;
105119
}
106120

@@ -202,7 +216,6 @@ module.exports = function transitionAxes(gd, newLayout, transitionOpts, makeOnCo
202216

203217
ticksAndAnnotations(subplot.xaxis, subplot.yaxis);
204218

205-
206219
var xa2 = subplot.xaxis;
207220
var ya2 = subplot.yaxis;
208221

0 commit comments

Comments
 (0)