Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1baa143

Browse filesBrowse files
committed
Mirror changes from #878 and small typo fix
1 parent a801ddd commit 1baa143
Copy full SHA for 1baa143

File tree

Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed

‎src/plots/cartesian/transition_axes.js

Copy file name to clipboardExpand all lines: src/plots/cartesian/transition_axes.js
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
var d3 = require('d3');
1313

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

116-
function redrawObjs(objArray, module) {
117-
var obji;
117+
function redrawObjs(objArray, method) {
118118
for(i = 0; i < objArray.length; i++) {
119-
obji = objArray[i];
119+
var obji = objArray[i];
120+
120121
if((activeAxIds.indexOf(obji.xref) !== -1) ||
121122
(activeAxIds.indexOf(obji.yref) !== -1)) {
122-
module.drawOne(gd, i);
123+
method(gd, i);
123124
}
124125
}
125126
}
126127

127-
redrawObjs(fullLayout.annotations || [], Plotly.Annotations);
128-
redrawObjs(fullLayout.shapes || [], Plotly.Shapes);
129-
redrawObjs(fullLayout.images || [], Plotly.Images);
128+
// annotations and shapes 'draw' method is slow,
129+
// use the finer-grained 'drawOne' method instead
130+
131+
redrawObjs(fullLayout.annotations || [], Registry.getComponentMethod('annotations', 'drawOne'));
132+
redrawObjs(fullLayout.shapes || [], Registry.getComponentMethod('shapes', 'drawOne'));
133+
redrawObjs(fullLayout.images || [], Registry.getComponentMethod('images', 'draw'));
130134
}
131135

132136
function unsetSubplotTransform(subplot) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.