@@ -2057,23 +2057,23 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfi
2057
2057
}
2058
2058
if ( Lib . isPlainObject ( d ) ) {
2059
2059
var o = { } ;
2060
- var v , src ;
2061
- for ( v in d ) {
2060
+ var src ;
2061
+ Object . keys ( d ) . sort ( ) . forEach ( function ( v ) {
2062
2062
// remove private elements and functions
2063
2063
// _ is for private, [ is a mistake ie [object Object]
2064
- if ( [ '_' , '[' ] . indexOf ( v . charAt ( 0 ) ) !== - 1 ) continue ;
2064
+ if ( [ '_' , '[' ] . indexOf ( v . charAt ( 0 ) ) !== - 1 ) return ;
2065
2065
2066
2066
// if a function, add if necessary then move on
2067
2067
if ( typeof d [ v ] === 'function' ) {
2068
2068
if ( keepFunction ) o [ v ] = '_function' ;
2069
- continue ;
2069
+ return ;
2070
2070
}
2071
2071
2072
2072
// look for src/data matches and remove the appropriate one
2073
2073
if ( mode === 'keepdata' ) {
2074
2074
// keepdata: remove all ...src tags
2075
2075
if ( v . substr ( v . length - 3 ) === 'src' ) {
2076
- continue ;
2076
+ return ;
2077
2077
}
2078
2078
} else if ( mode === 'keepstream' ) {
2079
2079
// keep sourced data if it's being streamed.
@@ -2082,21 +2082,21 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfi
2082
2082
src = d [ v + 'src' ] ;
2083
2083
if ( typeof src === 'string' && src . indexOf ( ':' ) > 0 ) {
2084
2084
if ( ! Lib . isPlainObject ( d . stream ) ) {
2085
- continue ;
2085
+ return ;
2086
2086
}
2087
2087
}
2088
2088
} else if ( mode !== 'keepall' ) {
2089
2089
// keepref: remove sourced data but only
2090
2090
// if the source tag is well-formed
2091
2091
src = d [ v + 'src' ] ;
2092
2092
if ( typeof src === 'string' && src . indexOf ( ':' ) > 0 ) {
2093
- continue ;
2093
+ return ;
2094
2094
}
2095
2095
}
2096
2096
2097
2097
// OK, we're including this... recurse into it
2098
2098
o [ v ] = stripObj ( d [ v ] , keepFunction ) ;
2099
- }
2099
+ } ) ;
2100
2100
return o ;
2101
2101
}
2102
2102
0 commit comments