Skip to content

Commit 2e5313c

Browse files
author
minjk-bl
committed
Edit Import app's default packages
1 parent f22a617 commit 2e5313c

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

js/m_apps/Import.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ define([
2929
, include: [
3030
'%matplotlib inline'
3131
]
32+
},
33+
{ i0: 'seaborn', i1: 'sns', type: 'module'},
34+
{
35+
i0: 'plotly.express', i1: 'px', type: 'module'
36+
, include: [
37+
'from plotly.offline import init_notebook_mode',
38+
'init_notebook_mode(connected=True)'
39+
]
3240
}
3341
],
3442
'machine-learning': [
@@ -242,14 +250,19 @@ define([
242250
// module
243251
sbCode.appendFormat("import {0}{1}", pacI0, ((pacI1 === undefined || pacI1 === "") ? "" : (" as " + pacI1)));
244252
}
245-
}
246253

247-
// Need additional code?
248-
if (pacI0 == 'matplotlib.pyplot' || pacI0 == 'matplotlib') {
249-
sbCode.appendLine();
250-
sbCode.append('%matplotlib inline');
254+
// Need additional code?
255+
if (pacI0 == 'matplotlib.pyplot' || pacI0 == 'matplotlib') {
256+
sbCode.appendLine();
257+
sbCode.append('%matplotlib inline');
258+
}
259+
if (pacI0 == 'plotly.express' || pacI0 == 'plotly') {
260+
sbCode.appendLine();
261+
sbCode.appendLine('from plotly.offline import init_notebook_mode');
262+
sbCode.append('init_notebook_mode(connected=True)');
263+
}
251264
}
252-
265+
253266
importMeta.push({ i0: pacI0, i1: pacI1, type: pacType, checked: pacChecked });
254267
}
255268
this.state.importMeta = importMeta;

0 commit comments

Comments
 (0)