Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JavaScript "Error: addFrames failure" in offline html export #1152

Merged
merged 2 commits into from
Sep 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions plotly/offline/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ def _plot_html(figure_or_data, config, validate, default_width,
jdata = _json.dumps(figure.get('data', []), cls=utils.PlotlyJSONEncoder)
jlayout = _json.dumps(figure.get('layout', {}),
cls=utils.PlotlyJSONEncoder)
if 'frames' in figure_or_data:
jframes = _json.dumps(figure.get('frames', {}),

if figure.get('frames', None):
jframes = _json.dumps(figure.get('frames', []),
cls=utils.PlotlyJSONEncoder)
else:
jframes = None

configkeys = (
'staticPlot',
Expand Down Expand Up @@ -229,7 +232,7 @@ def _plot_html(figure_or_data, config, validate, default_width,
config['linkText'] = link_text
jconfig = jconfig.replace('Export to plot.ly', link_text)

if 'frames' in figure_or_data:
if jframes:
script = '''
Plotly.plot(
'{id}',
Expand Down