Skip to content

Commit

Permalink
Mirror changes from #878 and small typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rreusser committed Aug 25, 2016
1 parent d6bbb74 commit 5a4d005
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/plots/cartesian/transition_axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
var d3 = require('d3');

var Plotly = require('../../plotly');
var Registry = require('../../registry');
var Lib = require('../../lib');
var Axes = require('./axes');
var axisRegex = /((x|y)([2-9]|[1-9][0-9]+)?)axis$/;
Expand Down Expand Up @@ -113,20 +114,23 @@ module.exports = function transitionAxes(gd, newLayout, transitionConfig, makeOn
Axes.doTicks(gd, activeAxIds[i], true);
}

function redrawObjs(objArray, module) {
var obji;
function redrawObjs(objArray, method) {
for(i = 0; i < objArray.length; i++) {
obji = objArray[i];
var obji = objArray[i];

if((activeAxIds.indexOf(obji.xref) !== -1) ||
(activeAxIds.indexOf(obji.yref) !== -1)) {
module.drawOne(gd, i);
method(gd, i);
}
}
}

redrawObjs(fullLayout.annotations || [], Plotly.Annotations);
redrawObjs(fullLayout.shapes || [], Plotly.Shapes);
redrawObjs(fullLayout.images || [], Plotly.Images);
// annotations and shapes 'draw' method is slow,
// use the finer-grained 'drawOne' method instead

redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));
redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));
redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw'));
}

function unsetSubplotTransform(subplot) {
Expand Down

0 comments on commit 5a4d005

Please sign in to comment.