Skip to content

Commit d4a1346

Browse files
author
minjk-bl
committed
Fix Visualization apps
1 parent a656dbe commit d4a1346

File tree

5 files changed

+20
-25
lines changed

5 files changed

+20
-25
lines changed

html/m_apps/frame.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<div class="vp-fe-menu-item vp-fe-menu-drop" data-type="3">Drop<i class="fa fa-caret-right"
55
style="padding-left: 5px;"></i>
66
<div class="vp-fe-menu-sub-box" style="top: 0px;">
7-
<div class="vp-fe-menu-item vp-fe-menu-drop" data-type="3">Drop Columns</div>
7+
<div class="vp-fe-menu-item vp-fe-menu-drop" data-type="3" data-axis="col">Drop Columns</div>
8+
<div class="vp-fe-menu-item vp-fe-menu-drop" data-type="3" data-axis="row">Drop Rows</div>
89
<div class="vp-fe-menu-item vp-fe-menu-drop-na" data-type="4">Drop NA</div>
910
<div class="vp-fe-menu-item vp-fe-menu-drop-duplicate" data-type="5" data-axis="col">Drop Duplicates</div>
1011
<div class="vp-fe-menu-item vp-fe-menu-drop-outlier" data-type="11" data-axis="col">Drop Outlier</div>

html/m_visualize/seaborn.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@
121121
<!-- STYLE: grid / marker / color -->
122122
<label for="color" class="vp-bold">Color</label>
123123
<div>
124-
<label><input type="checkbox" id="useColor" class="vp-state"/><span></span></label>
124+
<label><input type="checkbox" id="useColor" class="vp-state"/><span>Use Color</span></label>
125125
<input type="color" id="color" class="vp-state" disabled/>
126126
</div>
127+
<hr style="margin:5px;"/>
127128
<label for="useGrid" class="vp-bold">Grid</label>
128129
<div>
129130
<select id="useGrid" class="vp-select vp-state">
@@ -133,6 +134,7 @@
133134
</select>
134135
<input type="color" id="gridColor" class="vp-state"/>
135136
</div>
137+
<hr style="margin:5px;"/>
136138
<label for="useMarker" class="vp-bold">Marker</label>
137139
<div class="vp-grid-col-p50">
138140
<select id="markerStyle" class="vp-select vp-state">

html/m_visualize/wordCloud.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313
<div class="vp-tab-page-box vp-grid-border-box vp-scrollbar">
1414
<div class="vp-tab-page vp-grid-box" data-type="data">
1515
<label for="data" class="vp-bold">Data</label>
16-
<div class="vp-grid-col-p50">
17-
<div>
18-
<input type="text" id="data" class="vp-input vp-state"/>
19-
<div id="vp_wcOpenFile" class="vp-file-browser-button"></div>
20-
</div>
21-
<label><input type="checkbox" id="useFile" class="vp-state"><span>Use file</span></label>
16+
<div>
17+
<input type="text" id="data" class="vp-input vp-state"/>
18+
<div id="vp_wcOpenFile" class="vp-file-browser-button" style="margin-left:0px;"></div>
2219
</div>
2320

2421
<div class="vp-wc-file-option vp-grid-box">

js/m_visualize/Seaborn.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ define([
5151
legendPos: '',
5252
// style options
5353
useColor: false,
54-
color: '',
54+
color: '#000000',
5555
useGrid: '',
56-
gridColor: '',
56+
gridColor: '#000000',
5757
markerStyle: '',
5858
// setting options
5959
x_limit_from: '',
@@ -199,6 +199,7 @@ define([
199199

200200
// use color or not
201201
$(this.wrapSelector('#useColor')).on('change', function() {
202+
that.state.useColor = $(this).prop('checked');
202203
$(that.wrapSelector('#color')).prop('disabled', $(this).prop('checked') == false);
203204
});
204205

js/m_visualize/WordCloud.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,28 +59,18 @@ define([
5959
finish: function(filesPath, status, error) {
6060
let {file, path} = filesPath[0];
6161
that.state.data = path;
62+
6263
that.state.useFile = true;
64+
$(that.wrapSelector('.vp-wc-file-option')).show();
6365

6466
// set text
6567
$(that.wrapSelector('#data')).val(path);
66-
$(that.wrapSelector('#useFile')).prop('checked', true);
6768
$(that.wrapSelector('#data')).trigger('change');
68-
$(that.wrapSelector('#useFile')).trigger('change');
6969
}
7070
});
7171
fileNavi.open();
7272
});
7373

74-
// use file
75-
$(this.wrapSelector('#useFile')).on('change', function() {
76-
let checked = $(this).prop('checked');
77-
if (checked) {
78-
$(that.wrapSelector('.vp-wc-file-option')).show();
79-
} else {
80-
$(that.wrapSelector('.vp-wc-file-option')).hide();
81-
}
82-
})
83-
8474
// change tab
8575
$(this.wrapSelector('.vp-tab-item')).on('click', function() {
8676
let type = $(this).data('type'); // data / wordcloud / plot
@@ -136,7 +126,14 @@ define([
136126
pageThis: this,
137127
id: 'data',
138128
classes: 'vp-state',
129+
select: function() {
130+
that.state.useFile = false;
131+
$(that.wrapSelector('.vp-wc-file-option')).hide();
132+
},
139133
finish: function() {
134+
that.state.useFile = false;
135+
$(that.wrapSelector('.vp-wc-file-option')).hide();
136+
140137
$(that.wrapSelector('#data')).change();
141138
}
142139
});
@@ -271,9 +268,6 @@ define([
271268
if (dataType == 'DataFrame' || dataType == 'Series') {
272269
dataVariable = data + '.to_string()';
273270
}
274-
if (dataType == 'ndarray') {
275-
dataVariable = data + '.tobytes()'; // FIXME: use tobytes instead?
276-
}
277271
code.appendFormatLine("counts = Counter({0}.split())", dataVariable);
278272
code.appendFormatLine("tags = counts.most_common({0})", wordCount);
279273
code.appendLine();

0 commit comments

Comments
 (0)