@@ -156,35 +156,9 @@ def _get_jconfig(config=None):
156156 else :
157157 clean_config = {}
158158
159- plotly_platform_url = tools .get_config_plotly_server_url ()
160-
161- if not clean_config .get ("plotlyServerURL" , None ):
162- clean_config ["plotlyServerURL" ] = plotly_platform_url
163-
164- if (
165- plotly_platform_url != "https://plot.ly"
166- and clean_config .get ("linkText" , None ) == "Export to plot.ly"
167- ):
168- link_domain = plotly_platform_url .replace ("https://" , "" ).replace ("http://" , "" )
169- link_text = clean_config ["linkText" ].replace ("plot.ly" , link_domain )
170- clean_config ["linkText" ] = link_text
171-
172159 return clean_config
173160
174161
175- # Build script to set global PlotlyConfig object. This must execute before
176- # plotly.js is loaded.
177- _window_plotly_config = """\
178- <script>\
179- window.PlotlyConfig = {MathJaxConfig: 'local'};\
180- </script>"""
181-
182- _mathjax_config = """\
183- <script>\
184- if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}\
185- </script>"""
186-
187-
188162def get_image_download_script (caller ):
189163 """
190164 This function will return a script that will download an image of a Plotly
@@ -286,8 +260,6 @@ def init_notebook_mode(connected=False):
286260
287261def iplot (
288262 figure_or_data ,
289- show_link = False ,
290- link_text = "Export to plot.ly" ,
291263 validate = True ,
292264 image = None ,
293265 filename = "plot_image" ,
@@ -306,10 +278,6 @@ def iplot(
306278 graph descriptions.
307279
308280 Keyword arguments:
309- show_link (default=False) -- display a link in the bottom-right corner of
310- of the chart that will export the chart to
311- Plotly Cloud or Plotly Enterprise
312- link_text (default='Export to plot.ly') -- the text of export link
313281 validate (default=True) -- validate that all of the keys in the figure
314282 are valid? omit if your version of plotly.js
315283 has become outdated with your version of
@@ -325,9 +293,7 @@ def iplot(
325293 will be saved to. The extension should not be included.
326294 image_height (default=600) -- Specifies the height of the image in `px`.
327295 image_width (default=800) -- Specifies the width of the image in `px`.
328- config (default=None) -- Plot view options dictionary. Keyword arguments
329- `show_link` and `link_text` set the associated options in this
330- dictionary if it doesn't contain them already.
296+ config (default=None) -- Plot view options dictionary.
331297 auto_play (default=True) -- Whether to automatically start the animation
332298 sequence on page load, if the figure contains frames. Has no effect if
333299 the figure does not contain frames.
@@ -364,14 +330,12 @@ def iplot(
364330 """
365331 import plotly .io as pio
366332
333+ config = dict (config ) if config else {}
334+
367335 ipython = get_module ("IPython" )
368336 if not ipython :
369337 raise ImportError ("`iplot` can only run inside an IPython Notebook." )
370338
371- config = dict (config ) if config else {}
372- config .setdefault ("showLink" , show_link )
373- config .setdefault ("linkText" , link_text )
374-
375339 # Get figure
376340 figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
377341
@@ -393,8 +357,6 @@ def iplot(
393357
394358def plot (
395359 figure_or_data ,
396- show_link = False ,
397- link_text = "Export to plot.ly" ,
398360 validate = True ,
399361 output_type = "file" ,
400362 include_plotlyjs = True ,
@@ -430,10 +392,6 @@ def plot(
430392 graph descriptions.
431393
432394 Keyword arguments:
433- show_link (default=False) -- display a link in the bottom-right corner of
434- of the chart that will export the chart to Plotly Cloud or
435- Plotly Enterprise
436- link_text (default='Export to plot.ly') -- the text of export link
437395 validate (default=True) -- validate that all of the keys in the figure
438396 are valid? omit if your version of plotly.js has become outdated
439397 with your version of graph_reference.json or if you need to include
@@ -499,9 +457,7 @@ def plot(
499457 image will be saved to. The extension should not be included.
500458 image_height (default=600) -- Specifies the height of the image in `px`.
501459 image_width (default=800) -- Specifies the width of the image in `px`.
502- config (default=None) -- Plot view options dictionary. Keyword arguments
503- `show_link` and `link_text` set the associated options in this
504- dictionary if it doesn't contain them already.
460+ config (default=None) -- Plot view options dictionary.
505461 include_mathjax (False | 'cdn' | path - default=False) --
506462 Specifies how the MathJax.js library is included in the output html
507463 file or div string. MathJax is required in order to display labels
@@ -544,6 +500,8 @@ def plot(
544500 """
545501 import plotly .io as pio
546502
503+ config = dict (config ) if config else {}
504+
547505 # Output type
548506 if output_type not in ["div" , "file" ]:
549507 raise ValueError (
@@ -557,11 +515,6 @@ def plot(
557515 )
558516 filename += ".html"
559517
560- # Config
561- config = dict (config ) if config else {}
562- config .setdefault ("showLink" , show_link )
563- config .setdefault ("linkText" , link_text )
564-
565518 figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
566519 width = figure .get ("layout" , {}).get ("width" , "100%" )
567520 height = figure .get ("layout" , {}).get ("height" , "100%" )
@@ -608,8 +561,6 @@ def plot_mpl(
608561 resize = False ,
609562 strip_style = False ,
610563 verbose = False ,
611- show_link = False ,
612- link_text = "Export to plot.ly" ,
613564 validate = True ,
614565 output_type = "file" ,
615566 include_plotlyjs = True ,
@@ -635,10 +586,6 @@ def plot_mpl(
635586 resize (default=False) -- allow plotly to choose the figure size.
636587 strip_style (default=False) -- allow plotly to choose style options.
637588 verbose (default=False) -- print message.
638- show_link (default=False) -- display a link in the bottom-right corner of
639- of the chart that will export the chart to Plotly Cloud or
640- Plotly Enterprise
641- link_text (default='Export to plot.ly') -- the text of export link
642589 validate (default=True) -- validate that all of the keys in the figure
643590 are valid? omit if your version of plotly.js has become outdated
644591 with your version of graph_reference.json or if you need to include
@@ -692,8 +639,6 @@ def plot_mpl(
692639 plotly_plot = tools .mpl_to_plotly (mpl_fig , resize , strip_style , verbose )
693640 return plot (
694641 plotly_plot ,
695- show_link ,
696- link_text ,
697642 validate ,
698643 output_type ,
699644 include_plotlyjs ,
@@ -711,8 +656,6 @@ def iplot_mpl(
711656 resize = False ,
712657 strip_style = False ,
713658 verbose = False ,
714- show_link = False ,
715- link_text = "Export to plot.ly" ,
716659 validate = True ,
717660 image = None ,
718661 image_filename = "plot_image" ,
@@ -738,10 +681,6 @@ def iplot_mpl(
738681 resize (default=False) -- allow plotly to choose the figure size.
739682 strip_style (default=False) -- allow plotly to choose style options.
740683 verbose (default=False) -- print message.
741- show_link (default=False) -- display a link in the bottom-right corner of
742- of the chart that will export the chart to
743- Plotly Cloud or Plotly Enterprise
744- link_text (default='Export to plot.ly') -- the text of export link
745684 validate (default=True) -- validate that all of the keys in the figure
746685 are valid? omit if your version of plotly.js
747686 has become outdated with your version of
@@ -775,8 +714,6 @@ def iplot_mpl(
775714 plotly_plot = tools .mpl_to_plotly (mpl_fig , resize , strip_style , verbose )
776715 return iplot (
777716 plotly_plot ,
778- show_link ,
779- link_text ,
780717 validate ,
781718 image = image ,
782719 filename = image_filename ,
@@ -789,8 +726,6 @@ def enable_mpl_offline(
789726 resize = False ,
790727 strip_style = False ,
791728 verbose = False ,
792- show_link = False ,
793- link_text = "Export to plot.ly" ,
794729 validate = True ,
795730):
796731 """
@@ -826,7 +761,5 @@ def enable_mpl_offline(
826761 formatter = ip .display_formatter .formatters ["text/html" ]
827762 formatter .for_type (
828763 matplotlib .figure .Figure ,
829- lambda fig : iplot_mpl (
830- fig , resize , strip_style , verbose , show_link , link_text , validate
831- ),
764+ lambda fig : iplot_mpl (fig , resize , strip_style , verbose , validate ),
832765 )
0 commit comments