File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 156156 flex-direction : column;
157157 justify-content : center;
158158 touch-action : none;
159- cursor : pointer;
160159 color : var (--font-primary );
161160 font-family : 'AppleSDGothicNeo' ;
162161
180179 overflow : hidden;
181180 border : 2px solid transparent;
182181 border-radius : 2px ;
182+ cursor : pointer;
183183}
184184.vp-block-left-holder {
185185 display : none;
197197 position : absolute;
198198 left : 0px ;
199199 color : rgba (0 , 0 , 0 , 0.3 );
200+ cursor : default;
200201}
201202.vp-block-num-info {
202203 color : # 828282 ;
Original file line number Diff line number Diff line change 115115 height : 50px ;
116116}
117117.vp-popup-button [data-type = "code" ] {
118- position : absolute ;
119- left : 15 px ;
120- top : 9 px ;
118+ float : left ;
119+ margin-top : 9 px ;
120+ margin-left : 10 px ;
121121}
122122.vp-popup-button [data-type = "data" ] {
123- position : absolute ;
124- left : 102 px ;
125- top : 9 px ;
123+ float : left ;
124+ margin-top : 9 px ;
125+ margin-left : 10 px ;
126126}
127127.vp-popup-button [data-type = "cancel" ] {
128- position : absolute ;
128+ float : right ;
129129 background-color : # E4E4E4 ;
130- top : 9px ;
131- right : 106 px ;
130+ margin- top: 9px ;
131+ margin- right: 10 px ;
132132}
133133.vp-popup-runadd-box {
134- position : absolute;
135- top : 9px ;
136- right : 15px ;
134+ float : right;
137135 width : fit-content;
138136 height : 30px ;
139137 background : # F38504 ;
140138 border-radius : 2px ;
139+ margin-top : 9px ;
140+ margin-right : 10px ;
141141}
142142.vp-popup-button [data-type = "run" ] {
143143 display : inline-block;
157157 background : white;
158158 border : 0.25px solid var (--border-gray-color );
159159 position : absolute;
160- bottom : 35 px ;
161- right : 0 px ;
160+ bottom : 45 px ;
161+ right : 10 px ;
162162 width : 120px ;
163163 text-align : center;
164164 line-height : 30px ;
172172 background : var (--light-gray-color );
173173}
174174.vp-popup-save-button {
175- position : absolute;
176- top : 9px ;
177- right : 15px ;
175+ float : right;
178176 height : 30px ;
177+ width : 100px ;
178+ margin-top : 9px ;
179+ margin-right : 10px ;
179180}
180181/* writable codemirror style*/
181182/* Code Option Codemirror */
Original file line number Diff line number Diff line change 384384 "type" : " function" ,
385385 "level" : 1 ,
386386 "name" : " elif" ,
387- "tag" : " ELSE ,LOGIC" ,
387+ "tag" : " ELIF ,LOGIC" ,
388388 "path" : " visualpython - logic - control - elif" ,
389389 "desc" : " elif" ,
390390 "file" : " m_logic/Elif" ,
Original file line number Diff line number Diff line change @@ -5119,7 +5119,7 @@ define([
51195119 name : 'Plot' ,
51205120 library : 'pandas' ,
51215121 description : 'create chart' ,
5122- code : '${o0} = ${i0}.plot(${v}${etc})' ,
5122+ code : '${o0} = ${i0}.plot(${v}${etc})\nplt.show() ' ,
51235123 input : [
51245124 {
51255125 name : 'i0' ,
Original file line number Diff line number Diff line change 5151 < button type ="button " class ="vp-button vp-popup-button " data-type ="code "> Code view</ button >
5252 < button type ="button " class ="vp-button vp-popup-button " data-type ="data "> Data view</ button >
5353
54- < button type ="button " class ="vp-button vp-popup-button " data-type ="cancel "> Cancel</ button >
5554 < div class ="vp-popup-runadd-box ">
5655 < button type ="button " class ="vp-button activated vp-popup-button " data-type ="run " title ="Save to block & Run cell "> Run</ button >
5756 < button type ="button " class ="vp-button activated vp-popup-button " data-type ="show-detail "> < img src ="/nbextensions/visualpython/img/arrow_short_up.svg "/> </ button >
6059 < div class ="vp-popup-detail-button " data-type ="add " title ="Save to block & Add cell "> Code to cell</ div >
6160 </ div >
6261 </ div >
63- < button type ="button " class ="vp-button activated vp-popup-button vp-popup-save-button " data-type ="save " title ="Save to block " style ="display:none; "> Save</ button >
62+ < button type ="button " class ="vp-button activated vp-popup-button vp-popup-save-button " data-type ="save " title ="Save to block " style ="display:none; "> Save to block</ button >
63+ < button type ="button " class ="vp-button vp-popup-button " data-type ="cancel "> Cancel</ button >
6464 </ div >
6565 </ div >
6666 </ div >
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ define([
7474 // run button
7575 sbBlockMenu . appendLine ( '<div id="vp_block_menu_run" class="vp-block-menu-item">Run</div>' ) ;
7676 // add button
77- sbBlockMenu . appendLine ( '<div id="vp_block_menu_add" class="vp-block-menu-item">Add </div>' ) ;
77+ sbBlockMenu . appendLine ( '<div id="vp_block_menu_add" class="vp-block-menu-item">Code to cell </div>' ) ;
7878 // duplicate button
7979 sbBlockMenu . appendLine ( '<div id="vp_block_menu_duplicate" class="vp-block-menu-item">Duplicate</div>' ) ;
8080 // delete button
Original file line number Diff line number Diff line change @@ -90,7 +90,17 @@ define([], function() {
9090 ' except ValueError:' ,
9191 ' return 0.0'
9292 ]
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+ ]
94104 }
95105
96106 this . data = {
@@ -165,7 +175,8 @@ define([], function() {
165175 Jupyter . notebook . config . loaded . then ( function ( ) {
166176 var data = Jupyter . notebook . config . data [ configKey ] ;
167177 if ( data == undefined ) {
168- data = { } ;
178+ reject ( 'No data available.' ) ;
179+ return ;
169180 }
170181 if ( dataKey == '' ) {
171182 resolve ( data ) ;
@@ -184,7 +195,7 @@ define([], function() {
184195 Jupyter . notebook . config . load ( ) ;
185196 var data = Jupyter . notebook . config . data [ configKey ] ;
186197 if ( data == undefined ) {
187- data = { } ;
198+ return undefined ;
188199 }
189200 if ( dataKey == '' ) {
190201 return data ;
Original file line number Diff line number Diff line change @@ -433,6 +433,14 @@ define([
433433 if ( callback ) {
434434 callback ( varObj ) ;
435435 }
436+ } ) . catch ( function ( resultObj ) {
437+ let { result } = resultObj ;
438+ // show alert
439+ com_util . renderAlertModal ( result . ename + ': ' + result . evalue ) ;
440+ // callback
441+ if ( callback ) {
442+ callback ( '' ) ;
443+ }
436444 } ) ;
437445
438446
Original file line number Diff line number Diff line change @@ -435,10 +435,6 @@ define([
435435 }
436436 if ( ! dataview ) {
437437 $ ( this . wrapSelector ( '.vp-popup-button[data-type="data"]' ) ) . hide ( ) ;
438- } else {
439- if ( ! codeview ) {
440- $ ( this . wrapSelector ( '.vp-popup-button[data-type="data"]' ) ) . css ( { left : '15px' , top : '9px' } ) ;
441- }
442438 }
443439
444440 // footer
Original file line number Diff line number Diff line change 238238 if ( cfg . vp_section_display && vpFrame ) {
239239 vpFrame . openVp ( ) ;
240240 }
241+
242+ // Operations on kernel restart
243+ events . on ( 'kernel_ready.Kernel' , function ( evt , info ) {
244+ vpLog . display ( VP_LOG_TYPE . LOG , 'vp operations for kernel ready...' ) ;
245+ // read vp functions
246+ _readKernelFunction ( ) ;
247+ } ) ;
241248 }
242249
243250 return { initVisualpython : initVisualpython , readConfig : readConfig } ;
You can’t perform that action at this time.
0 commit comments