Skip to content

Commit

Permalink
Fix JavaScript "Error: addFrames failure" in offline html export (#1152)
Browse files Browse the repository at this point in the history
* Fix JavaScript `Error: addFrames failure` in offline html export
  • Loading branch information
jonmmease authored Sep 2, 2018
1 parent 756660a commit 07a2ab3
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit 07a2ab3

Please sign in to comment.