Skip to content

Commit 229b407

Browse files
author
minjk-bl
committed
Fix Visualization menus
1 parent 552dab7 commit 229b407

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

html/m_visualize/seaborn.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
</div>
3737
</div>
3838
</div> -->
39-
<div class="vp-chart-body" style="margin-top:10px;">
39+
<!-- <div class="vp-chart-body" style="margin-top:10px;"> -->
40+
<div class="vp-chart-body" >
4041
<div class="vp-chart-left-box">
4142
<div class="vp-tab-bar figure" data-level="figure">
4243
<div class="vp-tab-item vp-focus" data-type="1">Plot</div>
@@ -119,7 +120,10 @@
119120
<div class="vp-tab-page vp-grid-box" data-type="style" style="display: none;">
120121
<!-- STYLE: grid / marker / color -->
121122
<label for="color" class="vp-bold">Color</label>
122-
<input type="color" id="color" class="vp-state"/>
123+
<div>
124+
<label><input type="checkbox" id="useColor" class="vp-state"/><span></span></label>
125+
<input type="color" id="color" class="vp-state" disabled/>
126+
</div>
123127
<label for="useGrid" class="vp-bold">Grid</label>
124128
<div>
125129
<select id="useGrid" class="vp-select vp-state">

js/m_visualize/ChartSetting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define([
3131
this.state = {
3232
figureWidth: 12,
3333
figureHeight: 8,
34-
styleSheet: 'seaborn-darkgrid',
34+
styleSheet: '',
3535
fontName: '',
3636
fontSize: 10,
3737
...this.state

js/m_visualize/Seaborn.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ define([
5050
y_label: '',
5151
legendPos: '',
5252
// style options
53+
useColor: false,
5354
color: '',
5455
useGrid: '',
5556
gridColor: '',
@@ -196,6 +197,11 @@ define([
196197
}
197198
});
198199

200+
// use color or not
201+
$(this.wrapSelector('#useColor')).on('change', function() {
202+
$(that.wrapSelector('#color')).prop('disabled', $(this).prop('checked') == false);
203+
});
204+
199205
// preview refresh
200206
$(this.wrapSelector('#previewRefresh')).on('click', function() {
201207
that.loadPreview();
@@ -517,7 +523,7 @@ define([
517523
let {
518524
chartType, data, userOption='',
519525
title, x_label, y_label, legendPos,
520-
color, useGrid, gridColor, markerStyle,
526+
useColor, color, useGrid, gridColor, markerStyle,
521527
x_limit_from, x_limit_to, y_limit_from, y_limit_to,
522528
useSampling, sampleCount
523529
} = this.state;
@@ -530,7 +536,7 @@ define([
530536
let chartCode = new com_String();
531537

532538
let etcOptionCode = []
533-
if (color != '') {
539+
if (useColor == true && color != '') {
534540
etcOptionCode.push(com_util.formatString("color='{0}'", color));
535541
}
536542
if (markerStyle != '') {
@@ -577,7 +583,7 @@ define([
577583
if (useGrid != '') {
578584
gridCodeList.push(useGrid);
579585
}
580-
if (gridColor != '') {
586+
if (useGrid == 'True' && gridColor != '') {
581587
gridCodeList.push(com_util.formatString("color='{0}'", gridColor));
582588
}
583589
if (gridCodeList.length > 0) {

0 commit comments

Comments
 (0)