File tree Expand file tree Collapse file tree 4 files changed +15
-17
lines changed Expand file tree Collapse file tree 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;
5454plots . 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 } ) ;
Original file line number Diff line number Diff line change 66* LICENSE file in the root directory of this source tree.
77*/
88
9-
109'use strict' ;
1110
11+ var Registry = require ( '../registry' ) ;
12+
1213exports . getDelay = function ( fullLayout ) {
1314 if ( ! fullLayout . _has ) return 0 ;
1415
@@ -20,16 +21,13 @@ exports.getDelay = function(fullLayout) {
2021} ;
2122
2223exports . 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} ;
You can’t perform that action at this time.
0 commit comments