Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2594076

Browse filesBrowse files
committed
Merge pull request plotly#412 from jdfreder/dontclobber
Don't clobber the Notebook's require/requirejs/define instances
2 parents 0dded42 + 5de0376 commit 2594076
Copy full SHA for 2594076

File tree

Expand file treeCollapse file tree

2 files changed

+9
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-7
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [Unreleased]
6+
### Fixed
7+
- Offline mode will no longer delete the Jupyter Notebook's require, requirejs, and define variables.
68

79
## [1.9.6] - 2016-02-18
810
### Updated

‎plotly/offline/offline.py

Copy file name to clipboardExpand all lines: plotly/offline/offline.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ def init_notebook_mode():
6161

6262
global __PLOTLY_OFFLINE_INITIALIZED
6363
if not __PLOTLY_OFFLINE_INITIALIZED:
64-
display(HTML('<script type="text/javascript">' +
65-
# ipython's includes `require` as a global, which
66-
# conflicts with plotly.js. so, unrequire it.
67-
'require=requirejs=define=undefined;' +
68-
'</script>' +
69-
'<script type="text/javascript">' +
64+
display(HTML("<script type='text/javascript'>" +
65+
"define('plotly', function(require, exports, module) {" +
7066
get_plotlyjs() +
71-
'</script>'))
67+
"});" +
68+
"require(['plotly'], function(Plotly) {" +
69+
"window.Plotly = Plotly;" +
70+
"});" +
71+
"</script>"))
7272
__PLOTLY_OFFLINE_INITIALIZED = True
7373

7474

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.