Skip to content

Commit 1a2687d

Browse files
authored
Merge branch 'master' into dash_api
2 parents ff3ca26 + 2be151e commit 1a2687d

File tree

7 files changed

+5233
-1989
lines changed

7 files changed

+5233
-1989
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
66
### Added
7-
- offline embedded plots are now responsive to window resizing when `output_type == "div"` is set in `plotly.offline.iplot()`.
87
- Beta: Added API methods that wrap the API endpoint for managing Dash objects on plot.ly. The API interface is under `plotly.api.v2.dash_apps`
98

9+
## [2.0.8] - 2017-04-21
10+
### Added
11+
- offline embedded plots are now responsive to window resizing when `output_type == "div"` is set in `plotly.offline.iplot()`.
12+
- Offline animations are now supported on Plotly Cloud.
13+
14+
### Updated
15+
- `plotly.offline.plot` and `plotly.offline.iplot` now accept various [configuration options](https://plot.ly/javascript/configuration-options/) for their arguments.
16+
1017
## [2.0.7] - 2017-04-07
1118
### Updated
1219
- Updated `plotly.min.js` to version 1.25.0 for `plotly.offline`.

plotly/graph_objs/graph_objs.py

+117-58
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,10 @@ class Annotation(PlotlyDict):
822822
823823
['align', 'arrowcolor', 'arrowhead', 'arrowsize', 'arrowwidth', 'ax',
824824
'axref', 'ay', 'ayref', 'bgcolor', 'bordercolor', 'borderpad',
825-
'borderwidth', 'clicktoshow', 'font', 'opacity', 'ref', 'showarrow',
826-
'standoff', 'text', 'textangle', 'visible', 'x', 'xanchor', 'xclick',
827-
'xref', 'y', 'yanchor', 'yclick', 'yref']
825+
'borderwidth', 'captureevents', 'clicktoshow', 'font', 'height',
826+
'hoverlabel', 'hovertext', 'opacity', 'ref', 'showarrow', 'standoff',
827+
'text', 'textangle', 'valign', 'visible', 'width', 'x', 'xanchor',
828+
'xclick', 'xref', 'xshift', 'y', 'yanchor', 'yclick', 'yref', 'yshift']
828829
829830
Run `<annotation-object>.help('attribute')` on any of the above.
830831
'<annotation-object>' is the object at []
@@ -861,12 +862,12 @@ class Bar(PlotlyDict):
861862
Valid attributes for 'bar' at path [] under parents ():
862863
863864
['bardir', 'base', 'basesrc', 'dx', 'dy', 'error_x', 'error_y',
864-
'hoverinfo', 'insidetextfont', 'legendgroup', 'marker', 'name',
865-
'offset', 'offsetsrc', 'opacity', 'orientation', 'outsidetextfont',
866-
'r', 'rsrc', 'showlegend', 'stream', 't', 'text', 'textfont',
867-
'textposition', 'textpositionsrc', 'textsrc', 'tsrc', 'type', 'uid',
868-
'visible', 'width', 'widthsrc', 'x', 'x0', 'xaxis', 'xcalendar',
869-
'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc']
865+
'hoverinfo', 'hovertext', 'hovertextsrc', 'insidetextfont',
866+
'legendgroup', 'marker', 'name', 'offset', 'offsetsrc', 'opacity',
867+
'orientation', 'outsidetextfont', 'r', 'rsrc', 'showlegend', 'stream',
868+
't', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc',
869+
'tsrc', 'type', 'uid', 'visible', 'width', 'widthsrc', 'x', 'x0',
870+
'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc']
870871
871872
Run `<bar-object>.help('attribute')` on any of the above.
872873
'<bar-object>' is the object at []
@@ -908,6 +909,22 @@ class Candlestick(PlotlyDict):
908909
_name = 'candlestick'
909910

910911

912+
class Carpet(PlotlyDict):
913+
"""
914+
Valid attributes for 'carpet' at path [] under parents ():
915+
916+
['a', 'a0', 'aaxis', 'asrc', 'b', 'b0', 'baxis', 'bsrc', 'carpet',
917+
'cheaterslope', 'color', 'da', 'db', 'font', 'hoverinfo',
918+
'legendgroup', 'name', 'opacity', 'showlegend', 'stream', 'type',
919+
'uid', 'visible', 'x', 'xaxis', 'xsrc', 'y', 'yaxis', 'ysrc']
920+
921+
Run `<carpet-object>.help('attribute')` on any of the above.
922+
'<carpet-object>' is the object at []
923+
924+
"""
925+
_name = 'carpet'
926+
927+
911928
class Choropleth(PlotlyDict):
912929
"""
913930
Valid attributes for 'choropleth' at path [] under parents ():
@@ -965,11 +982,31 @@ class Contour(PlotlyDict):
965982
_name = 'contour'
966983

967984

985+
class Contourcarpet(PlotlyDict):
986+
"""
987+
Valid attributes for 'contourcarpet' at path [] under parents ():
988+
989+
['a', 'a0', 'asrc', 'atype', 'autocolorscale', 'autocontour', 'b',
990+
'b0', 'bsrc', 'btype', 'carpet', 'colorbar', 'colorscale',
991+
'connectgaps', 'contours', 'da', 'db', 'fillcolor', 'hoverinfo',
992+
'legendgroup', 'line', 'mode', 'name', 'ncontours', 'opacity',
993+
'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc',
994+
'transpose', 'type', 'uid', 'visible', 'xaxis', 'yaxis', 'z', 'zauto',
995+
'zmax', 'zmin', 'zsrc']
996+
997+
Run `<contourcarpet-object>.help('attribute')` on any of the above.
998+
'<contourcarpet-object>' is the object at []
999+
1000+
"""
1001+
_name = 'contourcarpet'
1002+
1003+
9681004
class Contours(PlotlyDict):
9691005
"""
9701006
Valid attributes for 'contours' at path [] under parents ():
9711007
972-
['coloring', 'end', 'showlines', 'size', 'start', 'x', 'y', 'z']
1008+
['coloring', 'end', 'operation', 'showlines', 'size', 'start', 'type',
1009+
'value', 'x', 'y', 'z']
9731010
9741011
Run `<contours-object>.help('attribute')` on any of the above.
9751012
'<contours-object>' is the object at []
@@ -981,11 +1018,12 @@ class Contours(PlotlyDict):
9811018
class Data(PlotlyList):
9821019
"""
9831020
Valid items for 'data' at path [] under parents ():
984-
['Area', 'Bar', 'Box', 'Candlestick', 'Choropleth', 'Contour',
985-
'Heatmap', 'Heatmapgl', 'Histogram', 'Histogram2d',
986-
'Histogram2dcontour', 'Mesh3d', 'Ohlc', 'Parcoords', 'Pie',
987-
'Pointcloud', 'Scatter', 'Scatter3d', 'Scattergeo', 'Scattergl',
988-
'Scattermapbox', 'Scatterternary', 'Surface']
1021+
['Area', 'Bar', 'Box', 'Candlestick', 'Carpet', 'Choropleth',
1022+
'Contour', 'Contourcarpet', 'Heatmap', 'Heatmapgl', 'Histogram',
1023+
'Histogram2d', 'Histogram2dcontour', 'Mesh3d', 'Ohlc', 'Parcoords',
1024+
'Pie', 'Pointcloud', 'Scatter', 'Scatter3d', 'Scattercarpet',
1025+
'Scattergeo', 'Scattergl', 'Scattermapbox', 'Scatterternary',
1026+
'Surface']
9891027
9901028
"""
9911029
_name = 'data'
@@ -1513,12 +1551,12 @@ class Pie(PlotlyDict):
15131551
"""
15141552
Valid attributes for 'pie' at path [] under parents ():
15151553
1516-
['direction', 'dlabel', 'domain', 'hole', 'hoverinfo',
1517-
'insidetextfont', 'label0', 'labels', 'labelssrc', 'legendgroup',
1518-
'marker', 'name', 'opacity', 'outsidetextfont', 'pull', 'pullsrc',
1519-
'rotation', 'scalegroup', 'showlegend', 'sort', 'stream', 'text',
1520-
'textfont', 'textinfo', 'textposition', 'textpositionsrc', 'textsrc',
1521-
'type', 'uid', 'values', 'valuessrc', 'visible']
1554+
['direction', 'dlabel', 'domain', 'hole', 'hoverinfo', 'hovertext',
1555+
'hovertextsrc', 'insidetextfont', 'label0', 'labels', 'labelssrc',
1556+
'legendgroup', 'marker', 'name', 'opacity', 'outsidetextfont', 'pull',
1557+
'pullsrc', 'rotation', 'scalegroup', 'showlegend', 'sort', 'stream',
1558+
'text', 'textfont', 'textinfo', 'textposition', 'textpositionsrc',
1559+
'textsrc', 'type', 'uid', 'values', 'valuessrc', 'visible']
15221560
15231561
Run `<pie-object>.help('attribute')` on any of the above.
15241562
'<pie-object>' is the object at []
@@ -1563,12 +1601,12 @@ class Scatter(PlotlyDict):
15631601
Valid attributes for 'scatter' at path [] under parents ():
15641602
15651603
['connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x',
1566-
'error_y', 'fill', 'fillcolor', 'hoverinfo', 'hoveron', 'ids',
1567-
'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity',
1568-
'r', 'rsrc', 'showlegend', 'stream', 't', 'text', 'textfont',
1569-
'textposition', 'textpositionsrc', 'textsrc', 'tsrc', 'type', 'uid',
1570-
'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis',
1571-
'ycalendar', 'ysrc']
1604+
'error_y', 'fill', 'fillcolor', 'hoverinfo', 'hoveron', 'hovertext',
1605+
'hovertextsrc', 'ids', 'idssrc', 'legendgroup', 'line', 'marker',
1606+
'mode', 'name', 'opacity', 'r', 'rsrc', 'showlegend', 'stream', 't',
1607+
'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc',
1608+
'tsrc', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar',
1609+
'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc']
15721610
15731611
Run `<scatter-object>.help('attribute')` on any of the above.
15741612
'<scatter-object>' is the object at []
@@ -1582,11 +1620,12 @@ class Scatter3d(PlotlyDict):
15821620
Valid attributes for 'scatter3d' at path [] under parents ():
15831621
15841622
['connectgaps', 'error_x', 'error_y', 'error_z', 'hoverinfo',
1585-
'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity',
1586-
'projection', 'scene', 'showlegend', 'stream', 'surfaceaxis',
1587-
'surfacecolor', 'text', 'textfont', 'textposition', 'textpositionsrc',
1588-
'textsrc', 'type', 'uid', 'visible', 'x', 'xcalendar', 'xsrc', 'y',
1589-
'ycalendar', 'ysrc', 'z', 'zcalendar', 'zsrc']
1623+
'hovertext', 'hovertextsrc', 'legendgroup', 'line', 'marker', 'mode',
1624+
'name', 'opacity', 'projection', 'scene', 'showlegend', 'stream',
1625+
'surfaceaxis', 'surfacecolor', 'text', 'textfont', 'textposition',
1626+
'textpositionsrc', 'textsrc', 'type', 'uid', 'visible', 'x',
1627+
'xcalendar', 'xsrc', 'y', 'ycalendar', 'ysrc', 'z', 'zcalendar',
1628+
'zsrc']
15901629
15911630
Run `<scatter3d-object>.help('attribute')` on any of the above.
15921631
'<scatter3d-object>' is the object at []
@@ -1595,14 +1634,31 @@ class Scatter3d(PlotlyDict):
15951634
_name = 'scatter3d'
15961635

15971636

1637+
class Scattercarpet(PlotlyDict):
1638+
"""
1639+
Valid attributes for 'scattercarpet' at path [] under parents ():
1640+
1641+
['a', 'asrc', 'b', 'bsrc', 'carpet', 'connectgaps', 'fill',
1642+
'fillcolor', 'hoverinfo', 'hoveron', 'legendgroup', 'line', 'marker',
1643+
'mode', 'name', 'opacity', 'showlegend', 'stream', 'sum', 'text',
1644+
'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type',
1645+
'uid', 'visible', 'xaxis', 'yaxis']
1646+
1647+
Run `<scattercarpet-object>.help('attribute')` on any of the above.
1648+
'<scattercarpet-object>' is the object at []
1649+
1650+
"""
1651+
_name = 'scattercarpet'
1652+
1653+
15981654
class Scattergeo(PlotlyDict):
15991655
"""
16001656
Valid attributes for 'scattergeo' at path [] under parents ():
16011657
1602-
['connectgaps', 'fill', 'fillcolor', 'geo', 'hoverinfo', 'lat',
1603-
'latsrc', 'legendgroup', 'line', 'locationmode', 'locations',
1604-
'locationssrc', 'lon', 'lonsrc', 'marker', 'mode', 'name', 'opacity',
1605-
'showlegend', 'stream', 'text', 'textfont', 'textposition',
1658+
['connectgaps', 'fill', 'fillcolor', 'geo', 'hoverinfo', 'hovertext',
1659+
'hovertextsrc', 'lat', 'latsrc', 'legendgroup', 'line', 'locationmode',
1660+
'locations', 'locationssrc', 'lon', 'lonsrc', 'marker', 'mode', 'name',
1661+
'opacity', 'showlegend', 'stream', 'text', 'textfont', 'textposition',
16061662
'textpositionsrc', 'textsrc', 'type', 'uid', 'visible']
16071663
16081664
Run `<scattergeo-object>.help('attribute')` on any of the above.
@@ -1633,10 +1689,11 @@ class Scattermapbox(PlotlyDict):
16331689
"""
16341690
Valid attributes for 'scattermapbox' at path [] under parents ():
16351691
1636-
['connectgaps', 'fill', 'fillcolor', 'hoverinfo', 'lat', 'latsrc',
1637-
'legendgroup', 'line', 'lon', 'lonsrc', 'marker', 'mode', 'name',
1638-
'opacity', 'showlegend', 'stream', 'subplot', 'text', 'textfont',
1639-
'textposition', 'textsrc', 'type', 'uid', 'visible']
1692+
['connectgaps', 'fill', 'fillcolor', 'hoverinfo', 'hovertext',
1693+
'hovertextsrc', 'lat', 'latsrc', 'legendgroup', 'line', 'lon',
1694+
'lonsrc', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream',
1695+
'subplot', 'text', 'textfont', 'textposition', 'textsrc', 'type',
1696+
'uid', 'visible']
16401697
16411698
Run `<scattermapbox-object>.help('attribute')` on any of the above.
16421699
'<scattermapbox-object>' is the object at []
@@ -1650,10 +1707,10 @@ class Scatterternary(PlotlyDict):
16501707
Valid attributes for 'scatterternary' at path [] under parents ():
16511708
16521709
['a', 'asrc', 'b', 'bsrc', 'c', 'connectgaps', 'csrc', 'fill',
1653-
'fillcolor', 'hoverinfo', 'hoveron', 'legendgroup', 'line', 'marker',
1654-
'mode', 'name', 'opacity', 'showlegend', 'stream', 'subplot', 'sum',
1655-
'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc',
1656-
'type', 'uid', 'visible']
1710+
'fillcolor', 'hoverinfo', 'hoveron', 'hovertext', 'hovertextsrc',
1711+
'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity',
1712+
'showlegend', 'stream', 'subplot', 'sum', 'text', 'textfont',
1713+
'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible']
16571714
16581715
Run `<scatterternary-object>.help('attribute')` on any of the above.
16591716
'<scatterternary-object>' is the object at []
@@ -1721,14 +1778,15 @@ class XAxis(PlotlyDict):
17211778
'domain', 'dtick', 'exponentformat', 'fixedrange', 'gridcolor',
17221779
'gridwidth', 'hoverformat', 'linecolor', 'linewidth', 'mirror',
17231780
'nticks', 'overlaying', 'position', 'range', 'rangemode',
1724-
'rangeselector', 'rangeslider', 'separatethousands', 'showaxeslabels',
1725-
'showbackground', 'showexponent', 'showgrid', 'showline', 'showspikes',
1726-
'showticklabels', 'showtickprefix', 'showticksuffix', 'side',
1727-
'spikecolor', 'spikesides', 'spikethickness', 'tick0', 'tickangle',
1781+
'rangeselector', 'rangeslider', 'scaleanchor', 'scaleratio',
1782+
'separatethousands', 'showaxeslabels', 'showbackground',
1783+
'showexponent', 'showgrid', 'showline', 'showspikes', 'showticklabels',
1784+
'showtickprefix', 'showticksuffix', 'side', 'spikecolor', 'spikedash',
1785+
'spikemode', 'spikesides', 'spikethickness', 'tick0', 'tickangle',
17281786
'tickcolor', 'tickfont', 'tickformat', 'ticklen', 'tickmode',
17291787
'tickprefix', 'ticks', 'ticksuffix', 'ticktext', 'ticktextsrc',
17301788
'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'type',
1731-
'zeroline', 'zerolinecolor', 'zerolinewidth']
1789+
'visible', 'zeroline', 'zerolinecolor', 'zerolinewidth']
17321790
17331791
Run `<xaxis-object>.help('attribute')` on any of the above.
17341792
'<xaxis-object>' is the object at []
@@ -1759,13 +1817,14 @@ class YAxis(PlotlyDict):
17591817
'domain', 'dtick', 'exponentformat', 'fixedrange', 'gridcolor',
17601818
'gridwidth', 'hoverformat', 'linecolor', 'linewidth', 'mirror',
17611819
'nticks', 'overlaying', 'position', 'range', 'rangemode',
1762-
'separatethousands', 'showaxeslabels', 'showbackground',
1763-
'showexponent', 'showgrid', 'showline', 'showspikes', 'showticklabels',
1764-
'showtickprefix', 'showticksuffix', 'side', 'spikecolor', 'spikesides',
1765-
'spikethickness', 'tick0', 'tickangle', 'tickcolor', 'tickfont',
1766-
'tickformat', 'ticklen', 'tickmode', 'tickprefix', 'ticks',
1767-
'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc',
1768-
'tickwidth', 'title', 'titlefont', 'type', 'zeroline', 'zerolinecolor',
1820+
'scaleanchor', 'scaleratio', 'separatethousands', 'showaxeslabels',
1821+
'showbackground', 'showexponent', 'showgrid', 'showline', 'showspikes',
1822+
'showticklabels', 'showtickprefix', 'showticksuffix', 'side',
1823+
'spikecolor', 'spikedash', 'spikemode', 'spikesides', 'spikethickness',
1824+
'tick0', 'tickangle', 'tickcolor', 'tickfont', 'tickformat', 'ticklen',
1825+
'tickmode', 'tickprefix', 'ticks', 'ticksuffix', 'ticktext',
1826+
'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title',
1827+
'titlefont', 'type', 'visible', 'zeroline', 'zerolinecolor',
17691828
'zerolinewidth']
17701829
17711830
Run `<yaxis-object>.help('attribute')` on any of the above.
@@ -1802,8 +1861,8 @@ class ZAxis(PlotlyDict):
18021861
'spikethickness', 'tick0', 'tickangle', 'tickcolor', 'tickfont',
18031862
'tickformat', 'ticklen', 'tickmode', 'tickprefix', 'ticks',
18041863
'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc',
1805-
'tickwidth', 'title', 'titlefont', 'type', 'zeroline', 'zerolinecolor',
1806-
'zerolinewidth']
1864+
'tickwidth', 'title', 'titlefont', 'type', 'visible', 'zeroline',
1865+
'zerolinecolor', 'zerolinewidth']
18071866
18081867
Run `<zaxis-object>.help('attribute')` on any of the above.
18091868
'<zaxis-object>' is the object at []

plotly/offline/offline.py

+23-9
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def _plot_html(figure_or_data, config, validate, default_width,
275275

276276
def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
277277
validate=True, image=None, filename='plot_image', image_width=800,
278-
image_height=600):
278+
image_height=600, config=None):
279279
"""
280280
Draw plotly graphs inside an IPython or Jupyter notebook without
281281
connecting to an external server.
@@ -308,6 +308,9 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
308308
will be saved to. The extension should not be included.
309309
image_height (default=600) -- Specifies the height of the image in `px`.
310310
image_width (default=800) -- Specifies the width of the image in `px`.
311+
config (default=None) -- Plot view options dictionary. Keyword arguments
312+
`show_link` and `link_text` set the associated options in this
313+
dictionary if it doesn't contain them already.
311314
312315
Example:
313316
```
@@ -331,9 +334,9 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
331334
if not ipython:
332335
raise ImportError('`iplot` can only run inside an IPython Notebook.')
333336

334-
config = {}
335-
config['showLink'] = show_link
336-
config['linkText'] = link_text
337+
config = dict(config) if config else {}
338+
config.setdefault('showLink', show_link)
339+
config.setdefault('linkText', link_text)
337340

338341
plot_html, plotdivid, width, height = _plot_html(
339342
figure_or_data, config, validate, '100%', 525, True
@@ -348,8 +351,15 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
348351
cls=plotly.utils.PlotlyJSONEncoder))
349352
layout = _json.loads(_json.dumps(figure.get('layout', {}),
350353
cls=plotly.utils.PlotlyJSONEncoder))
354+
frames = _json.loads(_json.dumps(figure.get('frames', None),
355+
cls=plotly.utils.PlotlyJSONEncoder))
356+
357+
fig = {'data': data, 'layout': layout}
358+
if frames:
359+
fig['frames'] = frames
360+
351361
display_bundle = {
352-
'application/vnd.plotly.v1+json': {'data': data, 'layout': layout},
362+
'application/vnd.plotly.v1+json': fig,
353363
'text/html': plot_html,
354364
'text/vnd.plotly.v1+html': plot_html
355365
}
@@ -375,7 +385,8 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
375385
def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
376386
validate=True, output_type='file', include_plotlyjs=True,
377387
filename='temp-plot.html', auto_open=True, image=None,
378-
image_filename='plot_image', image_width=800, image_height=600):
388+
image_filename='plot_image', image_width=800, image_height=600,
389+
config=None):
379390
""" Create a plotly graph locally as an HTML document or string.
380391
381392
Example:
@@ -435,6 +446,9 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
435446
image will be saved to. The extension should not be included.
436447
image_height (default=600) -- Specifies the height of the image in `px`.
437448
image_width (default=800) -- Specifies the width of the image in `px`.
449+
config (default=None) -- Plot view options dictionary. Keyword arguments
450+
`show_link` and `link_text` set the associated options in this
451+
dictionary if it doesn't contain them already.
438452
"""
439453
if output_type not in ['div', 'file']:
440454
raise ValueError(
@@ -446,9 +460,9 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
446460
"Adding .html to the end of your file.")
447461
filename += '.html'
448462

449-
config = {}
450-
config['showLink'] = show_link
451-
config['linkText'] = link_text
463+
config = dict(config) if config else {}
464+
config.setdefault('showLink', show_link)
465+
config.setdefault('linkText', link_text)
452466

453467
plot_html, plotdivid, width, height = _plot_html(
454468
figure_or_data, config, validate,

0 commit comments

Comments
 (0)