Skip to content

Devops #23(proceed), #22(closed) #27

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 4 commits into from
May 17, 2021
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
8 changes: 4 additions & 4 deletions data/libraries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,11 @@
<path aa="AA">visualpython - numpy</path>
<desc>Numpy 패키지 라이브러리</desc>

<item id="np_importNumpy" type="function" level="1" name="import" tag="넘파이, IMPORT NUMPY">
<!-- <item id="np_importNumpy" type="function" level="1" name="import" tag="넘파이, IMPORT NUMPY">
<path>visualpython - numpy - import numpy</path>
<desc>Import Numpy</desc>
<file>numpy/pageList/numpyImport/numpyImport.js</file>
</item>
</item> -->

<item id="pkg_arrayCreation" type="package" level="1" name="Array creation" tag="넘파이, NUMPY, FUNCTION">
<path aa="AA">visualpython - numpy - array creation</path>
Expand Down Expand Up @@ -1210,11 +1210,11 @@
<desc>변수 조회해서 복사하는 화면</desc>
<file>pandas/variables.js</file>
</item> -->
<item id="pd_importPandas" type="function" level="1" name="import" tag="판다스, IMPORT PANDAS">
<!-- <item id="pd_importPandas" type="function" level="1" name="import" tag="판다스, IMPORT PANDAS">
<path>visualpython - pandas - import pandas</path>
<desc>Import Pandas</desc>
<file>pandas/import.js</file>
</item>
</item> -->
<!-- plotting -->
<item id="pd_plot" type="function" level="1" name="plot" tag="차트 그리기, PLOT, DRAW CHART FOR PANDAS, PLOT">
<path>visualpython - pandas - plot</path>
Expand Down
5 changes: 5 additions & 0 deletions src/api_block/blockContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 {
Expand Down
12 changes: 8 additions & 4 deletions src/common/component/vpVarSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}

Expand Down
71 changes: 40 additions & 31 deletions src/common/vpSubsetEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down