@@ -113,93 +113,6 @@ plots.previousPromises = function(gd) {
113113 }
114114} ;
115115
116- /**
117- * Adds the 'Edit chart' link.
118- * Note that now _doPlot calls this so it can regenerate whenever it replots
119- *
120- * Add source links to your graph inside the 'showSources' config argument.
121- */
122- plots . addLinks = function ( gd ) {
123- // Do not do anything if showLink and showSources are not set to true in config
124- if ( ! gd . _context . showLink && ! gd . _context . showSources ) return ;
125-
126- var fullLayout = gd . _fullLayout ;
127-
128- var linkContainer = Lib . ensureSingle ( fullLayout . _paper , 'text' , 'js-plot-link-container' , function ( s ) {
129- s . style ( {
130- 'font-family' : '"Open Sans", Arial, sans-serif' ,
131- 'font-size' : '12px' ,
132- fill : Color . defaultLine ,
133- 'pointer-events' : 'all'
134- } )
135- . each ( function ( ) {
136- var links = d3 . select ( this ) ;
137- links . append ( 'tspan' ) . classed ( 'js-link-to-tool' , true ) ;
138- links . append ( 'tspan' ) . classed ( 'js-link-spacer' , true ) ;
139- links . append ( 'tspan' ) . classed ( 'js-sourcelinks' , true ) ;
140- } ) ;
141- } ) ;
142-
143- // The text node inside svg
144- var text = linkContainer . node ( ) ;
145- var attrs = { y : fullLayout . _paper . attr ( 'height' ) - 9 } ;
146-
147- // If text's width is bigger than the layout
148- // Check that text is a child node or document.body
149- // because otherwise Edge might throw an exception
150- // when calling getComputedTextLength().
151- // Apparently offsetParent is null for invisibles.
152- if ( document . body . contains ( text ) && text . getComputedTextLength ( ) >= ( fullLayout . width - 20 ) ) {
153- // Align the text at the left
154- attrs [ 'text-anchor' ] = 'start' ;
155- attrs . x = 5 ;
156- } else {
157- // Align the text at the right
158- attrs [ 'text-anchor' ] = 'end' ;
159- attrs . x = fullLayout . _paper . attr ( 'width' ) - 7 ;
160- }
161-
162- linkContainer . attr ( attrs ) ;
163-
164- var toolspan = linkContainer . select ( '.js-link-to-tool' ) ;
165- var spacespan = linkContainer . select ( '.js-link-spacer' ) ;
166- var sourcespan = linkContainer . select ( '.js-sourcelinks' ) ;
167-
168- if ( gd . _context . showSources ) gd . _context . showSources ( gd ) ;
169-
170- // 'view in plotly' link for embedded plots
171- if ( gd . _context . showLink ) positionPlayWithData ( gd , toolspan ) ;
172-
173- // separator if we have both sources and tool link
174- spacespan . text ( ( toolspan . text ( ) && sourcespan . text ( ) ) ? ' - ' : '' ) ;
175- } ;
176-
177- // note that now this function is only adding the brand in
178- // iframes and 3rd-party apps
179- function positionPlayWithData ( gd , container ) {
180- container . text ( '' ) ;
181- var link = container . append ( 'a' )
182- . attr ( {
183- 'xlink:xlink:href' : '#' ,
184- class : 'link--impt link--embedview' ,
185- 'font-weight' : 'bold'
186- } )
187- . text ( gd . _context . linkText + ' ' + String . fromCharCode ( 187 ) ) ;
188-
189- if ( gd . _context . sendData ) {
190- link . on ( 'click' , function ( ) {
191- plots . sendDataToCloud ( gd ) ;
192- } ) ;
193- } else {
194- var path = window . location . pathname . split ( '/' ) ;
195- var query = window . location . search ;
196- link . attr ( {
197- 'xlink:xlink:show' : 'new' ,
198- 'xlink:xlink:href' : '/' + path [ 2 ] . split ( '.' ) [ 0 ] + '/' + path [ 1 ] + query
199- } ) ;
200- }
201- }
202-
203116plots . sendDataToCloud = function ( gd ) {
204117 var baseUrl = ( window . PLOTLYENV || { } ) . BASE_URL || gd . _context . plotlyServerURL ;
205118 if ( ! baseUrl ) return ;
@@ -2106,16 +2019,6 @@ plots.graphJson = function(gd, dataonly, mode, output, useDefaults, includeConfi
21062019 if ( v . slice ( - 3 ) === 'src' ) {
21072020 return ;
21082021 }
2109- } else if ( mode === 'keepstream' ) {
2110- // keep sourced data if it's being streamed.
2111- // similar to keepref, but if the 'stream' object exists
2112- // in a trace, we will keep the data array.
2113- src = d [ v + 'src' ] ;
2114- if ( typeof src === 'string' && src . indexOf ( ':' ) > 0 ) {
2115- if ( ! Lib . isPlainObject ( d . stream ) ) {
2116- return ;
2117- }
2118- }
21192022 } else if ( mode !== 'keepall' ) {
21202023 // keepref: remove sourced data but only
21212024 // if the source tag is well-formed
0 commit comments