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" 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' ]; } 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(); }