Skip to content
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
2 changes: 1 addition & 1 deletion js/com/com_Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ define([
/**
* Version
*/
Config.version = "2.2.7";
Config.version = "2.2.8";

/**
* Type of mode
Expand Down
2 changes: 1 addition & 1 deletion js/com/com_Const.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions js/m_apps/Profiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ define([

generateInstallCode() {
return [
'!pip install pandas-profiling',
'!pip install ipywidgets'
'!pip install pandas-profiling'
];
}

Expand Down
66 changes: 56 additions & 10 deletions js/m_visualize/Seaborn.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,19 @@ 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();
}
}
} 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();
}
Expand All @@ -226,11 +230,6 @@ define([
$(that.wrapSelector('#x')).closest('.vp-ds-box').replaceWith('<select id="x"></select>');
$(that.wrapSelector('#y')).closest('.vp-ds-box').replaceWith('<select id="y"></select>');
$(that.wrapSelector('#hue')).closest('.vp-ds-box').replaceWith('<select id="hue"></select>');

// 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
Expand All @@ -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();
Expand All @@ -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() {
Expand Down Expand Up @@ -487,15 +529,19 @@ 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();
}
}
} 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();
}
Expand Down