File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments