@@ -114,16 +114,14 @@ def _build_mathjax_script(url):
114
114
115
115
116
116
def _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 ()
120
117
121
118
configkeys = (
122
119
'staticPlot' ,
123
120
'plotlyServerURL' ,
124
121
'editable' ,
125
122
'edits' ,
126
123
'autosizable' ,
124
+ 'responsive' ,
127
125
'queueLength' ,
128
126
'fillFrame' ,
129
127
'frameMargins' ,
@@ -134,6 +132,7 @@ def _get_jconfig(config):
134
132
'showAxisRangeEntryBoxes' ,
135
133
'showLink' ,
136
134
'sendData' ,
135
+ 'showSendToCloud' ,
137
136
'linkText' ,
138
137
'showSources' ,
139
138
'displayModeBar' ,
@@ -142,6 +141,7 @@ def _get_jconfig(config):
142
141
'modeBarButtons' ,
143
142
'toImageButtonOptions' ,
144
143
'displaylogo' ,
144
+ 'watermark' ,
145
145
'plotGlPixelRatio' ,
146
146
'setBackground' ,
147
147
'topojsonURL' ,
@@ -152,7 +152,21 @@ def _get_jconfig(config):
152
152
'locales' ,
153
153
)
154
154
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 )
156
170
157
171
# TODO: The get_config 'source of truth' should
158
172
# really be somewhere other than plotly.plotly
@@ -381,7 +395,7 @@ def _plot_html(figure_or_data, config, validate, default_width,
381
395
return plotly_html_div , plotdivid , width , height
382
396
383
397
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' ,
385
399
validate = True , image = None , filename = 'plot_image' , image_width = 800 ,
386
400
image_height = 600 , config = None ):
387
401
"""
@@ -397,7 +411,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
397
411
graph descriptions.
398
412
399
413
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
401
415
of the chart that will export the chart to
402
416
Plotly Cloud or Plotly Enterprise
403
417
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',
497
511
ipython_display .display (ipython_display .HTML (script ))
498
512
499
513
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' ,
501
515
validate = True , output_type = 'file' , include_plotlyjs = True ,
502
516
filename = 'temp-plot.html' , auto_open = True , image = None ,
503
517
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',
523
537
graph descriptions.
524
538
525
539
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
527
541
of the chart that will export the chart to Plotly Cloud or
528
542
Plotly Enterprise
529
543
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',
742
756
743
757
744
758
def 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' ,
746
760
validate = True , output_type = 'file' , include_plotlyjs = True ,
747
761
filename = 'temp-plot.html' , auto_open = True ,
748
762
image = None , image_filename = 'plot_image' ,
@@ -762,7 +776,7 @@ def plot_mpl(mpl_fig, resize=False, strip_style=False,
762
776
resize (default=False) -- allow plotly to choose the figure size.
763
777
strip_style (default=False) -- allow plotly to choose style options.
764
778
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
766
780
of the chart that will export the chart to Plotly Cloud or
767
781
Plotly Enterprise
768
782
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,
824
838
825
839
826
840
def iplot_mpl (mpl_fig , resize = False , strip_style = False ,
827
- verbose = False , show_link = True ,
841
+ verbose = False , show_link = False ,
828
842
link_text = 'Export to plot.ly' , validate = True ,
829
843
image = None , image_filename = 'plot_image' ,
830
844
image_height = 600 , image_width = 800 ):
@@ -847,7 +861,7 @@ def iplot_mpl(mpl_fig, resize=False, strip_style=False,
847
861
resize (default=False) -- allow plotly to choose the figure size.
848
862
strip_style (default=False) -- allow plotly to choose style options.
849
863
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
851
865
of the chart that will export the chart to
852
866
Plotly Cloud or Plotly Enterprise
853
867
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,
888
902
889
903
890
904
def enable_mpl_offline (resize = False , strip_style = False ,
891
- verbose = False , show_link = True ,
905
+ verbose = False , show_link = False ,
892
906
link_text = 'Export to plot.ly' , validate = True ):
893
907
"""
894
908
Convert mpl plots to locally hosted HTML documents.
0 commit comments