diff --git a/data/libraries.xml b/data/libraries.xml
index 4b39581e..574a765e 100644
--- a/data/libraries.xml
+++ b/data/libraries.xml
@@ -616,11 +616,11 @@
visualpython - numpy
Numpy 패키지 라이브러리
- -
+
-
visualpython - numpy - array creation
@@ -1210,11 +1210,11 @@
변수 조회해서 복사하는 화면
pandas/variables.js
-->
- -
+
-
visualpython - pandas - plot
diff --git a/src/api_block/blockContainer.js b/src/api_block/blockContainer.js
index 4988fd64..49fecbb1 100644
--- a/src/api_block/blockContainer.js
+++ b/src/api_block/blockContainer.js
@@ -285,6 +285,10 @@ define([
// re-render block header
var codeLineStr = block.getNowCodeLine();
block.writeCode(codeLineStr);
+ this.resetBlockList();
+ this.resetOptionPage();
+ this.reRenderAllBlock_asc();
+
} else {
// blockList에 없으면, 삭제
block.deleteBlock_childBlockList();
@@ -349,6 +353,7 @@ define([
block.isModified = true;
} else {
$(VP_CLASS_PREFIX + 'vp-apiblock-option-new-to-save').css('display', 'none');
+ block.isModified = false;
}
}
} else {
diff --git a/src/common/component/vpVarSelector.js b/src/common/component/vpVarSelector.js
index 17c3936d..ba189f25 100644
--- a/src/common/component/vpVarSelector.js
+++ b/src/common/component/vpVarSelector.js
@@ -131,10 +131,14 @@ define([
// load using kernel
var dataTypes = this.showOthers? []: this.dataTypes;
kernelApi.searchVarList(dataTypes, function(result) {
- var varList = JSON.parse(result);
- that.state.varList = varList;
- // render variable list
- that.loadVariableList(varList);
+ try {
+ var varList = JSON.parse(result);
+ that.state.varList = varList;
+ // render variable list
+ that.loadVariableList(varList);
+ } catch (ex) {
+ console.log(ex);
+ }
});
}
diff --git a/src/common/vpSubsetEditor.js b/src/common/vpSubsetEditor.js
index 3351d051..6244a41c 100644
--- a/src/common/vpSubsetEditor.js
+++ b/src/common/vpSubsetEditor.js
@@ -150,28 +150,6 @@ define([
this.bindEvent();
this.init();
- // set codemirror
- this.codepreview = codemirror.fromTextArea($('#vp_previewCode')[0], {
- mode: {
- name: 'python',
- version: 3,
- singleLineStringErrors: false
- }, // text-cell(markdown cell) set to 'htmlmixed'
- height: '100%',
- width: '100%',
- indentUnit: 4,
- matchBrackets: true,
- readOnly:true,
- autoRefresh: true,
- // lineWrapping: false, // text-cell(markdown cell) set to true
- // indentWithTabs: true,
- theme: "ipython",
- extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"},
- scrollbarStyle: "null"
- });
- this.setPreview('# Code Preview');
-
-
// set readonly
if (useInputVariable) {
$(this.wrapSelector('.' + VP_DS_PANDAS_OBJECT)).attr('disabled', true);
@@ -384,7 +362,7 @@ define([
* Wrap Selector for data selector popup with its uuid
* @param {string} query
*/
- SubsetEditor.prototype.wrapSelector = function(query) {
+ SubsetEditor.prototype.wrapSelector = function(query = '') {
return vpCommon.formatString('.{0}.{1} {2}', VP_DS, this.uuid, query);
}
@@ -1644,17 +1622,46 @@ define([
* open popup
*/
SubsetEditor.prototype.open = function() {
+ if (!this.codepreview) {
+ // var previewTextarea = $('#vp_previewCode')[0];
+ var previewTextarea = $(this.wrapSelector('#vp_previewCode'))[0];
+ // if (wrappedTextarea) {
+ // previewTextarea = wrappedTextarea;
+ // }
+ // set codemirror
+ this.codepreview = codemirror.fromTextArea(previewTextarea, {
+ mode: {
+ name: 'python',
+ version: 3,
+ singleLineStringErrors: false
+ }, // text-cell(markdown cell) set to 'htmlmixed'
+ height: '100%',
+ width: '100%',
+ indentUnit: 4,
+ matchBrackets: true,
+ readOnly:true,
+ autoRefresh: true,
+ // lineWrapping: false, // text-cell(markdown cell) set to true
+ // indentWithTabs: true,
+ theme: "ipython",
+ extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"},
+ scrollbarStyle: "null"
+ });
+ this.setPreview('# Code Preview');
+ }
+ this.codepreview.refresh();
+
// reload pandasObject on open
this.loadVariables();
- $(vpCommon.formatString(".{0}.{1}", VP_DS, this.uuid)).show();
+ $(this.wrapSelector()).show();
}
/**
* close popup
*/
SubsetEditor.prototype.close = function() {
- $(vpCommon.formatString(".{0}.{1}", VP_DS, this.uuid)).hide();
+ $(this.wrapSelector()).hide();
}
SubsetEditor.prototype.hideButton = function() {
@@ -1908,12 +1915,14 @@ define([
}
SubsetEditor.prototype.setPreview = function(previewCodeStr) {
- this.codepreview.setValue(previewCodeStr);
- this.codepreview.save();
- var that = this;
- setTimeout(function() {
- that.codepreview.refresh();
- }, 1);
+ if (this.codepreview) {
+ this.codepreview.setValue(previewCodeStr);
+ this.codepreview.save();
+ var that = this;
+ setTimeout(function() {
+ that.codepreview.refresh();
+ }, 1);
+ }
}
return SubsetEditor