Skip to content

Commit 8140976

Browse files
authored
Merge pull request #244 from minjk-bl/devops
Devops for 2.5.0
2 parents 1134d44 + a7e7328 commit 8140976

32 files changed

+623
-192
lines changed

visualpython/css/component/popupComponent.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@
525525
height: 25px;
526526
}
527527
.vp-popup-frame .vp-accordian-box {
528-
padding: 0px 15px 15px 0px;
528+
padding: 0px 15px 0px 0px;
529529
}
530530

531531
/* resizable handler */

visualpython/css/m_apps/frame.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
top: 0;
146146
background-color: var(--vp-background-color);
147147
border-bottom: 1px solid var(--vp-border-gray-color);
148+
border-right: 1px solid var(--vp-border-gray-color);
148149

149150
text-align: right;
150151
text-overflow: ellipsis;
@@ -168,6 +169,10 @@
168169
/* background: var(--vp-light-gray-color); */
169170
/* background: rgba(66, 165, 245, 0.2); */
170171
}
172+
.vp-fe-table-column-isnumeric {
173+
float: left;
174+
margin-right: 5px;
175+
}
171176

172177
/* Row Hover */
173178
.vp-fe-table tbody tr:hover {
@@ -302,6 +307,18 @@
302307
float: right;
303308
display: inline-block;
304309
}
310+
/* to datetime */
311+
.vp-inner-popup-todt-addcol-content {
312+
display: grid;
313+
row-gap: 5px;
314+
max-height: 105px;
315+
}
316+
.vp-inner-popup-todt-addcol-head,
317+
.vp-inner-popup-todt-addcol-item {
318+
display: grid;
319+
grid-template-columns: 160px 160px auto;
320+
column-gap: 5px;
321+
}
305322

306323
/* UDF Editor - CodeMirror */
307324
.vp-fr-subset-box {

visualpython/css/m_visualize/seaborn.css

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,28 @@
4747
height: 100%;
4848
}
4949
.vp-tab-page-box.figure {
50-
height: calc(100% - 30px);
50+
height: 100%;
5151
align-content: baseline;
5252
grid-template-rows: 1fr;
53+
overflow: hidden;
54+
}
55+
.vp-tab-page-box.figure > .vp-tab-page {
56+
overflow: auto;
5357
}
5458
.vp-tab-page-box.plot {
55-
height: calc(100% - 30px);
56-
min-height: 352px;
59+
/* height: calc(100% - 30px);
60+
min-height: 352px; */
5761
align-content: baseline;
62+
height: 100%;
63+
max-height: 100%;
64+
overflow: scroll;
65+
padding: 15px 15px 0px 15px;
5866
}
5967
.vp-chart-plot-box {
6068
height: 100%;
69+
display: grid;
70+
grid-template-rows: 30px calc(100% - 30px);
71+
overflow: auto;
6172
}
6273
.vp-chart-body {
6374
display: grid;
@@ -75,6 +86,14 @@
7586
.vp-chart-left-box,
7687
.vp-chart-right-box {
7788
height: 100%;
89+
display: grid;
90+
grid-template-rows: 30px calc(100% - 30px);
91+
}
92+
.vp-chart-left-box {
93+
overflow: auto;
94+
}
95+
.vp-chart-right-box {
96+
overflow: hidden;
7897
}
7998
.vp-chart-preview-title {
8099
line-height: 30px;
@@ -86,7 +105,8 @@
86105
.vp-chart-preview-box {
87106
min-height: 352px;
88107
width: 100%;
89-
height: calc(100% - 30px);
108+
/* height: calc(100% - 30px); */
109+
height: 100%;
90110
}
91111
.vp-chart-preview-content:empty::after {
92112
content: 'No preview image';

visualpython/data/m_ml/mlLibrary.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,12 @@ define([
175175
name: 'SMOTE',
176176
install: '!pip install imblearn',
177177
import: 'from imblearn.over_sampling import SMOTE',
178-
code: 'SMOTE(${random_state}${k_neighbors}${etc})',
178+
code: 'SMOTE(${random_state}${k_neighbors}${sampling_strategy}${etc})',
179179
returnType: 'SMOTE',
180180
options: [
181181
{ name: 'random_state', component: ['input_number'], placeholder: '123', usePair: true },
182-
{ name: 'k_neighbors', component: ['input_number'], default: 5, usePair: true }
182+
{ name: 'k_neighbors', component: ['input_number'], default: 5, usePair: true },
183+
{ name: 'sampling_strategy', component: ['input'], placeholder: "'auto'", usePair: true }
183184
]
184185
},
185186
/** Data Preparation - Scaling */

visualpython/data/m_visualize/seabornLibrary.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,14 @@ define([
148148
},
149149
'barplot': {
150150
name: 'Bar Plot',
151-
code: '${allocateTo} = sns.barplot(${data}${x}${y}${hue}${etc})',
151+
code: '${allocateTo} = sns.barplot(${data}${x}${y}${hue}${orient}${etc})',
152152
description: 'Show point estimates and confidence intervals as rectangular bars.',
153153
options: [
154154
{ name: 'data', component: ['var_select'], var_type: ['DataFrame', 'Series', 'list'], usePair: true },
155155
{ name: 'x', component: ['col_select'], usePair: true },
156156
{ name: 'y', component: ['col_select'], usePair: true },
157157
{ name: 'hue', component: ['col_select'], usePair: true },
158+
{ name: 'orient', component: ['option_select'], usePair: true },
158159
{ name: 'allocateTo', label: 'Allocate To', component: ['input'], usePair: true }
159160
]
160161
},

visualpython/html/component/fileNavigation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-->
1111
<!-- use body tag to strip comments out on requirejs/text plugin -->
1212
<body>
13-
<div id="vp_fileNavigation">
13+
<div id="vp_fileNavigation" class="vp-filenavigation-base">
1414
<div class='fileNavigationPage-container center-1rem-gray' >
1515
<div class="fileNavigationPage-sidebar">
1616
<!-- Jupyter Notebook -->

visualpython/html/m_ml/fitPredict.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939
<div class="vp-grid-border-box">
4040
<div class="vp-multilang vp-ins-select-title">Options</div>
41-
<div class="vp-ins-parameter-box vp-grid-col-95">
41+
<div class="vp-ins-parameter-box vp-grid-col-130">
4242

4343
</div>
4444
</div>

visualpython/html/m_ml/modelInfo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939
<div class="vp-grid-border-box">
4040
<div class="vp-multilang vp-ins-select-title">Options</div>
41-
<div class="vp-ins-parameter-box vp-grid-col-95">
41+
<div class="vp-ins-parameter-box vp-grid-col-130">
4242

4343
</div>
4444
</div>

visualpython/html/m_stats/probDist.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<div class="vp-grid-col-160">
2121
<label for="action" class="vp-orange-text">Action</label>
2222
<select id="action" class="vp-select l">
23-
<option value="random-number">Generate random numbers</option>
24-
<option value="distribution-plot">Show distribution plot</option>
23+
<option class="vp-pd-display-option dist cont" value="random-number">Generate random numbers</option>
24+
<option class="vp-pd-display-option dist cont dist-plot" value="distribution-plot">Show distribution plot</option>
2525
<option class="vp-pd-display-option cont" value="stats-to-pvalue">Statistics to P-value</option>
2626
<option class="vp-pd-display-option cont" value="pvalue-to-stats">P-value to Statistics</option>
2727
</select>

visualpython/html/m_visualize/seaborn.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@
100100
<label for="bins" class="vp-bold">Bins</label>
101101
<input type="number" class="vp-input vp-state" id="bins" placeholder="Type bins" step="5" min="0" />
102102
</div>
103+
<div class="vp-grid-box sb-option">
104+
<label for="orient" class="vp-bold">Orient</label>
105+
<select id="orient" class="vp-select vp-state">
106+
<option value="">Select option...</option>
107+
<option value="'v'">Vertical</option>
108+
<option value="'h'">Horizontal</option>
109+
</select>
110+
</div>
103111
<div class="vp-grid-box sb-option">
104112
<label for="kde" class="vp-bold">Kde</label>
105113
<select id="kde" class="vp-select vp-state">

visualpython/js/com/com_Config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,11 @@ define([
11091109
Config.ML_DATA_DICT = {
11101110
'Data Preparation': [
11111111
/** Encoding */
1112-
'OneHotEncoder', 'LabelEncoder', 'OrdinalEncoder', 'TargetEncoder', 'SMOTE',
1112+
'OneHotEncoder', 'LabelEncoder', 'OrdinalEncoder', 'TargetEncoder',
11131113
/** Scaling */
11141114
'StandardScaler', 'RobustScaler', 'MinMaxScaler', 'Normalizer', 'FunctionTransformer', 'PolynomialFeatures', 'KBinsDiscretizer',
11151115
/** ETC */
1116-
'SimpleImputer', 'ColumnTransformer'
1116+
'SimpleImputer', 'SMOTE', 'ColumnTransformer'
11171117
],
11181118
'Regression': [
11191119
'LinearRegression', 'Ridge', 'Lasso', 'ElasticNet', 'SVR', 'DecisionTreeRegressor', 'RandomForestRegressor', 'GradientBoostingRegressor', 'XGBRegressor', 'LGBMRegressor', 'CatBoostRegressor',

visualpython/js/com/com_Event.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,13 @@ define([], function() {
207207
that.keyManager.keyCheck.shiftKey = false;
208208
}
209209
if (evt.keyCode == that.keyManager.keyCode.escKey) {
210+
// check if there is visible file navigation : FileNavigation
211+
if ($('.vp-filenavigation-base:visible').length > 0) {
212+
// close file navigation
213+
$('.vp-filenavigation-base:visible').remove();
214+
}
210215
// check if there is visible data selector : DataSelector
211-
if ($('.vp-dataselector-base:visible').length > 0) {
216+
else if ($('.vp-dataselector-base:visible').length > 0) {
212217
// close data selector
213218
$('.vp-dataselector-base:visible').remove();
214219
}

visualpython/js/com/component/FileNavigation.js

Lines changed: 58 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ define([
8484
this.pathStackPointer = -1;
8585
this.pathStack = [];
8686
this.currentFileList = [];
87+
this.selectedExt = '';
88+
if (this.state.extensions.length > 0) {
89+
this.selectedExt = this.state.extensions[0];
90+
}
8791

8892
this.pathState = {
8993
parentPath: '',
@@ -280,6 +284,32 @@ define([
280284
// clear body
281285
$(this.wrapSelector('.fileNavigationPage-body')).html('');
282286

287+
/**
288+
* Filter file/dir which included in this.state.extensions
289+
*/
290+
if (Array.isArray(this.state.extensions) && this.state.extensions.length > 0 && this.state.extensions.toString() !== '') {
291+
fileList = fileList.filter((data, index) => {
292+
if (index == 0) {
293+
return true;
294+
}
295+
296+
if (data.type && data.type == 'dir') {
297+
// if directory, just show
298+
return true;
299+
} else if (data.name) {
300+
var extension = data.name.substring(data.name.lastIndexOf('.') + 1);
301+
// if (that.state.extensions.includes(extension)) {
302+
if (that.selectedExt === '' || extension === that.selectedExt) {
303+
return true;
304+
} else {
305+
return false;
306+
}
307+
} else {
308+
return false;
309+
}
310+
});
311+
}
312+
283313
// render file items
284314
let dirArr = [];
285315
let fileArr = [];
@@ -411,12 +441,12 @@ define([
411441
page.appendFormatLine('<input id="{0}" type="text" class="vp-input" placeholder="{1}" value="{2}"/>'
412442
, 'vp_fileNavigationInput', 'New File Name', this.state.fileName);
413443
page.appendFormatLine('<select id="{0}" class="vp-select">', 'vp_fileNavigationExt');
444+
page.appendLine('<option value="">All files(*.*)</option>');
414445
if (this.state.extensions && this.state.extensions.length > 0) {
446+
let selectedExt = this.selectedExt;
415447
this.state.extensions.forEach(ext => {
416-
page.appendFormatLine('<option value="{0}">*.{1}</option>', ext, ext);
448+
page.appendFormatLine('<option value="{0}" {1}>*.{2}</option>', ext, (selectedExt === ext?'selected':''), ext);
417449
});
418-
} else {
419-
page.appendLine('<option value="">All files(*.*)</option>');
420450
}
421451
page.appendLine('</select>');
422452
page.appendFormatLine('<button class="{0} vp-button" data-menu="{1}">{2}</button>', 'vp-filenavi-btn', 'select', 'Select');
@@ -430,6 +460,13 @@ define([
430460

431461
that.handleSelectFile(filePath, fileName);
432462
});
463+
// bind file extension change event
464+
$(this.wrapSelector('#vp_fileNavigationExt')).on('change', function() {
465+
let ext = $(this).val();
466+
that.selectedExt = ext;
467+
468+
that.renderFileList();
469+
});
433470
// bind save cancel event
434471
$(this.wrapSelector('.vp-filenavi-btn')).on('click', function() {
435472
let menu = $(this).data('menu');
@@ -477,10 +514,10 @@ define([
477514
let that = this;
478515
/** Implement after rendering */
479516
// if save mode
480-
if (this.state.type == 'save') {
481-
// render saving box
482-
this.renderSaveBox();
483-
}
517+
// if (this.state.type == 'save') {
518+
// render saving box
519+
this.renderSaveBox();
520+
// }
484521

485522
// get current path
486523
this.getCurrentDirectory().then(function(currentPath) {
@@ -527,20 +564,21 @@ define([
527564
//============================================================================
528565
// Set selection result
529566
//============================================================================
530-
if (this.state.type == 'save') {
531-
// add as saving file
532-
this.setSelectedFile(fileInput, pathInput);
533-
} else {
534-
// Manage result using finish function
535-
let filesPath = [{ file: fileInput, path: pathInput }]; //FIXME: fix it if multiple selection implemented
536-
let status = true;
537-
let error = null;
538-
vpLog.display(VP_LOG_TYPE.DEVELOP, 'fileNavigation finished', filesPath, status, error);
539-
this.state.finish(filesPath, status, error);
567+
this.setSelectedFile(fileInput, pathInput);
568+
// if (this.state.type == 'save') {
569+
// // add as saving file
570+
// this.setSelectedFile(fileInput, pathInput);
571+
// } else {
572+
// // Manage result using finish function
573+
// let filesPath = [{ file: fileInput, path: pathInput }]; //FIXME: fix it if multiple selection implemented
574+
// let status = true;
575+
// let error = null;
576+
// vpLog.display(VP_LOG_TYPE.DEVELOP, 'fileNavigation finished', filesPath, status, error);
577+
// this.state.finish(filesPath, status, error);
540578

541-
// remove and close file navigation
542-
this.close();
543-
}
579+
// // remove and close file navigation
580+
// this.close();
581+
// }
544582
}
545583
getCurrentDirectory() {
546584
return vpKernel.getCurrentDirectory();
@@ -588,31 +626,6 @@ define([
588626
return a - b;
589627
});
590628

591-
/**
592-
* Filter file/dir which included in this.state.extensions
593-
*/
594-
if (Array.isArray(that.state.extensions) && that.state.extensions.length > 0 && that.state.extensions.toString() !== '') {
595-
filtered_varList = filtered_varList.filter((data, index) => {
596-
if (index == 0) {
597-
return true;
598-
}
599-
600-
if (data.type && data.type == 'dir') {
601-
// if file, just show
602-
return true;
603-
} else if (data.name) {
604-
var extension = data.name.substring(data.name.lastIndexOf('.') + 1);
605-
if (that.state.extensions.includes(extension)) {
606-
return true;
607-
} else {
608-
return false;
609-
}
610-
} else {
611-
return false;
612-
}
613-
});
614-
}
615-
616629
vpLog.display(VP_LOG_TYPE.DEVELOP, 'FileNavigation - getFileList: ', filtered_varList);
617630

618631
var { currentDirStr, currentRelativePathStr } = that.splitPathStrAndSetStack(dirObj, filtered_varList);

0 commit comments

Comments
 (0)