File tree 4 files changed +15
-17
lines changed
4 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -54,18 +54,18 @@ plots.hasSimpleAPICommandBindings = commandModule.hasSimpleAPICommandBindings;
54
54
plots . redrawText = function ( gd ) {
55
55
gd = Lib . getGraphDiv ( gd ) ;
56
56
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
+
57
61
// do not work if polar is present
58
- if ( ( gd . data && gd . data [ 0 ] && gd . data [ 0 ] . r ) ) return ;
62
+ if ( hasLegacyPolar ) return ;
59
63
60
64
return new Promise ( function ( resolve ) {
61
65
setTimeout ( function ( ) {
62
66
Registry . getComponentMethod ( 'annotations' , 'draw' ) ( gd ) ;
63
67
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 ) ;
69
69
resolve ( plots . previousPromises ( gd ) ) ;
70
70
} , 300 ) ;
71
71
} ) ;
Original file line number Diff line number Diff line change 6
6
* LICENSE file in the root directory of this source tree.
7
7
*/
8
8
9
-
10
9
'use strict' ;
11
10
11
+ var Registry = require ( '../registry' ) ;
12
+
12
13
exports . getDelay = function ( fullLayout ) {
13
14
if ( ! fullLayout . _has ) return 0 ;
14
15
@@ -20,16 +21,13 @@ exports.getDelay = function(fullLayout) {
20
21
} ;
21
22
22
23
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
-
30
24
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
+ }
34
32
} ;
35
33
} ;
You can’t perform that action at this time.
0 commit comments