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

Skip to content

Commit de652b7

Browse files
committed
Clean up the includes
1 parent 566e97a commit de652b7

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ def _jupyter_nbextension_paths():
14611461
'section': 'notebook',
14621462
'src': 'backends/web_backend/js',
14631463
'dest': 'matplotlib',
1464-
'require': 'matplotlib/mpl'
1464+
'require': 'matplotlib/extension'
14651465
}]
14661466

14671467

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def export(self):
128128

129129

130130
class FigureCanvasNbAgg(DOMWidget, FigureCanvasWebAggCore):
131-
_view_module = Unicode("nbextensions/matplotlib/nbagg_mpl", sync=True)
131+
_view_module = Unicode("matplotlib", sync=True)
132132
_view_name = Unicode('MPLCanvasView', sync=True)
133133
_toolbar_items = List(sync=True)
134134
_closed = Bool(True)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
define([], function() {
3+
if (window.require) {
4+
window.require.config({
5+
map: {
6+
"*" : {
7+
"matplotlib": "nbextensions/matplotlib/nbagg_mpl",
8+
"jupyter-js-widgets": "nbextensions/jupyter-js-widgets/extension"
9+
}
10+
}
11+
});
12+
}
13+
14+
// Export the required load_ipython_extention
15+
return {
16+
load_ipython_extension: function() {}
17+
};
18+
});

lib/matplotlib/backends/web_backend/js/nbagg_mpl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
define(['jupyter-js-widgets', '/nbextensions/matplotlib/mpl.js'], function(widgets, mpl) {
34

45
var MPLCanvasView = widgets.WidgetView.extend({

0 commit comments

Comments
 (0)