File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,17 @@ define([], function() {
90
90
' except ValueError:' ,
91
91
' return 0.0'
92
92
]
93
- }
93
+ } ,
94
+ 'vpimport' : [
95
+ { library : 'numpy' , alias :'np' } ,
96
+ { library : 'pandas' , alias :'pd' } ,
97
+ { library : 'matplotlib.pyplot' , alias :'plt' ,
98
+ include : [
99
+ '%matplotlib inline'
100
+ ]
101
+ } ,
102
+ { library : 'seaborn' , alias :'sns' }
103
+ ]
94
104
}
95
105
96
106
this . data = {
@@ -165,7 +175,8 @@ define([], function() {
165
175
Jupyter . notebook . config . loaded . then ( function ( ) {
166
176
var data = Jupyter . notebook . config . data [ configKey ] ;
167
177
if ( data == undefined ) {
168
- data = { } ;
178
+ reject ( 'No data available.' ) ;
179
+ return ;
169
180
}
170
181
if ( dataKey == '' ) {
171
182
resolve ( data ) ;
@@ -184,7 +195,7 @@ define([], function() {
184
195
Jupyter . notebook . config . load ( ) ;
185
196
var data = Jupyter . notebook . config . data [ configKey ] ;
186
197
if ( data == undefined ) {
187
- data = { } ;
198
+ return undefined ;
188
199
}
189
200
if ( dataKey == '' ) {
190
201
return data ;
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ define([
81
81
page . appendLine ( '</tr></thead>' ) ;
82
82
page . appendLine ( '<tbody>' ) ;
83
83
let that = this ;
84
- this . state . importMeta . forEach ( ( lib , idx ) => {
84
+ this . state . importMeta && this . state . importMeta . forEach ( ( lib , idx ) => {
85
85
page . appendLine ( that . templateForLibrary ( idx , lib . library , lib . alias ) ) ;
86
86
} ) ;
87
87
page . appendLine ( '</tbody>' ) ;
You can’t perform that action at this time.
0 commit comments