Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31b5aa4

Browse files
committed
fixed conflict
2 parents f463fd6 + d88c5d0 commit 31b5aa4

File tree

5 files changed

+66
-48
lines changed

5 files changed

+66
-48
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
66

7+
## [1.9.9] - 2016-04-15
8+
### Fixed
9+
- Fixed `require is not defined` issue when plotting offline outside of Ipython Notebooks.
10+
11+
## [1.9.8] - 2016-04-14
12+
### Fixed
13+
- Error no longer results from a "Run All" cells when working in a Jupyter Notebook.
14+
15+
### Updated
16+
- Updated plotly.min.js so offline is using plotly.js v1.9.0
17+
- Added Ternary plots with support for scatter traces (trace type `scatterternary`, currently only available in offline mode)
18+
- For comprehensive update list see the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md)
19+
720
## [1.9.7] - 2016-04-04
821
### Fixed
922
- Offline mode will no longer delete the Jupyter Notebook's require, requirejs, and define variables.

plotly/offline/offline.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def init_notebook_mode():
7373

7474

7575
def _plot_html(figure_or_data, show_link, link_text,
76-
validate, default_width, default_height):
76+
validate, default_width, default_height, global_requirejs):
7777

7878
figure = tools.return_figure_from_figure_or_data(figure_or_data, validate)
7979

@@ -121,15 +121,21 @@ def _plot_html(figure_or_data, show_link, link_text,
121121
layout=jlayout,
122122
config=jconfig)
123123

124+
optional_line1 = ('require(["plotly"], function(Plotly) {{ '
125+
if global_requirejs else '')
126+
optional_line2 = '}});' if global_requirejs else ''
127+
124128
plotly_html_div = (
125129
''
126130
'<div id="{id}" style="height: {height}; width: {width};" '
127131
'class="plotly-graph-div">'
128132
'</div>'
129-
'<script type="text/javascript">'
133+
'<script type="text/javascript">' +
134+
optional_line1 +
130135
'window.PLOTLYENV=window.PLOTLYENV || {{}};'
131136
'window.PLOTLYENV.BASE_URL="' + plotly_platform_url + '";'
132-
'{script}'
137+
'{script}' +
138+
optional_line2 +
133139
'</script>'
134140
'').format(
135141
id=plotdivid, script=script,
@@ -187,7 +193,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
187193

188194
plot_html, plotdivid, width, height = _plot_html(
189195
figure_or_data, show_link, link_text, validate,
190-
'100%', 525)
196+
'100%', 525, global_requirejs=True)
191197

192198
display(HTML(plot_html))
193199

@@ -256,7 +262,7 @@ def plot(figure_or_data,
256262

257263
plot_html, plotdivid, width, height = _plot_html(
258264
figure_or_data, show_link, link_text, validate,
259-
'100%', '100%')
265+
'100%', '100%', global_requirejs=False)
260266

261267
resize_script = ''
262268
if width == '100%' or height == '100%':

plotly/offline/plotly.min.js

Lines changed: 39 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plotly/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,7 @@ def create_distplot(hist_data, group_labels,
23402340
BETA function that creates a distplot similar to seaborn.distplot
23412341
23422342
The distplot can be composed of all or any combination of the following
2343-
3 components: (1) histogram, (2) curve: (a) kernal density estimation
2343+
3 components: (1) histogram, (2) curve: (a) kernel density estimation
23442344
or (b) normal curve, and (3) rug plot. Additionally, multiple distplots
23452345
(from multiple datasets) can be created in the same plot.
23462346
@@ -3404,7 +3404,7 @@ def make_hist(self):
34043404

34053405
def make_kde(self):
34063406
"""
3407-
Makes the kernal density estimation(s) for create_distplot().
3407+
Makes the kernel density estimation(s) for create_distplot().
34083408
34093409
This is called when curve_type = 'kde' in create_distplot().
34103410

plotly/version.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
__version__ = '1.9.7'
2-
3-
1+
__version__ = '1.9.9'

0 commit comments

Comments
 (0)