diff --git a/CHANGELOG.md b/CHANGELOG.md index 12362f7d4e3..3e392ed00a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,17 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [1.9.9] - 2016-04-15 +### Fixed +- Fixed `require is not defined` issue when plotting offline outside of Ipython Notebooks. + ## [1.9.8] - 2016-04-14 ### Fixed - Error no longer results from a "Run All" cells when working in a Jupyter Notebook. ### Updated - Updated plotly.min.js so offline is using plotly.js v1.9.0 - - Added Ternary plots with support for scatter traces (trace type `scatterternary`) + - Added Ternary plots with support for scatter traces (trace type `scatterternary`, currently only available in offline mode) - For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) ## [1.9.7] - 2016-04-04 diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index c11bcdb19b8..bd50e2115ba 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -73,7 +73,7 @@ def init_notebook_mode(): def _plot_html(figure_or_data, show_link, link_text, - validate, default_width, default_height): + validate, default_width, default_height, global_requirejs): figure = tools.return_figure_from_figure_or_data(figure_or_data, validate) @@ -121,17 +121,21 @@ def _plot_html(figure_or_data, show_link, link_text, layout=jlayout, config=jconfig) + optional_line1 = ('require(["plotly"], function(Plotly) {{ ' + if global_requirejs else '') + optional_line2 = '}});' if global_requirejs else '' + plotly_html_div = ( '' '
' '
' - '' '').format( id=plotdivid, script=script, @@ -189,7 +193,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly', plot_html, plotdivid, width, height = _plot_html( figure_or_data, show_link, link_text, validate, - '100%', 525) + '100%', 525, global_requirejs=True) display(HTML(plot_html)) @@ -258,7 +262,7 @@ def plot(figure_or_data, plot_html, plotdivid, width, height = _plot_html( figure_or_data, show_link, link_text, validate, - '100%', '100%') + '100%', '100%', global_requirejs=False) resize_script = '' if width == '100%' or height == '100%': diff --git a/plotly/version.py b/plotly/version.py index 2015c15a33c..80d6acd43b2 100644 --- a/plotly/version.py +++ b/plotly/version.py @@ -1 +1 @@ -__version__ = '1.9.8' +__version__ = '1.9.9'