@@ -139,7 +139,7 @@ plots.sendDataToCloud = function(gd) {
139139 name : 'data'
140140 } ) ;
141141
142- hiddenformInput . node ( ) . value = plots . graphJson ( gd , false , 'keepdata' ) ;
142+ hiddenformInput . node ( ) . value = plots . graphJson ( gd ) ;
143143 hiddenform . node ( ) . submit ( ) ;
144144 hiddenformDiv . remove ( ) ;
145145
@@ -1318,7 +1318,6 @@ plots.supplyLayoutGlobalDefaults = function(layoutIn, layoutOut, formatObj) {
13181318 coerce ( 'paper_bgcolor' ) ;
13191319
13201320 coerce ( 'separators' , formatObj . decimal + formatObj . thousands ) ;
1321- coerce ( 'hidesources' ) ;
13221321
13231322 coerce ( 'colorway' ) ;
13241323
@@ -1964,27 +1963,21 @@ plots.didMarginChange = function(margin0, margin1) {
19641963/**
19651964 * JSONify the graph data and layout
19661965 *
1967- * This function needs to recurse because some src can be inside
1966+ * This function needs to recurse because some objects can be inside
19681967 * sub-objects.
19691968 *
19701969 * It also strips out functions and private (starts with _) elements.
19711970 * Therefore, we can add temporary things to data and layout that don't
19721971 * get saved.
19731972 *
19741973 * @param gd The graphDiv
1975- * @param {Boolean } dataonly If true, don't return layout.
1976- * @param {'keepref'|'keepdata'|'keepall' } [mode='keepref'] Filter what's kept
1977- * keepref: remove data for which there's a src present
1978- * eg if there's xsrc present (and xsrc is well-formed,
1979- * ie has : and some chars before it), strip out x
1980- * keepdata: remove all src tags, don't remove the data itself
1981- * keepall: keep data and src
1982- * @param {String } output If you specify 'object', the result will not be stringified
1983- * @param {Boolean } useDefaults If truthy, use _fullLayout and _fullData
1984- * @param {Boolean } includeConfig If truthy, include _context
1974+ * @param {Boolean } [dataonly=false] If true, don't return layout.
1975+ * @param {String } [output='json'] If set to 'object', return result as a JS Object, otherwise return as a JSON string
1976+ * @param {Boolean } [useDefaults=false] If truthy, use _fullLayout and _fullData (after supplyDefaults step)
1977+ * @param {Boolean } [includeConfig=false] If truthy, include _context
19851978 * @returns {Object|String }
19861979 */
1987- plots . graphJson = function ( gd , dataonly , mode , output , useDefaults , includeConfig ) {
1980+ plots . graphJson = function ( gd , dataonly = false , output = 'json' , useDefaults = false , includeConfig = false ) {
19881981 // if the defaults aren't supplied yet, we need to do that...
19891982 if ( ( useDefaults && dataonly && ! gd . _fullData ) ||
19901983 ( useDefaults && ! dataonly && ! gd . _fullLayout ) ) {
@@ -2001,7 +1994,6 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfi
20011994 }
20021995 if ( Lib . isPlainObject ( d ) ) {
20031996 var o = { } ;
2004- var src ;
20051997 Object . keys ( d ) . sort ( ) . forEach ( function ( v ) {
20061998 // remove private elements and functions
20071999 // _ is for private, [ is a mistake ie [object Object]
@@ -2013,21 +2005,6 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfi
20132005 return ;
20142006 }
20152007
2016- // look for src/data matches and remove the appropriate one
2017- if ( mode === 'keepdata' ) {
2018- // keepdata: remove all ...src tags
2019- if ( v . slice ( - 3 ) === 'src' ) {
2020- return ;
2021- }
2022- } else if ( mode !== 'keepall' ) {
2023- // keepref: remove sourced data but only
2024- // if the source tag is well-formed
2025- src = d [ v + 'src' ] ;
2026- if ( typeof src === 'string' && src . indexOf ( ':' ) > 0 ) {
2027- return ;
2028- }
2029- }
2030-
20312008 // OK, we're including this... recurse into it
20322009 o [ v ] = stripObj ( d [ v ] , keepFunction ) ;
20332010 } ) ;
0 commit comments