@@ -114,16 +114,14 @@ def _build_mathjax_script(url):
114114
115115
116116def _get_jconfig (config ):
117- # TODO: The get_config 'source of truth' should
118- # really be somewhere other than plotly.plotly
119- config = config if config else plotly .plotly .get_config ()
120117
121118 configkeys = (
122119 'staticPlot' ,
123120 'plotlyServerURL' ,
124121 'editable' ,
125122 'edits' ,
126123 'autosizable' ,
124+ 'responsive' ,
127125 'queueLength' ,
128126 'fillFrame' ,
129127 'frameMargins' ,
@@ -134,6 +132,7 @@ def _get_jconfig(config):
134132 'showAxisRangeEntryBoxes' ,
135133 'showLink' ,
136134 'sendData' ,
135+ 'showSendToCloud' ,
137136 'linkText' ,
138137 'showSources' ,
139138 'displayModeBar' ,
@@ -142,6 +141,7 @@ def _get_jconfig(config):
142141 'modeBarButtons' ,
143142 'toImageButtonOptions' ,
144143 'displaylogo' ,
144+ 'watermark' ,
145145 'plotGlPixelRatio' ,
146146 'setBackground' ,
147147 'topojsonURL' ,
@@ -152,7 +152,21 @@ def _get_jconfig(config):
152152 'locales' ,
153153 )
154154
155- clean_config = dict ((k , config [k ]) for k in configkeys if k in config )
155+ if config and isinstance (config , dict ):
156+ # Warn user on unrecognized config options. We make this a warning
157+ # rather than an error since we don't have code generation logic in
158+ # place yet to guarantee that the config options in plotly.py are up
159+ # to date
160+ bad_config = [k for k in config if k not in configkeys ]
161+ if bad_config :
162+ warnings .warn ("""
163+ Unrecognized config options supplied: {bad_config}"""
164+ .format (bad_config = bad_config ))
165+
166+ clean_config = config
167+ else :
168+ config = plotly .plotly .get_config ()
169+ clean_config = dict ((k , config [k ]) for k in configkeys if k in config )
156170
157171 # TODO: The get_config 'source of truth' should
158172 # really be somewhere other than plotly.plotly
@@ -381,7 +395,7 @@ def _plot_html(figure_or_data, config, validate, default_width,
381395 return plotly_html_div , plotdivid , width , height
382396
383397
384- def iplot (figure_or_data , show_link = True , link_text = 'Export to plot.ly' ,
398+ def iplot (figure_or_data , show_link = False , link_text = 'Export to plot.ly' ,
385399 validate = True , image = None , filename = 'plot_image' , image_width = 800 ,
386400 image_height = 600 , config = None ):
387401 """
@@ -397,7 +411,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
397411 graph descriptions.
398412
399413 Keyword arguments:
400- show_link (default=True ) -- display a link in the bottom-right corner of
414+ show_link (default=False ) -- display a link in the bottom-right corner of
401415 of the chart that will export the chart to
402416 Plotly Cloud or Plotly Enterprise
403417 link_text (default='Export to plot.ly') -- the text of export link
@@ -497,7 +511,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
497511 ipython_display .display (ipython_display .HTML (script ))
498512
499513
500- def plot (figure_or_data , show_link = True , link_text = 'Export to plot.ly' ,
514+ def plot (figure_or_data , show_link = False , link_text = 'Export to plot.ly' ,
501515 validate = True , output_type = 'file' , include_plotlyjs = True ,
502516 filename = 'temp-plot.html' , auto_open = True , image = None ,
503517 image_filename = 'plot_image' , image_width = 800 , image_height = 600 ,
@@ -523,7 +537,7 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
523537 graph descriptions.
524538
525539 Keyword arguments:
526- show_link (default=True ) -- display a link in the bottom-right corner of
540+ show_link (default=False ) -- display a link in the bottom-right corner of
527541 of the chart that will export the chart to Plotly Cloud or
528542 Plotly Enterprise
529543 link_text (default='Export to plot.ly') -- the text of export link
@@ -742,7 +756,7 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
742756
743757
744758def plot_mpl (mpl_fig , resize = False , strip_style = False ,
745- verbose = False , show_link = True , link_text = 'Export to plot.ly' ,
759+ verbose = False , show_link = False , link_text = 'Export to plot.ly' ,
746760 validate = True , output_type = 'file' , include_plotlyjs = True ,
747761 filename = 'temp-plot.html' , auto_open = True ,
748762 image = None , image_filename = 'plot_image' ,
@@ -762,7 +776,7 @@ def plot_mpl(mpl_fig, resize=False, strip_style=False,
762776 resize (default=False) -- allow plotly to choose the figure size.
763777 strip_style (default=False) -- allow plotly to choose style options.
764778 verbose (default=False) -- print message.
765- show_link (default=True ) -- display a link in the bottom-right corner of
779+ show_link (default=False ) -- display a link in the bottom-right corner of
766780 of the chart that will export the chart to Plotly Cloud or
767781 Plotly Enterprise
768782 link_text (default='Export to plot.ly') -- the text of export link
@@ -824,7 +838,7 @@ def plot_mpl(mpl_fig, resize=False, strip_style=False,
824838
825839
826840def iplot_mpl (mpl_fig , resize = False , strip_style = False ,
827- verbose = False , show_link = True ,
841+ verbose = False , show_link = False ,
828842 link_text = 'Export to plot.ly' , validate = True ,
829843 image = None , image_filename = 'plot_image' ,
830844 image_height = 600 , image_width = 800 ):
@@ -847,7 +861,7 @@ def iplot_mpl(mpl_fig, resize=False, strip_style=False,
847861 resize (default=False) -- allow plotly to choose the figure size.
848862 strip_style (default=False) -- allow plotly to choose style options.
849863 verbose (default=False) -- print message.
850- show_link (default=True ) -- display a link in the bottom-right corner of
864+ show_link (default=False ) -- display a link in the bottom-right corner of
851865 of the chart that will export the chart to
852866 Plotly Cloud or Plotly Enterprise
853867 link_text (default='Export to plot.ly') -- the text of export link
@@ -888,7 +902,7 @@ def iplot_mpl(mpl_fig, resize=False, strip_style=False,
888902
889903
890904def enable_mpl_offline (resize = False , strip_style = False ,
891- verbose = False , show_link = True ,
905+ verbose = False , show_link = False ,
892906 link_text = 'Export to plot.ly' , validate = True ):
893907 """
894908 Convert mpl plots to locally hosted HTML documents.
0 commit comments