Skip to content

Commit 5c01f53

Browse files
committed
fixup redrawText
1 parent 46feda1 commit 5c01f53

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

src/plots/plots.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ plots.hasSimpleAPICommandBindings = commandModule.hasSimpleAPICommandBindings;
5454
plots.redrawText = function(gd) {
5555
gd = Lib.getGraphDiv(gd);
5656

57+
var fullLayout = gd._fullLayout || {};
58+
var hasPolar = fullLayout._has && fullLayout._has('polar');
59+
var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;
60+
5761
// do not work if polar is present
58-
if((gd.data && gd.data[0] && gd.data[0].r)) return;
62+
if(hasLegacyPolar) return;
5963

6064
return new Promise(function(resolve) {
6165
setTimeout(function() {
6266
Registry.getComponentMethod('annotations', 'draw')(gd);
6367
Registry.getComponentMethod('legend', 'draw')(gd);
64-
65-
(gd.calcdata || []).forEach(function(d) {
66-
if(d[0] && d[0].t && d[0].t.cb) d[0].t.cb();
67-
});
68-
68+
Registry.getComponentMethod('colorbar', 'draw')(gd);
6969
resolve(plots.previousPromises(gd));
7070
}, 300);
7171
});

src/snapshot/helpers.js

+9-11
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
109
'use strict';
1110

11+
var Registry = require('../registry');
12+
1213
exports.getDelay = function(fullLayout) {
1314
if(!fullLayout._has) return 0;
1415

@@ -20,16 +21,13 @@ exports.getDelay = function(fullLayout) {
2021
};
2122

2223
exports.getRedrawFunc = function(gd) {
23-
var fullLayout = gd._fullLayout || {};
24-
var hasPolar = fullLayout._has && fullLayout._has('polar');
25-
var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;
26-
27-
// do not work for legacy polar
28-
if(hasLegacyPolar) return;
29-
3024
return function() {
31-
(gd.calcdata || []).forEach(function(d) {
32-
if(d[0] && d[0].t && d[0].t.cb) d[0].t.cb();
33-
});
25+
var fullLayout = gd._fullLayout || {};
26+
var hasPolar = fullLayout._has && fullLayout._has('polar');
27+
var hasLegacyPolar = !hasPolar && gd.data && gd.data[0] && gd.data[0].r;
28+
29+
if(!hasLegacyPolar) {
30+
Registry.getComponentMethod('colorbar', 'draw')(gd);
31+
}
3432
};
3533
};
34 Bytes
Loading
Loading

0 commit comments

Comments
 (0)