Skip to content

Release v2.0.1 #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion css/boardFrame.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
flex-direction: column;
justify-content: center;
touch-action: none;
cursor: pointer;
color: var(--font-primary);
font-family: 'AppleSDGothicNeo';

Expand All @@ -180,6 +179,7 @@
overflow: hidden;
border: 2px solid transparent;
border-radius: 2px;
cursor: pointer;
}
.vp-block-left-holder {
display: none;
Expand All @@ -197,6 +197,7 @@
position: absolute;
left: 0px;
color: rgba(0,0,0,0.3);
cursor: default;
}
.vp-block-num-info {
color: #828282;
Expand Down
35 changes: 18 additions & 17 deletions css/popupComponent.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,29 +115,29 @@
height: 50px;
}
.vp-popup-button[data-type="code"] {
position: absolute;
left: 15px;
top: 9px;
float: left;
margin-top: 9px;
margin-left: 10px;
}
.vp-popup-button[data-type="data"] {
position: absolute;
left: 102px;
top: 9px;
float: left;
margin-top: 9px;
margin-left: 10px;
}
.vp-popup-button[data-type="cancel"] {
position: absolute;
float: right;
background-color: #E4E4E4;
top: 9px;
right: 106px;
margin-top: 9px;
margin-right: 10px;
}
.vp-popup-runadd-box {
position: absolute;
top: 9px;
right: 15px;
float: right;
width: fit-content;
height: 30px;
background: #F38504;
border-radius: 2px;
margin-top: 9px;
margin-right: 10px;
}
.vp-popup-button[data-type="run"] {
display: inline-block;
Expand All @@ -157,8 +157,8 @@
background: white;
border: 0.25px solid var(--border-gray-color);
position: absolute;
bottom: 35px;
right: 0px;
bottom: 45px;
right: 10px;
width: 120px;
text-align: center;
line-height: 30px;
Expand All @@ -172,10 +172,11 @@
background: var(--light-gray-color);
}
.vp-popup-save-button {
position: absolute;
top: 9px;
right: 15px;
float: right;
height: 30px;
width: 100px;
margin-top: 9px;
margin-right: 10px;
}
/* writable codemirror style*/
/* Code Option Codemirror */
Expand Down
2 changes: 1 addition & 1 deletion data/libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
"type" : "function",
"level": 1,
"name" : "elif",
"tag" : "ELSE,LOGIC",
"tag" : "ELIF,LOGIC",
"path" : "visualpython - logic - control - elif",
"desc" : "elif",
"file" : "m_logic/Elif",
Expand Down
2 changes: 1 addition & 1 deletion data/m_library/pandasLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -5119,7 +5119,7 @@ define([
name: 'Plot',
library: 'pandas',
description: 'create chart',
code: '${o0} = ${i0}.plot(${v}${etc})',
code: '${o0} = ${i0}.plot(${v}${etc})\nplt.show()',
input: [
{
name: 'i0',
Expand Down
4 changes: 2 additions & 2 deletions html/popupComponent.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<button type="button" class="vp-button vp-popup-button" data-type="code">Code view</button>
<button type="button" class="vp-button vp-popup-button" data-type="data">Data view</button>

<button type="button" class="vp-button vp-popup-button" data-type="cancel">Cancel</button>
<div class="vp-popup-runadd-box">
<button type="button" class="vp-button activated vp-popup-button" data-type="run" title="Save to block & Run cell">Run</button>
<button type="button" class="vp-button activated vp-popup-button" data-type="show-detail"><img src="/nbextensions/visualpython/img/arrow_short_up.svg"/></button>
Expand All @@ -60,7 +59,8 @@
<div class="vp-popup-detail-button" data-type="add" title="Save to block & Add cell">Code to cell</div>
</div>
</div>
<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>
<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>
<button type="button" class="vp-button vp-popup-button" data-type="cancel">Cancel</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion js/board/BlockMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ define([
// run button
sbBlockMenu.appendLine('<div id="vp_block_menu_run" class="vp-block-menu-item">Run</div>');
// add button
sbBlockMenu.appendLine('<div id="vp_block_menu_add" class="vp-block-menu-item">Add</div>');
sbBlockMenu.appendLine('<div id="vp_block_menu_add" class="vp-block-menu-item">Code to cell</div>');
// duplicate button
sbBlockMenu.appendLine('<div id="vp_block_menu_duplicate" class="vp-block-menu-item">Duplicate</div>');
// delete button
Expand Down
17 changes: 14 additions & 3 deletions js/com/com_Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,17 @@ define([], function() {
' except ValueError:',
' return 0.0'
]
}
},
'vpimport': [
{ library: 'numpy', alias:'np' },
{ library: 'pandas', alias:'pd' },
{ library: 'matplotlib.pyplot', alias:'plt',
include: [
'%matplotlib inline'
]
},
{ library: 'seaborn', alias:'sns' }
]
}

this.data = {
Expand Down Expand Up @@ -165,7 +175,8 @@ define([], function() {
Jupyter.notebook.config.loaded.then(function() {
var data = Jupyter.notebook.config.data[configKey];
if (data == undefined) {
data = {};
reject('No data available.');
return;
}
if (dataKey == '') {
resolve(data);
Expand All @@ -184,7 +195,7 @@ define([], function() {
Jupyter.notebook.config.load();
var data = Jupyter.notebook.config.data[configKey];
if (data == undefined) {
data = {};
return undefined;
}
if (dataKey == '') {
return data;
Expand Down
2 changes: 1 addition & 1 deletion js/com/com_Const.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define ([
class Constants { }

Constants.TOOLBAR_BTN_INFO = {
HELP: "Visual Python 2.0.0"
HELP: "Visual Python 2.0.1"
, ICON: "vp-main-icon"
, ID: "vpBtnToggle"
, NAME: "toggle-vp"
Expand Down
8 changes: 8 additions & 0 deletions js/com/component/InstanceEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,14 @@ define([
if (callback) {
callback(varObj);
}
}).catch(function(resultObj) {
let { result } = resultObj;
// show alert
com_util.renderAlertModal(result.ename + ': ' + result.evalue);
// callback
if (callback) {
callback('');
}
});


Expand Down
4 changes: 0 additions & 4 deletions js/com/component/PopupComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,6 @@ define([
}
if (!dataview) {
$(this.wrapSelector('.vp-popup-button[data-type="data"]')).hide();
} else {
if (!codeview) {
$(this.wrapSelector('.vp-popup-button[data-type="data"]')).css({left: '15px', top: '9px'});
}
}

// footer
Expand Down
7 changes: 7 additions & 0 deletions js/loadVisualpython.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@
if (cfg.vp_section_display && vpFrame) {
vpFrame.openVp();
}

// Operations on kernel restart
events.on('kernel_ready.Kernel', function (evt, info) {
vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...');
// read vp functions
_readKernelFunction();
});
}

return { initVisualpython: initVisualpython, readConfig: readConfig };
Expand Down
2 changes: 1 addition & 1 deletion js/m_apps/Import.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ define([
page.appendLine('</tr></thead>');
page.appendLine('<tbody>');
let that = this;
this.state.importMeta.forEach((lib, idx) => {
this.state.importMeta && this.state.importMeta.forEach((lib, idx) => {
page.appendLine(that.templateForLibrary(idx, lib.library, lib.alias));
});
page.appendLine('</tbody>');
Expand Down
19 changes: 19 additions & 0 deletions js/m_apps/Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ define([
let component = evt.component;
component.close();
});
$(this.wrapSelector('#vp_instanceVariable')).on('focus_option_page', function(evt) {
let component = evt.component;
component.focus();
});
$(this.wrapSelector('#vp_instanceVariable')).on('apply_option_page', function(evt) {
let component = evt.component;
// apply its value
Expand Down Expand Up @@ -219,6 +223,21 @@ define([
return sbCode.toString();
}

hide() {
super.hide();
this.state.subsetEditor && this.state.subsetEditor.hide();
}

close() {
super.close();
this.state.subsetEditor && this.state.subsetEditor.close();
}

remove() {
super.remove();
this.state.subsetEditor && this.state.subsetEditor.remove();
}

updateValue(value) {
let cmObj = this.getCodemirror('vp_instanceVariable');
if (cmObj && cmObj.cm) {
Expand Down
1 change: 1 addition & 0 deletions js/m_apps/Snippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ define([

com_util.renderSuccessMessage('Default snippets imported');
}
$(that.wrapSelector('.vp-sn-menu-box')).hide();
evt.stopPropagation();
});

Expand Down
Loading