From 8a916ff27bff1828a8a034340024789ea4e87455 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 1 Jul 2022 16:44:59 +0900 Subject: [PATCH 1/4] Disable Profiling app for preventing bug from MarkupSafe --- data/libraries.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/data/libraries.json b/data/libraries.json index 5cd63821..e276480f 100644 --- a/data/libraries.json +++ b/data/libraries.json @@ -3049,20 +3049,6 @@ "color": 3, "icon": "apps/apps_pymupdf.svg" } - }, - { - "id" : "apps_profiling", - "type" : "function", - "level": 1, - "name" : "Profiling", - "tag" : "PROFILING,PANDAS PROFILING,APPS", - "path" : "visualpython - apps - profiling", - "desc" : "Pandas Profiling", - "file" : "m_apps/Profiling", - "apps" : { - "color": 4, - "icon": "apps/apps_profiling.svg" - } } ] }, From b075eb047c9f29f42e6ea687e1700dc969c5421a Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 1 Jul 2022 17:14:47 +0900 Subject: [PATCH 2/4] Enable Profiling app and remove installing ipywidget --- data/libraries.json | 14 ++++++++++++++ js/m_apps/Profiling.js | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/data/libraries.json b/data/libraries.json index e276480f..5cd63821 100644 --- a/data/libraries.json +++ b/data/libraries.json @@ -3049,6 +3049,20 @@ "color": 3, "icon": "apps/apps_pymupdf.svg" } + }, + { + "id" : "apps_profiling", + "type" : "function", + "level": 1, + "name" : "Profiling", + "tag" : "PROFILING,PANDAS PROFILING,APPS", + "path" : "visualpython - apps - profiling", + "desc" : "Pandas Profiling", + "file" : "m_apps/Profiling", + "apps" : { + "color": 4, + "icon": "apps/apps_profiling.svg" + } } ] }, diff --git a/js/m_apps/Profiling.js b/js/m_apps/Profiling.js index 5dcd3643..c33affd1 100644 --- a/js/m_apps/Profiling.js +++ b/js/m_apps/Profiling.js @@ -151,8 +151,7 @@ define([ generateInstallCode() { return [ - '!pip install pandas-profiling', - '!pip install ipywidgets' + '!pip install pandas-profiling' ]; } From c235a4a04cbffb7f1cbd7fa8f81fd3c08d9da8ee Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Fri, 1 Jul 2022 17:44:29 +0900 Subject: [PATCH 3/4] Edit to show sorting option when its condition is satisfied --- js/m_visualize/Seaborn.js | 66 +++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/js/m_visualize/Seaborn.js b/js/m_visualize/Seaborn.js index 95370158..3e03dafb 100644 --- a/js/m_visualize/Seaborn.js +++ b/js/m_visualize/Seaborn.js @@ -200,7 +200,9 @@ define([ } else if (chartType == 'barplot') { $(that.wrapSelector('#showValues')).closest('.sb-option').show(); if (that.state.setXY === false) { - $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + if (that.state.x !== '' && that.state.y !== '') { + $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + } if (that.state.hue !== '') { $(that.wrapSelector('#sortHue')).closest('.sb-option').show(); } @@ -208,7 +210,9 @@ define([ } else if (chartType == 'countplot') { $(that.wrapSelector('#showValues')).closest('.sb-option').show(); if (that.state.setXY === false) { - $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + if (that.state.x !== '' || that.state.y !== '') { + $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + } if (that.state.hue !== '') { $(that.wrapSelector('#sortHue')).closest('.sb-option').show(); } @@ -226,11 +230,6 @@ define([ $(that.wrapSelector('#x')).closest('.vp-ds-box').replaceWith(''); $(that.wrapSelector('#y')).closest('.vp-ds-box').replaceWith(''); $(that.wrapSelector('#hue')).closest('.vp-ds-box').replaceWith(''); - - // FIXME: hide sort values for barplot/countplot (as temporary) - if (that.state.chartType == 'barplot' || that.state.chartType == 'countplot') { - $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); - } } else { // set X Y indivisually // disable data selection @@ -250,7 +249,7 @@ define([ let dataSelectorHue = new DataSelector({ pageThis: that, id: 'hue' }); $(that.wrapSelector('#hue')).replaceWith(dataSelectorHue.toTagString()); - // FIXME: hide sort values for barplot/countplot (as temporary) + // FIXME: hide sort values for barplot/countplot if (that.state.chartType == 'barplot' || that.state.chartType == 'countplot') { $(that.wrapSelector('#sortBy')).closest('.sb-option').hide(); $(that.wrapSelector('#sortHue')).closest('.sb-option').hide(); @@ -259,6 +258,49 @@ define([ } }); + // change x, y + $(document).off('change', this.wrapSelector('#x')); + $(document).on('change', this.wrapSelector('#x'), function() { + let { chartType, y, setXY } = that.state; + let x = $(this).val(); + if (setXY === false) { + if (chartType == 'barplot') { + if (x !== '' && y !== '') { + $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + } else { + $(that.wrapSelector('#sortBy')).closest('.sb-option').hide(); + } + } else if (chartType == 'countplot') { + if (x !== '' || y !== '') { + $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + } else { + $(that.wrapSelector('#sortBy')).closest('.sb-option').hide(); + } + } + } + }); + + $(document).off('change', this.wrapSelector('#y')); + $(document).on('change', this.wrapSelector('#y'), function() { + let { chartType, x, setXY } = that.state; + let y = $(this).val(); + if (setXY === false) { + if (chartType == 'barplot') { + if (x !== '' && y !== '') { + $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + } else { + $(that.wrapSelector('#sortBy')).closest('.sb-option').hide(); + } + } else if (chartType == 'countplot') { + if (x !== '' || y !== '') { + $(that.wrapSelector('#sortBy')).closest('.sb-option').show(); + } else { + $(that.wrapSelector('#sortBy')).closest('.sb-option').hide(); + } + } + } + }); + // change hue $(document).off('change', this.wrapSelector('#hue')); $(document).on('change', this.wrapSelector('#hue'), function() { @@ -487,7 +529,9 @@ define([ } else if (this.state.chartType == 'barplot') { $(page).find('#showValues').closest('.sb-option').show(); if (this.state.setXY === false) { - $(page).find('#sortBy').closest('.sb-option').show(); + if (this.state.x !== '' && this.state.y !== '') { + $(page).find('#sortBy').closest('.sb-option').show(); + } if (this.state.hue !== '') { $(page).find('#sortHue').closest('.sb-option').show(); } @@ -495,7 +539,9 @@ define([ } else if (this.state.chartType == 'countplot') { $(page).find('#showValues').closest('.sb-option').show(); if (this.state.setXY === false) { - $(page).find('#sortBy').closest('.sb-option').show(); + if (this.state.x !== '' || this.state.y !== '') { + $(page).find('#sortBy').closest('.sb-option').show(); + } if (this.state.hue !== '') { $(page).find('#sortHue').closest('.sb-option').show(); } From 48804938ba1d88aa9e926b49fe3dc0dff475172e Mon Sep 17 00:00:00 2001 From: visualpython Date: Fri, 1 Jul 2022 17:49:41 +0900 Subject: [PATCH 4/4] deploy visualpython 2.2.8 --- js/com/com_Config.js | 2 +- js/com/com_Const.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/com/com_Config.js b/js/com/com_Config.js index f6e29477..2ba43f24 100644 --- a/js/com/com_Config.js +++ b/js/com/com_Config.js @@ -587,7 +587,7 @@ define([ /** * Version */ - Config.version = "2.2.7"; + Config.version = "2.2.8"; /** * Type of mode diff --git a/js/com/com_Const.js b/js/com/com_Const.js index 1fd5deb1..51b57f43 100644 --- a/js/com/com_Const.js +++ b/js/com/com_Const.js @@ -19,7 +19,7 @@ define ([ class Constants { } Constants.TOOLBAR_BTN_INFO = { - HELP: "Visual Python 2.2.7" + HELP: "Visual Python 2.2.8" , ICON: "vp-main-icon" , ID: "vpBtnToggle" , NAME: "toggle-vp"