@@ -160,8 +160,8 @@ def init_notebook_mode(connected=False):
160
160
__PLOTLY_OFFLINE_INITIALIZED = True
161
161
162
162
163
- def _plot_html (figure_or_data , show_link , link_text , validate ,
164
- default_width , default_height , global_requirejs ):
163
+ def _plot_html (figure_or_data , config , validate , default_width ,
164
+ default_height , global_requirejs ):
165
165
166
166
figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
167
167
@@ -186,10 +186,30 @@ def _plot_html(figure_or_data, show_link, link_text, validate,
186
186
jdata = json .dumps (figure .get ('data' , []), cls = utils .PlotlyJSONEncoder )
187
187
jlayout = json .dumps (figure .get ('layout' , {}), cls = utils .PlotlyJSONEncoder )
188
188
189
- config = {}
190
- config ['showLink' ] = show_link
191
- config ['linkText' ] = link_text
192
- jconfig = json .dumps (config )
189
+ configkeys = (
190
+ 'editable' ,
191
+ 'autosizable' ,
192
+ 'fillFrame' ,
193
+ 'frameMargins' ,
194
+ 'scrollZoom' ,
195
+ 'doubleClick' ,
196
+ 'showTips' ,
197
+ 'showLink' ,
198
+ 'sendData' ,
199
+ 'linkText' ,
200
+ 'showSources' ,
201
+ 'displayModeBar' ,
202
+ 'modeBarButtonsToRemove' ,
203
+ 'modeBarButtonsToAdd' ,
204
+ 'modeBarButtons' ,
205
+ 'displaylogo' ,
206
+ 'plotGlPixelRatio' ,
207
+ 'setBackground' ,
208
+ 'topojsonURL' )
209
+
210
+ config_clean = dict ((k ,config [k ]) for k in configkeys if k in config )
211
+
212
+ jconfig = json .dumps (config_clean )
193
213
194
214
# TODO: The get_config 'source of truth' should
195
215
# really be somewhere other than plotly.plotly
0 commit comments