Visual Python 2.2.8 demo
\n", + " | sepal_length | \n", + "sepal_width | \n", + "petal_length | \n", + "petal_width | \n", + "variety | \n", + "
---|---|---|---|---|---|
0 | \n", + "5.1 | \n", + "3.5 | \n", + "1.4 | \n", + "0.2 | \n", + "Setosa | \n", + "
1 | \n", + "4.9 | \n", + "3.0 | \n", + "1.4 | \n", + "0.2 | \n", + "Setosa | \n", + "
2 | \n", + "4.7 | \n", + "3.2 | \n", + "1.3 | \n", + "0.2 | \n", + "Setosa | \n", + "
3 | \n", + "4.6 | \n", + "3.1 | \n", + "1.5 | \n", + "0.2 | \n", + "Setosa | \n", + "
4 | \n", + "5.0 | \n", + "3.6 | \n", + "1.4 | \n", + "0.2 | \n", + "Setosa | \n", + "
... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
145 | \n", + "6.7 | \n", + "3.0 | \n", + "5.2 | \n", + "2.3 | \n", + "Virginica | \n", + "
146 | \n", + "6.3 | \n", + "2.5 | \n", + "5.0 | \n", + "1.9 | \n", + "Virginica | \n", + "
147 | \n", + "6.5 | \n", + "3.0 | \n", + "5.2 | \n", + "2.0 | \n", + "Virginica | \n", + "
148 | \n", + "6.2 | \n", + "3.4 | \n", + "5.4 | \n", + "2.3 | \n", + "Virginica | \n", + "
149 | \n", + "5.9 | \n", + "3.0 | \n", + "5.1 | \n", + "1.8 | \n", + "Virginica | \n", + "
150 rows × 5 columns
\n", + "\n", + " | variety | \n", + "sepal_length | \n", + "sepal_width | \n", + "petal_length | \n", + "petal_width | \n", + "
---|---|---|---|---|---|
0 | \n", + "Setosa | \n", + "5.1 | \n", + "3.5 | \n", + "1.4 | \n", + "0.2 | \n", + "
1 | \n", + "Setosa | \n", + "4.9 | \n", + "3.0 | \n", + "1.4 | \n", + "0.2 | \n", + "
2 | \n", + "Setosa | \n", + "4.7 | \n", + "3.2 | \n", + "1.3 | \n", + "0.2 | \n", + "
3 | \n", + "Setosa | \n", + "4.6 | \n", + "3.1 | \n", + "1.5 | \n", + "0.2 | \n", + "
4 | \n", + "Setosa | \n", + "5.0 | \n", + "3.6 | \n", + "1.4 | \n", + "0.2 | \n", + "
... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
145 | \n", + "Virginica | \n", + "6.7 | \n", + "3.0 | \n", + "5.2 | \n", + "2.3 | \n", + "
146 | \n", + "Virginica | \n", + "6.3 | \n", + "2.5 | \n", + "5.0 | \n", + "1.9 | \n", + "
147 | \n", + "Virginica | \n", + "6.5 | \n", + "3.0 | \n", + "5.2 | \n", + "2.0 | \n", + "
148 | \n", + "Virginica | \n", + "6.2 | \n", + "3.4 | \n", + "5.4 | \n", + "2.3 | \n", + "
149 | \n", + "Virginica | \n", + "5.9 | \n", + "3.0 | \n", + "5.1 | \n", + "1.8 | \n", + "
150 rows × 5 columns
\n", + "${STR_SAMPLE_TEXT}
`); - createdBlock.renderSelectedBlockBorderColor(true); - return createdBlock; - } - - /** - * @param {string} funcID xml에 적힌 API List의 funcID - * @param {string} naviInfo Common > Import 같은 naigation 정보 - */ - BlockContainer.prototype.createAPIListBlock = async function(funcID, naviInfo) { - this.resetBlockList(); - - var isFirstBlock = false; - const blockList = this.getBlockList(); - /** board에 블럭이 0개 일때 - * 즉 블럭이 처음으로 생성되는 경우 - */ - if (blockList.length == 0) { - isFirstBlock = true; - } - - var createdBlock_api = this.createBlock(BLOCK_CODELINE_TYPE.API, null, null, true, true); - createdBlock_api.setFuncID(funcID); - createdBlock_api.setOptionPageLoadCallback(optionPageLoadCallback_block); - createdBlock_api.setLoadOption(loadOption_block); - createdBlock_api.setState({ - [STATE_codeLine]: naviInfo - }); - - createdBlock_api.writeCode(naviInfo); - setClosureBlock(createdBlock_api); - loadOption_block(funcID, optionPageLoadCallback_block); - this.resetBlockListAndRenderThisBlock(createdBlock_api); - } - - /** 블럭을 이동할 때, - * shadow 블럭을 만드는 메소드 - * @param {ENUM} blockType - * @param {Block} thisBlock - */ - BlockContainer.prototype.createShadowBlock = function( blockType, thisBlock) { - var blockContainerThis = this; - var shadowBlock = new ShadowBlock(blockContainerThis, blockType, thisBlock); - var $shadowBlockContainerDom = $(shadowBlock.getBlockContainerDom()); - $shadowBlockContainerDom.css(STR_DISPLAY, STR_NONE); - - var containerDom = blockContainerThis.getBlockContainerDom(); - $(containerDom).append(shadowBlock.getBlockContainerDom()); - - return shadowBlock; - } - - - - - - - - - - - - - - - /** Block의 HTML 생성 - * 이동하는 block과 동일한 모양의 html tag 생성 - * @param {Block} thisBlock - */ - BlockContainer.prototype.makeBlockDom = function(thisBlock) { - var blockMainDom = document.createElement(STR_DIV); - blockMainDom.classList.add(VP_BLOCK); - blockMainDom.classList.add(`vp-block-${thisBlock.getUUID()}`); - - var blockType = thisBlock.getBlockType(); - /** node or text 블럭일 경우 */ - if ( IsNodeTextBlockType(blockType) == true - || thisBlock.isGroupBlock ) { - if (blockType == BLOCK_CODELINE_TYPE.NODE) { - $(blockMainDom).css(STR_BACKGROUND_COLOR, STR_TRANSPARENT); - } - $(blockMainDom).css(STR_MARGIN_TOP, NUM_NODE_OR_TEXT_BLOCK_MARGIN_TOP_PX); - /** shadow 블럭일 경우 */ - } else if (blockType == BLOCK_CODELINE_TYPE.SHADOW) { - blockMainDom.classList.add(VP_CLASS_BLOCK_BOTTOM_HOLDER); - } - - /** 이동하는 block의 header 생성 */ - - var classOrDefName; - /** class */ - if ( blockType == BLOCK_CODELINE_TYPE.CLASS ) { - classOrDefName = thisBlock.getState(STATE_className); - /** def 이름 */ - } else if ( blockType == BLOCK_CODELINE_TYPE.DEF ) { - classOrDefName = thisBlock.getState(STATE_defName); - } - - var codeLineStr = thisBlock.getNowCodeLine(); - - var blockName = thisBlock.getBlockName(); - if ( blockType == BLOCK_CODELINE_TYPE.CODE - || blockType == BLOCK_CODELINE_TYPE.PASS - || blockType == BLOCK_CODELINE_TYPE.CONTINUE - || blockType == BLOCK_CODELINE_TYPE.BREAK - || blockType == BLOCK_CODELINE_TYPE.LAMBDA - || blockType == BLOCK_CODELINE_TYPE.NODE - || blockType == BLOCK_CODELINE_TYPE.TEXT - || blockType == BLOCK_CODELINE_TYPE.API ) { - blockName = ''; - } else if (blockType == BLOCK_CODELINE_TYPE.PROPERTY) { - blockName = '@'; - } else if (blockType == BLOCK_CODELINE_TYPE.COMMENT) { - blockName = '#'; - } - - var sbMainHeader = new sb.StringBuilder(); - var blockUUID = thisBlock.getUUID(); - if (blockType == BLOCK_CODELINE_TYPE.NODE) { - sbMainHeader.appendFormatLine("Node
`) - $(nodePageDom).append(textareaDom); - nodeBlockOption.append(nodePageDom); - - var codemirrorCode = codemirror.fromTextArea(textareaDom, { - mode: { - name: 'python', - version: 3, - singleLineStringErrors: false - }, // text-cell(markdown cell) set to 'htmlmixed' - indentUnit: 4, - matchBrackets: true, - readOnly:true, - autoRefresh: true, - lineWrapping: false, // text-cell(markdown cell) set to true - indentWithTabs: true, - theme: "ipython", - extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"} - }); - - $(optionPageSelector).append(nodeBlockOption); - codemirrorCode.setValue($(textareaDom).val()); - - return nodeBlockOption; - } - return renderThisComponent(); - } - return InitNodeBlockOption; -}); \ No newline at end of file diff --git a/src/api_block/component/option/none_option.js b/src/api_block/component/option/none_option.js deleted file mode 100644 index abf71d13..00000000 --- a/src/api_block/component/option/none_option.js +++ /dev/null @@ -1,26 +0,0 @@ -define([ - 'jquery' - - - , '../base/index.js' -], function ( $ - , baseComponent ) { - - - const { MakeOptionContainer } = baseComponent; - var InitNoneOption = function(thisBlock, optionPageSelector) { - var renderThisComponent = function() { - var noneOption = MakeOptionContainer(thisBlock); - // noneOption.append('# PREVIEW CODE | ||
' - , VP_DS_LABEL, 'Variable'); - - popupTag.appendLine(' | '); - // pandasObject - suggestInputText - // var vpDfSuggest = new vpSuggestInputText.vpSuggestInputText(); - // vpDfSuggest.addClass(VP_DS_PANDAS_OBJECT); - // vpDfSuggest.addClass('vp-input'); - // vpDfSuggest.setPlaceholder('Select Object'); - // vpDfSuggest.setSuggestList(function() { return [] }); - // vpDfSuggest.setNormalFilter(false); - // vpDfSuggest.setValue($(this.pageThis.wrapSelector('#' + this.targetId)).val()); - // popupTag.appendFormatLine(' | {0}', vpDfSuggest.toTagString()); - popupTag.appendFormatLine('' - , VP_DS_PANDAS_OBJECT_BOX, 'vp-input', VP_DS_PANDAS_OBJECT); - - // use copy - popupTag.appendFormatLine('', VP_DS_USE_COPY, 'Make a copy'); - popupTag.appendLine(' |
' - , VP_DS_LABEL, 'Method'); - popupTag.appendLine(' | '); - popupTag.appendLine(this.renderSubsetType(this.state.dataType)); - - // to frame - popupTag.appendFormatLine('', VP_DS_TO_FRAME, 'To DataFrame'); - - popupTag.appendLine(' |
');
- // del col
- tag.appendLine('');
-
- var varList = this.state.dataList;
- tag.appendLine(this.renderConditionVariableInput(varList, this.state.pandasObject, this.state.dataType));
-
- tag.appendLine(' ');
- // tag.appendLine('');
- tag.appendLine(this.renderConditionColumnInput(colList));
-
- // tag.appendLine('');
- // var vpOperSuggest = new vpSuggestInputText.vpSuggestInputText();
- // vpOperSuggest.addClass('vp-input s vp-oper-list');
- // vpOperSuggest.setPlaceholder("Oper");
- // vpOperSuggest.setSuggestList(function() { return ['==', '!=', 'in', 'not in', '<', '<=', '>', '>=']; });
- // vpOperSuggest.setSelectEvent(function(value) {
- // $(this.wrapSelector()).val(value);
- // $(this.wrapSelector()).trigger('change');
- // });
- // vpOperSuggest.setNormalFilter(false);
- // tag.appendLine(vpOperSuggest.toTagString());
- tag.appendFormatLine('');
- tag.appendLine('');
- tag.appendLine(' ');
-
- tag.appendLine('');
- tag.appendLine('');
-
- // use text
- tag.appendFormatLine(''
- , 'vp-condition-use-text', 'vp-cond-use-text', 'Uncheck it if you want to use variable or numeric values.', 'Text');
- tag.appendLine(' ');
-
- tag.appendLine(' | ');
- tag.appendLine('|||||||
'); - tag.appendFormatLine(' | ' - , VP_DS_BUTTON_ADD_CONDITION, 'vp-add-col', '+ Condition'); - tag.appendLine(' |
{0}', renderedText); - } - tag.appendLine('
{0}', msg.content.evalue.split('\\n').join('