Skip to content

Commit bfee772

Browse files
committed
Raise for bad plot options in _send_to_plotly
1 parent 4e644af commit bfee772

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plotly/plotly/plotly.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,11 @@ def _send_to_plotly(figure, **plot_options):
13901390
"""
13911391
13921392
"""
1393+
invalid_plot_options = [plot_option for plot_option in plot_options
1394+
if plot_option not in DEFAULT_PLOT_OPTIONS]
1395+
if invalid_plot_options:
1396+
raise exceptions.PlotlyError('Invalid plot options, {}.'
1397+
.format(invalid_plot_options))
13931398
fig = tools._replace_newline(figure) # does not mutate figure
13941399
data = json.dumps(fig['data'] if 'data' in fig else [],
13951400
cls=utils.PlotlyJSONEncoder)

0 commit comments

Comments
 (0)