Skip to content

Commit 76492b6

Browse files
committed
Add to the ipython display_bundle
1 parent 8eafa68 commit 76492b6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plotly/offline/offline.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,15 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
351351
cls=plotly.utils.PlotlyJSONEncoder))
352352
layout = _json.loads(_json.dumps(figure.get('layout', {}),
353353
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+
354361
display_bundle = {
355-
'application/vnd.plotly.v1+json': {'data': data, 'layout': layout},
362+
'application/vnd.plotly.v1+json': fig,
356363
'text/html': plot_html,
357364
'text/vnd.plotly.v1+html': plot_html
358365
}

0 commit comments

Comments
 (0)