@@ -22,27 +22,27 @@ define([
2222
2323 const importTemplates = {
2424 'data-analysis' : [
25- { i0 : 'numpy' , i1 : 'np' , type : 'module' } ,
26- { i0 : 'pandas' , i1 : 'pd' , type : 'module' } ,
25+ { i0 : 'numpy' , i1 : 'np' , type : 'module' , checked : 'checked' } ,
26+ { i0 : 'pandas' , i1 : 'pd' , type : 'module' , checked : 'checked' } ,
2727 {
2828 i0 : 'matplotlib.pyplot' , i1 : 'plt' , type : 'module'
2929 , include : [
3030 '%matplotlib inline'
31- ]
31+ ] , checked : 'checked'
3232 } ,
33- { i0 : 'seaborn' , i1 : 'sns' , type : 'module' } ,
33+ { i0 : 'seaborn' , i1 : 'sns' , type : 'module' , checked : 'checked' } ,
3434 {
3535 i0 : 'plotly.express' , i1 : 'px' , type : 'module'
3636 , include : [
3737 'from plotly.offline import init_notebook_mode' ,
3838 'init_notebook_mode(connected=True)'
39- ] , checked : false
39+ ] , checked : ''
4040 } ,
41- { i0 : 'pyarrow' , i1 : 'pa' , type : 'module' , checked : false } ,
41+ { i0 : 'pyarrow' , i1 : 'pa' , type : 'module' , checked : '' } ,
4242 ] ,
4343 'machine-learning' : [
44- { i0 : 'sklearn.model_selection' , i1 : 'train_test_split' , type : 'function' } ,
45- { i0 : 'sklearn' , i1 : 'metrics' , type : 'function' }
44+ { i0 : 'sklearn.model_selection' , i1 : 'train_test_split' , type : 'function' , checked : 'checked' } ,
45+ { i0 : 'sklearn' , i1 : 'metrics' , type : 'function' , checked : 'checked' }
4646 ]
4747 }
4848
@@ -175,9 +175,9 @@ define([
175175 let that = this ;
176176 libraries && libraries . forEach ( ( lib , idx ) => {
177177 if ( lib . type == 'function' ) {
178- page . appendLine ( that . templateForFunction ( idx , lib . i0 , lib . i1 , lib . checked ) ) ;
178+ page . appendLine ( that . templateForFunction ( idx , lib . i0 , lib . i1 , ( lib . checked === 'checked' || lib . checked === true ) ) ) ;
179179 } else {
180- page . appendLine ( that . templateForModule ( idx , lib . i0 , lib . i1 , lib . checked ) ) ;
180+ page . appendLine ( that . templateForModule ( idx , lib . i0 , lib . i1 , ( lib . checked === 'checked' || lib . checked === true ) ) ) ;
181181 }
182182 } ) ;
183183 page . appendLine ( '</tbody>' ) ;
@@ -246,7 +246,7 @@ define([
246246 if ( pacI0 == "" ) {
247247 continue ;
248248 }
249- if ( pacChecked ) {
249+ if ( pacChecked === true ) {
250250 if ( sbCode . toString ( ) . trim ( ) . length > 0 ) {
251251 sbCode . appendLine ( ) ;
252252 }
@@ -270,7 +270,7 @@ define([
270270 }
271271 }
272272
273- importMeta . push ( { i0 : pacI0 , i1 : pacI1 , type : pacType , checked : pacChecked } ) ;
273+ importMeta . push ( { i0 : pacI0 , i1 : pacI1 , type : pacType , checked : ( pacChecked ? 'checked' : '' ) } ) ;
274274 }
275275 this . state . importMeta = importMeta ;
276276
0 commit comments