File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,39 @@ const breakingChangeWarning = [
1919 'Country names in existing plots may not work in the new version.'
2020] . join ( ' ' ) ;
2121
22- module . exports = overrideAll (
22+ function restoreColorbarEditTypes ( attrs ) {
23+ function restoreEditTypes ( obj ) {
24+ for ( var key in obj ) {
25+ var val = obj [ key ] ;
26+ if ( val && typeof val === 'object' ) {
27+ if ( val . editType === 'calc' ) {
28+ val . editType = 'colorbars' ;
29+ }
30+ if ( ! val . valType ) {
31+ restoreEditTypes ( val ) ;
32+ }
33+ if ( Array . isArray ( val . items ) ) {
34+ for ( var i = 0 ; i < val . items . length ; i ++ ) {
35+ if ( val . items [ i ] && typeof val . items [ i ] === 'object' ) {
36+ if ( val . items [ i ] . editType === 'calc' ) {
37+ val . items [ i ] . editType = 'colorbars' ;
38+ }
39+ if ( ! val . items [ i ] . valType ) {
40+ restoreEditTypes ( val . items [ i ] ) ;
41+ }
42+ }
43+ }
44+ }
45+ }
46+ }
47+ }
48+ if ( attrs && attrs . marker && attrs . marker . colorbar ) {
49+ restoreEditTypes ( attrs . marker . colorbar ) ;
50+ }
51+ return attrs ;
52+ }
53+
54+ module . exports = restoreColorbarEditTypes ( overrideAll (
2355 {
2456 lon : {
2557 valType : 'data_array' ,
@@ -175,4 +207,4 @@ module.exports = overrideAll(
175207 } ,
176208 'calc' ,
177209 'nested'
178- ) ;
210+ ) ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,39 @@ var mapLayoutAtributes = require('../../plots/map/layout_attributes');
1515var lineAttrs = scatterGeoAttrs . line ;
1616var markerAttrs = scatterGeoAttrs . marker ;
1717
18- module . exports = overrideAll (
18+ function restoreColorbarEditTypes ( attrs ) {
19+ function restoreEditTypes ( obj ) {
20+ for ( var key in obj ) {
21+ var val = obj [ key ] ;
22+ if ( val && typeof val === 'object' ) {
23+ if ( val . editType === 'calc' ) {
24+ val . editType = 'colorbars' ;
25+ }
26+ if ( ! val . valType ) {
27+ restoreEditTypes ( val ) ;
28+ }
29+ if ( Array . isArray ( val . items ) ) {
30+ for ( var i = 0 ; i < val . items . length ; i ++ ) {
31+ if ( val . items [ i ] && typeof val . items [ i ] === 'object' ) {
32+ if ( val . items [ i ] . editType === 'calc' ) {
33+ val . items [ i ] . editType = 'colorbars' ;
34+ }
35+ if ( ! val . items [ i ] . valType ) {
36+ restoreEditTypes ( val . items [ i ] ) ;
37+ }
38+ }
39+ }
40+ }
41+ }
42+ }
43+ }
44+ if ( attrs && attrs . marker && attrs . marker . colorbar ) {
45+ restoreEditTypes ( attrs . marker . colorbar ) ;
46+ }
47+ return attrs ;
48+ }
49+
50+ module . exports = restoreColorbarEditTypes ( overrideAll (
1951 {
2052 lon : scatterGeoAttrs . lon ,
2153 lat : scatterGeoAttrs . lat ,
@@ -177,4 +209,4 @@ module.exports = overrideAll(
177209 } ,
178210 'calc' ,
179211 'nested'
180- ) ;
212+ ) ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,39 @@ var mapboxLayoutAtributes = require('../../plots/mapbox/layout_attributes');
1515var lineAttrs = scatterGeoAttrs . line ;
1616var markerAttrs = scatterGeoAttrs . marker ;
1717
18- module . exports = overrideAll (
18+ function restoreColorbarEditTypes ( attrs ) {
19+ function restoreEditTypes ( obj ) {
20+ for ( var key in obj ) {
21+ var val = obj [ key ] ;
22+ if ( val && typeof val === 'object' ) {
23+ if ( val . editType === 'calc' ) {
24+ val . editType = 'colorbars' ;
25+ }
26+ if ( ! val . valType ) {
27+ restoreEditTypes ( val ) ;
28+ }
29+ if ( Array . isArray ( val . items ) ) {
30+ for ( var i = 0 ; i < val . items . length ; i ++ ) {
31+ if ( val . items [ i ] && typeof val . items [ i ] === 'object' ) {
32+ if ( val . items [ i ] . editType === 'calc' ) {
33+ val . items [ i ] . editType = 'colorbars' ;
34+ }
35+ if ( ! val . items [ i ] . valType ) {
36+ restoreEditTypes ( val . items [ i ] ) ;
37+ }
38+ }
39+ }
40+ }
41+ }
42+ }
43+ }
44+ if ( attrs && attrs . marker && attrs . marker . colorbar ) {
45+ restoreEditTypes ( attrs . marker . colorbar ) ;
46+ }
47+ return attrs ;
48+ }
49+
50+ module . exports = restoreColorbarEditTypes ( overrideAll (
1951 {
2052 lon : scatterGeoAttrs . lon ,
2153 lat : scatterGeoAttrs . lat ,
@@ -177,4 +209,4 @@ module.exports = overrideAll(
177209 } ,
178210 'calc' ,
179211 'nested'
180- ) ;
212+ ) ) ;
You can’t perform that action at this time.
0 commit comments