From 8c504df7826a4169eac0d93281dd6f15fbf7f2ec Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Tue, 2 Nov 2021 11:03:46 +0900 Subject: [PATCH 01/14] File - read_csv encoding option added --- src/pandas/common/commonPandas.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pandas/common/commonPandas.js b/src/pandas/common/commonPandas.js index 760473dd..ba3391fc 100644 --- a/src/pandas/common/commonPandas.js +++ b/src/pandas/common/commonPandas.js @@ -151,6 +151,11 @@ define([ } ], variable: [ + { + name: 'encoding', + type: 'text', + label: 'Encoding' + }, { name:'names', type:'list', From 0bb86981c1b5c1a8d3655ffb392ef2185ea6b4b9 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Tue, 2 Nov 2021 11:04:13 +0900 Subject: [PATCH 02/14] Pandas options - key is now showing on label hover --- src/pandas/common/pandasGenerator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pandas/common/pandasGenerator.js b/src/pandas/common/pandasGenerator.js index 32a447cd..5aad281c 100644 --- a/src/pandas/common/pandasGenerator.js +++ b/src/pandas/common/pandasGenerator.js @@ -108,10 +108,10 @@ define([ var requiredFontStyle = required? vpConst.COLOR_FONT_ORANGE : ''; $(lbl).attr({ 'for': obj.name, - 'class': requiredFontStyle + 'class': requiredFontStyle, + 'title': '(' + obj.name + ')' }); - // lbl.innerText = (required? '* ':'') + obj.label + (showKey?' ('+obj.name+')':''); - lbl.innerText = obj.label + (showKey?' ('+obj.name+')':''); + lbl.innerText = obj.label; tblLabel.appendChild(lbl); // 명시된 component에 맞는 태그 구성해서 붙여주기 From 7a7a92c509b73e1516eb2b2d3260442daa464f08 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Tue, 2 Nov 2021 12:12:48 +0900 Subject: [PATCH 03/14] Variable - variable box scrollable --- css/file_io/variables.css | 13 +++++++++---- src/file_io/variables.html | 20 +++++++++++++++----- src/file_io/variables.js | 6 ++---- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/css/file_io/variables.css b/css/file_io/variables.css index 107e49b0..bc277f11 100644 --- a/css/file_io/variables.css +++ b/css/file_io/variables.css @@ -1,14 +1,20 @@ :root { --color: #525252; } -#vp_var_variableBox table tr:not(:first-child):hover, -#vp_var_variableBox table tr.selected { +#vp_var_variableBox table tbody tr:hover, +#vp_var_variableBox table tbody tr.selected { color: var(--font-hightlight); background-color: #F5F5F5; } -#vp_var_variableBox table tr td:first-child:hover { +#vp_var_variableBox table tbody tr td:hover { cursor: pointer; } +#vp_var_variableBox table thead { + position: sticky; + top: 0; + background: white; +} + #vp_varDetailTable table th, #vp_varDetailTable table td { padding: 5px; @@ -25,7 +31,6 @@ #vp_var_variableBox { width: 100%; height: 150px; - overflow: hidden; } #vp_varDetailTable:empty::after { content: '(Select variables to preview the data.)'; diff --git a/src/file_io/variables.html b/src/file_io/variables.html index 87c3252f..a6a45dc1 100644 --- a/src/file_io/variables.html +++ b/src/file_io/variables.html @@ -1,11 +1,21 @@
-
+
- - - - + + + + + + + + +
Variable NameData Type
+ Variable Name + + + Data Type +

diff --git a/src/file_io/variables.js b/src/file_io/variables.js index bc71d8f8..d74a9455 100644 --- a/src/file_io/variables.js +++ b/src/file_io/variables.js @@ -63,8 +63,6 @@ define([ this.package = libPandas._PANDAS_FUNCTION[funcOptProp.libID]; } - - /** * Extend vpFuncJS */ @@ -135,13 +133,13 @@ define([ , 'str', 'int', 'float', 'bool', 'dict', 'list', 'tuple' ]; - var tagTable = this.wrapSelector('#vp_var_variableBox table'); + var tagTable = this.wrapSelector('#vp_var_variableBox table tbody'); // variable list table var tagDetailTable = this.wrapSelector("#vp_varDetailTable"); // initialize tags - $(tagTable).find('tr:not(:first)').remove(); + $(tagTable).find('tr').remove(); $(tagDetailTable).html(''); // HTML rendering From 2092ba3a51e855037c351fe4f1e7313574fbd2a2 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Tue, 2 Nov 2021 17:12:00 +0900 Subject: [PATCH 04/14] Frame - column height issue fixed --- css/common/frameEditor.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/css/common/frameEditor.css b/css/common/frameEditor.css index d4d67a18..e0f7dec9 100644 --- a/css/common/frameEditor.css +++ b/css/common/frameEditor.css @@ -190,6 +190,13 @@ top: 0; background: #FFFFFF; border-bottom: 1px solid #E4E4E4; + + text-align: right; + text-overflow: ellipsis; + overflow: hidden; + height: 30px !important; + min-width: 80px; + white-space: nowrap; } .vp-fe-table tbody tr:nth-child(odd) { background: #F5F5F5; @@ -223,6 +230,10 @@ width: 100%; z-index: -1; } */ +.vp-fe-table tr th:nth-child(1), +.vp-fe-add-column { + min-width: 30px !important; +} .vp-fe-table-more { margin-top: 10px; From a5f73e9e533f78345eefadbb66f828cc0766ff12 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 10:39:50 +0900 Subject: [PATCH 05/14] File - read_csv encoding options will be suggested --- src/file_io/fileio.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/file_io/fileio.js b/src/file_io/fileio.js index 4ca46df1..1af484d3 100644 --- a/src/file_io/fileio.js +++ b/src/file_io/fileio.js @@ -7,8 +7,9 @@ define([ , 'nbextensions/visualpython/src/common/vpFuncJS' , 'nbextensions/visualpython/src/pandas/common/commonPandas' , 'nbextensions/visualpython/src/pandas/common/pandasGenerator' + , 'nbextensions/visualpython/src/common/component/vpSuggestInputText' , 'nbextensions/visualpython/src/pandas/fileNavigation/index' -], function (requirejs, $, vpCommon, vpConst, sb, vpFuncJS, libPandas, pdGen, fileNavigation) { +], function (requirejs, $, vpCommon, vpConst, sb, vpFuncJS, libPandas, pdGen, vpSuggestInputText, fileNavigation) { // 옵션 속성 const funcOptProp = { stepCount : 1 @@ -350,6 +351,18 @@ define([ ); } + // encoding suggest input + $(this.wrapSelector('#encoding')).replaceWith(function() { + // encoding list : utf8 cp949 ascii + var encodingList = ['utf8', 'cp949', 'ascii']; + var suggestInput = new vpSuggestInputText.vpSuggestInputText(); + suggestInput.setComponentID('encoding'); + suggestInput.addClass('vp-input'); + suggestInput.setSuggestList(function() { return encodingList; }); + suggestInput.setPlaceholder('encoding option'); + return suggestInput.toTagString(); + }); + } From 5c75d2c27ef4039fa76f467741cc41804552033b Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 15:06:39 +0900 Subject: [PATCH 06/14] fix python - open --- src/python_common/open.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/python_common/open.js b/src/python_common/open.js index 10a28170..7ed0f98f 100644 --- a/src/python_common/open.js +++ b/src/python_common/open.js @@ -7,7 +7,7 @@ define([ , 'nbextensions/visualpython/src/common/vpFuncJS' , 'nbextensions/visualpython/src/common/component/vpSuggestInputText' , 'nbextensions/visualpython/src/pandas/common/pandasGenerator' - , 'nbextensions/visualpython/src/component/fileNavigation/index' + , 'nbextensions/visualpython/src/pandas/fileNavigation/index' ], function (requirejs, $, vpCommon, vpConst, sb, vpFuncJS, vpSuggestInputText, pdGen, fileNavigation) { // 옵션 속성 const funcOptProp = { @@ -140,7 +140,7 @@ define([ sbTagString.clear(); sbTagString.appendFormat('', 'vp_pyReturn', 'vp-input'); - tblLayoutRequire.addRow("Allocate toto", sbTagString.toString()); + tblLayoutRequire.addRow("Allocate to", sbTagString.toString()); sbTagString.clear(); sbTagString.appendFormat('', 'vp_pyBuffering', 'vp-input'); tblLayoutAdditional.addRow("Buffering", sbTagString.toString()); - sbTagString.clear(); - sbTagString.appendFormat('', 'vp_pyEncoding', 'vp-input'); - tblLayoutAdditional.addRow("Encoding", sbTagString.toString()); + // encoding list : utf8 cp949 ascii + var encodingList = ['utf8', 'cp949', 'ascii']; + var suggestInput = new vpSuggestInputText.vpSuggestInputText(); + suggestInput.setComponentID('vp_pyEncoding'); + suggestInput.addClass('vp-input'); + suggestInput.setSuggestList(function() { return encodingList; }); + suggestInput.setPlaceholder('encoding option'); + tblLayoutAdditional.addRow("Encoding", suggestInput.toTagString()); sbTagString.clear(); // sbTagString.appendFormat('', 'vp_pyErrors', 'vp-input'); From 354ccac485bde8bb3248694e630dd6b1d54b8452 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 15:12:43 +0900 Subject: [PATCH 07/14] Frame Editor - popup rename, replace scrollbar fixed --- css/common/frameEditor.css | 8 +++++++- src/common/vpFrameEditor.js | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/css/common/frameEditor.css b/css/common/frameEditor.css index e0f7dec9..3accb36f 100644 --- a/css/common/frameEditor.css +++ b/css/common/frameEditor.css @@ -375,7 +375,7 @@ padding: 10px; } .vp-popup-addpage .vp-popup-tab.replace { - height: calc(100% - 50px); + height: calc(100% - 60px); } .vp-popup-addtype { width: 153px; @@ -384,6 +384,12 @@ .vp-popup-delete { padding-bottom: 20px; } +.vp-popup-rename-page { + max-height: 400px; +} +.vp-popup-replace-table { + max-height: 350px; +} .vp-popup-replace-add { margin-top: 30px } diff --git a/src/common/vpFrameEditor.js b/src/common/vpFrameEditor.js index bde97f12..e094cddf 100644 --- a/src/common/vpFrameEditor.js +++ b/src/common/vpFrameEditor.js @@ -638,6 +638,7 @@ define([ FrameEditor.prototype.renderRenamePage = function() { var content = new sb.StringBuilder(); + content.appendFormatLine('
', 'vp-popup-rename-page', 'vp-scrollbar'); content.appendLine(''); content.appendLine(''); this.state.selected.forEach((col, idx) => { @@ -648,6 +649,7 @@ define([ content.appendLine(''); }); content.appendLine('
'); + content.appendLine('
'); return content.toString(); } @@ -655,10 +657,12 @@ define([ var content = new sb.StringBuilder(); content.appendFormatLine('', 'vp-popup-use-regex', 'Use Regular Expression'); content.appendLine('

'); - content.appendFormatLine('', 'vp-popup-replace-table'); + content.appendFormatLine('
', 'vp-popup-replace-table'); + content.appendLine('
'); content.appendLine(this.renderReplaceInput(0)); content.appendFormatLine('', 'vp-button', 'vp-popup-replace-add', '+ Add Key'); content.appendLine('
'); + content.appendLine('
'); return content.toString(); } From 12ec20be2a636aca1c0c33983cf0a0bfbb7571b4 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 15:13:12 +0900 Subject: [PATCH 08/14] FileNavigation - height control on long file path --- css/component/common.css | 3 +++ css/component/fileNavigation.css | 12 +++++++----- src/component/fileNavigation/index.html | 4 ++-- src/pandas/fileNavigation/index.html | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/css/component/common.css b/css/component/common.css index 47eb8723..520d4b6d 100644 --- a/css/component/common.css +++ b/css/component/common.css @@ -84,6 +84,9 @@ .wp50 { width: 50px; } +.wp60 { + width: 60px; +} .wp80 { width: 80px; } diff --git a/css/component/fileNavigation.css b/css/component/fileNavigation.css index d1705832..ca482c0a 100644 --- a/css/component/fileNavigation.css +++ b/css/component/fileNavigation.css @@ -47,7 +47,8 @@ .fileNavigationPage-inner { float: right; display: grid; - grid-template-rows: 30px auto min-content; + /* grid-template-rows: 30px auto min-content; */ + grid-template-rows: min-content auto min-content; width: 80%; height: 100%; } @@ -107,7 +108,8 @@ } .fileNavigationPage-menu { min-height: 30px; - height: 6%; + /* height: 6%; */ + height: fit-content; padding-left: 10px; background-color: #EEE; border: 1px solid #ddd;; @@ -127,7 +129,7 @@ justify-content: center; } .fileNavigationPage-menu-block { - margin-left: 10px; + padding: 0 35px 0 10px; display: flex; flex-direction: column; justify-content: center; @@ -192,11 +194,11 @@ .fileNavigationPage-closedBtn { position: fixed; z-index: 3; - right: 5px; + right: 10px; width: 20px; height: 20px; line-height: 20px; - top: 5px; + top: 3px; text-align: center; } .fileNavigationPage-closedBtn:hover { diff --git a/src/component/fileNavigation/index.html b/src/component/fileNavigation/index.html index cd8e7efe..5711059a 100644 --- a/src/component/fileNavigation/index.html +++ b/src/component/fileNavigation/index.html @@ -16,7 +16,7 @@ style='display: flex; flex-direction: column; justify-content: center;'> -
+
-
X
+
diff --git a/src/pandas/fileNavigation/index.html b/src/pandas/fileNavigation/index.html index d3ecef42..7da1df5e 100644 --- a/src/pandas/fileNavigation/index.html +++ b/src/pandas/fileNavigation/index.html @@ -13,7 +13,7 @@
-
+
-
X
+
From 578db8f42407889139a06a2a6fa252acfc382169 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 16:46:14 +0900 Subject: [PATCH 09/14] Frame - save scroll position after clicking More.. --- src/common/vpFrameEditor.js | 158 ++++++++++++++++++++++++------------ 1 file changed, 104 insertions(+), 54 deletions(-) diff --git a/src/common/vpFrameEditor.js b/src/common/vpFrameEditor.js index e094cddf..c7ba8b86 100644 --- a/src/common/vpFrameEditor.js +++ b/src/common/vpFrameEditor.js @@ -1174,7 +1174,7 @@ define([ return code.toString(); } - FrameEditor.prototype.loadCode = function(codeStr) { + FrameEditor.prototype.loadCode = function(codeStr, more=false) { if (this.loading) { return; } @@ -1182,10 +1182,16 @@ define([ var that = this; var tempObj = this.state.tempObj; var lines = this.state.lines; + var prevLines = 0; + var scrollPos = -1; + if (more) { + prevLines = that.state.indexList.length; + scrollPos = $(this.wrapSelector('.vp-fe-table')).scrollTop(); + } var code = new sb.StringBuilder(); code.appendLine(codeStr); - code.appendFormat("{0}.head({1}).to_json(orient='{2}')", tempObj, lines, 'split'); + code.appendFormat("{0}[{1}:{2}].to_json(orient='{3}')", tempObj, prevLines, lines, 'split'); this.loading = true; kernelApi.executePython(code.toString(), function(result) { @@ -1197,62 +1203,101 @@ define([ // var columnList = data.columns; var indexList = data.index; var dataList = data.data; + + columnList = columnList.map(col => { return { label: col.label, type: col.dtype, code: col.value } }); + indexList = indexList.map(idx => { return { label: idx, code: idx } }); - that.state.columnList = columnList.map(col => { return { label: col.label, type: col.dtype, code: col.value } }); - that.state.indexList = indexList.map(idx => { return { label: idx, code: idx } }); - - // table - var table = new sb.StringBuilder(); - // table.appendFormatLine('', 1, 'dataframe'); - table.appendLine(''); - table.appendLine(''); - that.state.columnList && that.state.columnList.forEach(col => { - var colCode = col.code; - var colClass = ''; - if (that.state.axis == FRAME_AXIS.COLUMN && that.state.selected.map(col=>col.code).includes(colCode)) { - colClass = 'selected'; - } - table.appendFormatLine('' - , colCode, FRAME_AXIS.COLUMN, col.type, VP_FE_TABLE_COLUMN, colClass, col.label); - }); - // add column - table.appendFormatLine('', VP_FE_ADD_COLUMN, '/nbextensions/visualpython/resource/plus.svg'); - - table.appendLine(''); - table.appendLine(''); - table.appendLine(''); - - dataList && dataList.forEach((row, idx) => { - table.appendLine(''); - var idxName = that.state.indexList[idx].label; - var idxLabel = convertToStr(idxName, typeof idxName == 'string'); - var idxClass = ''; - if (that.state.axis == FRAME_AXIS.ROW && that.state.selected.includes(idxLabel)) { - idxClass = 'selected'; - } - table.appendFormatLine('', idxLabel, FRAME_AXIS.ROW, VP_FE_TABLE_ROW, idxClass, idxName); - row.forEach((cell, colIdx) => { - if (cell == null) { - cell = 'NaN'; + if (!more) { + // table + var table = new sb.StringBuilder(); + // table.appendFormatLine('
{5}
{4}
', 1, 'dataframe'); + table.appendLine(''); + table.appendLine(''); + columnList && columnList.forEach(col => { + var colCode = col.code; + var colClass = ''; + if (that.state.axis == FRAME_AXIS.COLUMN && that.state.selected.map(col=>col.code).includes(colCode)) { + colClass = 'selected'; } - var cellType = that.state.columnList[colIdx].type; - if (cellType.includes('datetime')) { - cell = new Date(parseInt(cell)).toLocaleDateString(); + table.appendFormatLine('' + , colCode, FRAME_AXIS.COLUMN, col.type, VP_FE_TABLE_COLUMN, colClass, col.label); + }); + // add column + table.appendFormatLine('', VP_FE_ADD_COLUMN, '/nbextensions/visualpython/resource/plus.svg'); + + table.appendLine(''); + table.appendLine(''); + table.appendLine(''); + + dataList && dataList.forEach((row, idx) => { + table.appendLine(''); + var idxName = indexList[idx].label; + var idxLabel = convertToStr(idxName, typeof idxName == 'string'); + var idxClass = ''; + if (that.state.axis == FRAME_AXIS.ROW && that.state.selected.includes(idxLabel)) { + idxClass = 'selected'; } - table.appendFormatLine('', cell); + table.appendFormatLine('', idxLabel, FRAME_AXIS.ROW, VP_FE_TABLE_ROW, idxClass, idxName); + row.forEach((cell, colIdx) => { + if (cell == null) { + cell = 'NaN'; + } + var cellType = columnList[colIdx].type; + if (cellType.includes('datetime')) { + cell = new Date(parseInt(cell)).toLocaleString(); + } + table.appendFormatLine('', cell); + }); + // empty data + // table.appendLine(''); + table.appendLine(''); }); - // empty data - // table.appendLine(''); + // add row + table.appendLine(''); + table.appendFormatLine('', VP_FE_ADD_ROW, '/nbextensions/visualpython/resource/plus.svg'); table.appendLine(''); - }); - // add row - table.appendLine(''); - table.appendFormatLine('', VP_FE_ADD_ROW, '/nbextensions/visualpython/resource/plus.svg'); - table.appendLine(''); - table.appendLine(''); - $(that.wrapSelector('.' + VP_FE_TABLE)).replaceWith(function() { - return that.renderTable(table.toString()); - }); + table.appendLine(''); + $(that.wrapSelector('.' + VP_FE_TABLE)).replaceWith(function() { + return that.renderTable(table.toString()); + }); + } else { + var table = new sb.StringBuilder(); + dataList && dataList.forEach((row, idx) => { + table.appendLine(''); + var idxName = indexList[idx].label; + var idxLabel = convertToStr(idxName, typeof idxName == 'string'); + var idxClass = ''; + if (that.state.axis == FRAME_AXIS.ROW && that.state.selected.includes(idxLabel)) { + idxClass = 'selected'; + } + table.appendFormatLine('', idxLabel, FRAME_AXIS.ROW, VP_FE_TABLE_ROW, idxClass, idxName); + row.forEach((cell, colIdx) => { + if (cell == null) { + cell = 'NaN'; + } + var cellType = columnList[colIdx].type; + if (cellType.includes('datetime')) { + cell = new Date(parseInt(cell)).toLocaleString(); + } + table.appendFormatLine('', cell); + }); + // empty data + // table.appendLine(''); + table.appendLine(''); + }); + // insert before last tr tag(add row button) + $(table.toString()).insertBefore($(that.wrapSelector('.' + VP_FE_TABLE + ' tbody tr:last'))); + } + + // save columnList & indexList as state + that.state.columnList = columnList; + if (!more) { + that.state.indexList = indexList; + } else { + that.state.indexList = that.state.indexList.concat(indexList); + } + + // load info that.loadInfo(); // add to stack @@ -1261,6 +1306,11 @@ define([ var replacedCode = codeStr.replaceAll(that.state.tempObj, that.state.returnObj); that.setPreview(replacedCode); } + + // if scrollPos is saved, go to the position + if (scrollPos >= 0) { + $(that.wrapSelector('.vp-fe-table')).scrollTop(scrollPos); + } that.loading = false; }); @@ -1596,7 +1646,7 @@ define([ // more rows $(document).on('click', this.wrapSelector('.' + VP_FE_TABLE_MORE), function() { that.state.lines += TABLE_LINES; - that.loadCode(that.getTypeCode(FRAME_EDIT_TYPE.SHOW)); + that.loadCode(that.getTypeCode(FRAME_EDIT_TYPE.SHOW), true); }); // click toolbar item From 9328015064d0cada2269dafafa5ac53106f4e139 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 17:26:38 +0900 Subject: [PATCH 10/14] block style changed --- css/api_block/index.css | 6 +++--- src/api_block/block.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/css/api_block/index.css b/css/api_block/index.css index daa6f6a7..dc6f6740 100644 --- a/css/api_block/index.css +++ b/css/api_block/index.css @@ -320,11 +320,11 @@ flex-direction: column; margin-left: 14px; margin-bottom: 400px; - width: calc(100% - 68px); + width: calc(100% - 60px); } .vp-block { position: relative; - min-width: 205px; + width: 100%; min-height: 25px; z-index: 1; text-align: left; @@ -822,7 +822,7 @@ } .vp-apiblock-codeline-ellipsis { width: 100%; - background-color: rgba(255, 255, 255, 0.5); + /* background-color: rgba(255, 255, 255, 0.5); */ color: var(--font-primary); font-size: 12px; text-indent: 0.5em; diff --git a/src/api_block/block.js b/src/api_block/block.js index 64a90157..cf41202b 100644 --- a/src/api_block/block.js +++ b/src/api_block/block.js @@ -1487,9 +1487,9 @@ define([ if (isColor == true) { if (this.getBlockType() == BLOCK_CODELINE_TYPE.TEXT) { - $(this.getBlockMainDom()).css(STR_BORDER_LEFT, '2px solid var(--highlight-color'); + $(this.getBlockMainDom()).css(STR_BORDER_LEFT, '2px solid var(--highlight-color)'); } else { - $(this.getBlockMainDom()).css(STR_BORDER, '2px solid var(--highlight-color'); + $(this.getBlockMainDom()).css(STR_BORDER, '2px solid var(--highlight-color)'); } } } From 0fbe1a8ad0e331c2bc8dde39e4b8068e986652fa Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 17:26:54 +0900 Subject: [PATCH 11/14] resize bug fix --- src/container/vpContainer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/container/vpContainer.js b/src/container/vpContainer.js index 4e036b50..d485a569 100644 --- a/src/container/vpContainer.js +++ b/src/container/vpContainer.js @@ -619,6 +619,12 @@ define([ } else { $(vpCommon.wrapSelector(vpCommon.formatString("#{0}", vpConst.API_MODE_CONTAINER))).width($(vpCommon.wrapSelector(".vp-main-container")).width()); } + + // resize + var blockContainer = apiBlockJS.getBlockContainer(); + if (blockContainer.getIsOptionPageResize() == false) { + blockContainer.resizeAPIblock(); + } } /** From d64ba7aa39e3361ae547e73e095f6a064b0e9773 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 17:39:14 +0900 Subject: [PATCH 12/14] error fix --- src/container/vpContainer.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/container/vpContainer.js b/src/container/vpContainer.js index d485a569..2f750233 100644 --- a/src/container/vpContainer.js +++ b/src/container/vpContainer.js @@ -621,9 +621,11 @@ define([ } // resize - var blockContainer = apiBlockJS.getBlockContainer(); - if (blockContainer.getIsOptionPageResize() == false) { - blockContainer.resizeAPIblock(); + if (apiBlockJS) { + var blockContainer = apiBlockJS.getBlockContainer(); + if (blockContainer && blockContainer.getIsOptionPageResize() == false) { + blockContainer.resizeAPIblock(); + } } } From 128f3a3ca6e06b83658c96b137bca68fb6d16212 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Wed, 3 Nov 2021 19:18:05 +0900 Subject: [PATCH 13/14] Frame - reset table --- src/common/vpFrameEditor.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/vpFrameEditor.js b/src/common/vpFrameEditor.js index c7ba8b86..d600508f 100644 --- a/src/common/vpFrameEditor.js +++ b/src/common/vpFrameEditor.js @@ -1196,8 +1196,12 @@ define([ this.loading = true; kernelApi.executePython(code.toString(), function(result) { try { + if (!result || result.length <= 0) { + return; + } + var data = JSON.parse(result.substr(1,result.length - 2).replaceAll('\\\\', '\\')); + kernelApi.getColumnList(tempObj, function(columnResult) { - var data = JSON.parse(result.substr(1,result.length - 2).replaceAll('\\\\', '\\')); var columnList = JSON.parse(columnResult); // var columnList = data.columns; @@ -1430,6 +1434,11 @@ define([ that.state.tempObj = '_vp'; that.initState(); + // reset table + $(that.wrapSelector('.' + VP_FE_TABLE)).replaceWith(function() { + return that.renderTable(''); + }); + // load code with temporary df that.loadCode(that.getTypeCode(FRAME_EDIT_TYPE.INIT)); that.loadInfo(); From bd9a8a9d2315a06d3d38fe92eb8e4b23ae76e1d7 Mon Sep 17 00:00:00 2001 From: "blacklogic.dev" Date: Wed, 3 Nov 2021 19:22:14 +0900 Subject: [PATCH 14/14] deploy visualpython 1.2.0 --- src/api_block/blockContainer.js | 2 +- src/api_block/index.html | 2 +- src/common/constant.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api_block/blockContainer.js b/src/api_block/blockContainer.js index 7d216979..9597d322 100644 --- a/src/api_block/blockContainer.js +++ b/src/api_block/blockContainer.js @@ -2649,7 +2649,7 @@ define([ this.hideOptionPreviewBox(); $(VP_ID_PREFIX + VP_APIBLOCK_BOARD_OPTION_PREVIEW_BUTTON).removeClass('enabled'); - this.setNavigator(BLOCK_CODELINE_TYPE.NONE, 'Visual Python 1.1.15'); + this.setNavigator(BLOCK_CODELINE_TYPE.NONE, 'Visual Python 1.2.0'); this.setFocusedPageType(FOCUSED_PAGE_TYPE.BOARD); $('.vp-apiblock-option-tab-none').css(STR_DISPLAY, STR_BLOCK); } diff --git a/src/api_block/index.html b/src/api_block/index.html index 11795e2e..bc5eb41d 100644 --- a/src/api_block/index.html +++ b/src/api_block/index.html @@ -120,7 +120,7 @@ id='vp_apiblock_option_page'>
- Visual Python 1.1.15 + Visual Python 1.2.0
diff --git a/src/common/constant.js b/src/common/constant.js index 26bdf935..4fd2ab40 100644 --- a/src/common/constant.js +++ b/src/common/constant.js @@ -48,7 +48,7 @@ define ([ * toolbar btn properties */ const TOOLBAR_BTN_INFO = { - HELP: "Visual Python 1.1.15" + HELP: "Visual Python 1.2.0" // , ICON: "fa-angellist" , ICON: "vp-main-icon" , ID: "vpBtnToggle"
{5}
{0}{4}{0}
{4}{0}