sea-chart 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/color-popover/color-selector-popover.js +4 -4
- package/dist/components/color-setting/color-group-selector.js +2 -2
- package/dist/settings/bar-settings/style-settings.js +1 -1
- package/dist/settings/basic-number-card/data-settings.js +15 -5
- package/dist/settings/heat-map-settings/style-settings.js +3 -5
- package/dist/settings/stacks-settings/index.js +2 -2
- package/dist/settings/table-settings/data-settings.js +21 -24
- package/dist/settings/widgets/color-settings/index.css +41 -67
- package/dist/settings/widgets/color-settings/{color-use-type-selector.js → index.js} +13 -14
- package/dist/settings/widgets/numeric-summary-item.js +12 -5
- package/dist/utils/chart-utils/base-utils.js +50 -23
- package/dist/utils/chart-utils/original-data-utils/index.js +4 -4
- package/dist/utils/chart-utils/sql-statistics-utils.js +232 -120
- package/dist/utils/sql/chart-data-sql.js +77 -42
- package/dist/utils/sql/column-2-sql-column.js +72 -59
- package/dist/view/wrapper/bar-custom.js +1 -1
- package/dist/view/wrapper/bar-group.js +1 -1
- package/dist/view/wrapper/bar.js +1 -1
- package/dist/view/wrapper/basic-number-card.js +1 -1
- package/dist/view/wrapper/completeness.js +1 -1
- package/dist/view/wrapper/horizontal-bar-group.js +1 -1
- package/dist/view/wrapper/horizontal-bar.js +1 -1
- package/dist/view/wrapper/table/index.css +27 -0
- package/dist/view/wrapper/table/two-dimension-table.js +89 -31
- package/package.json +5 -4
|
@@ -41,14 +41,14 @@ class ColorSelectorPopover extends Component {
|
|
|
41
41
|
target: target,
|
|
42
42
|
placement: placement || 'auto-start',
|
|
43
43
|
hideArrow: hideArrow,
|
|
44
|
-
popoverClassName: "
|
|
44
|
+
popoverClassName: "sea-chart-color-selector",
|
|
45
45
|
hideDTablePopover: this.props.toggle,
|
|
46
46
|
hideDTablePopoverWithEsc: this.props.toggle
|
|
47
47
|
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: "
|
|
48
|
+
className: "sea-chart-color-selector-wrapper"
|
|
49
49
|
}, this.colorOptions.map(colorOption => /*#__PURE__*/React.createElement("div", {
|
|
50
|
-
key: "
|
|
51
|
-
className: "
|
|
50
|
+
key: "sea-chart-color-option-".concat(colorOption.color),
|
|
51
|
+
className: "sea-chart-color-option",
|
|
52
52
|
onClick: () => this.onSelectColor(colorOption.color),
|
|
53
53
|
style: {
|
|
54
54
|
backgroundColor: colorOption.color,
|
|
@@ -11,10 +11,10 @@ class ColorGroupSelector extends Component {
|
|
|
11
11
|
return {
|
|
12
12
|
value: colorOption.name,
|
|
13
13
|
label: /*#__PURE__*/React.createElement("div", {
|
|
14
|
-
className: "
|
|
14
|
+
className: "sea-chart-color-option d-flex"
|
|
15
15
|
}, colorOption.exampleColors.map((color, index) => {
|
|
16
16
|
return /*#__PURE__*/React.createElement("span", {
|
|
17
|
-
className: "
|
|
17
|
+
className: "sea-chart-color-block",
|
|
18
18
|
key: index,
|
|
19
19
|
style: {
|
|
20
20
|
background: "".concat(color)
|
|
@@ -5,7 +5,7 @@ import Switch from '../widgets/switch';
|
|
|
5
5
|
import Divider from '../widgets/divider';
|
|
6
6
|
import MinMaxSetting from '../widgets/min-max-setting';
|
|
7
7
|
import DisplayValuesSettings from '../widgets/display-values-settings';
|
|
8
|
-
import ColorUseTypeSelector from '../widgets/color-settings
|
|
8
|
+
import ColorUseTypeSelector from '../widgets/color-settings';
|
|
9
9
|
import { eventStopPropagation } from '../../utils';
|
|
10
10
|
import { X_LABEL_POSITIONS, Y_LABEL_POSITIONS, LABEL_POSITION_TYPE_SHOW, CHART_TYPE } from '../../constants';
|
|
11
11
|
import intl from '../../intl';
|
|
@@ -4,7 +4,7 @@ import { COLUMNS_ICON_CONFIG, getTableById } from 'dtable-utils';
|
|
|
4
4
|
import DTableSelect from "dtable-ui-component/lib/DTableSelect";
|
|
5
5
|
import CommonDataSettings from '../widgets/common-data-settings';
|
|
6
6
|
import { BaseUtils } from '../../utils';
|
|
7
|
-
import { CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUPPORT_COLUMNS, CHART_Y_GROUP_TYPE } from '../../constants';
|
|
7
|
+
import { CHART_SUMMARY_SHOW, CHART_SUMMARY_CALCULATION_METHOD, CHART_SUPPORT_COLUMNS, CHART_Y_GROUP_TYPE, BASIC_NUMBER_CARD_CALCULATION_METHOD } from '../../constants';
|
|
8
8
|
import intl from '../../intl';
|
|
9
9
|
const DataSettings = _ref => {
|
|
10
10
|
let {
|
|
@@ -120,11 +120,21 @@ const DataSettings = _ref => {
|
|
|
120
120
|
const getSelectedMethodOption = useCallback((method, summaryMethodsOptions) => {
|
|
121
121
|
return summaryMethodsOptions.find(m => m.value === method) || summaryMethodsOptions[0];
|
|
122
122
|
}, []);
|
|
123
|
-
const selectedSummaryTypeOption = summaryTypeOptions.find(option => option.value === chart.config.summary_type) || summaryTypeOptions[0];
|
|
124
|
-
const isSummarizeAField = chart.config.summary_type === CHART_Y_GROUP_TYPE.SINGLE_NUMERIC_COLUMN;
|
|
125
123
|
const {
|
|
126
|
-
|
|
127
|
-
} = chart
|
|
124
|
+
config
|
|
125
|
+
} = chart;
|
|
126
|
+
const {
|
|
127
|
+
summary_method,
|
|
128
|
+
summary_type
|
|
129
|
+
} = config;
|
|
130
|
+
let selectedSummaryTypeOption;
|
|
131
|
+
if (!summary_type && summary_method === BASIC_NUMBER_CARD_CALCULATION_METHOD) {
|
|
132
|
+
selectedSummaryTypeOption = summaryTypeOptions[0];
|
|
133
|
+
} else {
|
|
134
|
+
// normal case is summary_type exists, but if not and summary_method is not "COUNT", then it's "SINGLE_NUMERIC_COLUMN"
|
|
135
|
+
selectedSummaryTypeOption = summaryTypeOptions.find(option => option.value === summary_type) || summaryTypeOptions[1];
|
|
136
|
+
}
|
|
137
|
+
const isSummarizeAField = chart.config.summary_type === CHART_Y_GROUP_TYPE.SINGLE_NUMERIC_COLUMN;
|
|
128
138
|
const selectedMethodOption = getSelectedMethodOption(summary_method, summaryMethodsOptions);
|
|
129
139
|
let selectedColumnOption;
|
|
130
140
|
if (isSummarizeAField) {
|
|
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
|
|
|
2
2
|
import { Label, FormGroup } from 'reactstrap';
|
|
3
3
|
import Divider from '../widgets/divider';
|
|
4
4
|
import { PixelEditor } from '../../components';
|
|
5
|
-
import ColorUseTypeSelector from '../widgets/color-settings
|
|
5
|
+
import ColorUseTypeSelector from '../widgets/color-settings';
|
|
6
6
|
import { DEFAULT_GRID_SIZE, DEFAULT_GRID_DISTANCE } from '../../constants';
|
|
7
7
|
import intl from '../../intl';
|
|
8
8
|
const StyleSettings = _ref => {
|
|
@@ -43,13 +43,11 @@ const StyleSettings = _ref => {
|
|
|
43
43
|
grid_distance,
|
|
44
44
|
grid_size
|
|
45
45
|
} = config;
|
|
46
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
47
|
-
className: "sea-chart-parameter-item"
|
|
48
|
-
}, /*#__PURE__*/React.createElement(ColorUseTypeSelector, {
|
|
46
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorUseTypeSelector, {
|
|
49
47
|
chart: config,
|
|
50
48
|
labelColorConfigs: labelColorConfigs,
|
|
51
49
|
updateChart: onColorChange
|
|
52
|
-
})
|
|
50
|
+
}), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(FormGroup, {
|
|
53
51
|
className: "sea-chart-parameter-item"
|
|
54
52
|
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Grid_size')), /*#__PURE__*/React.createElement(PixelEditor, {
|
|
55
53
|
pixel: grid_size,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component, Fragment } from 'react';
|
|
2
2
|
import intl from '../../intl';
|
|
3
|
-
import StackItemSettings from './stack-item-settings';
|
|
4
3
|
import { CHART_SUMMARY_SHOW, CHART_TYPE, CHART_SUMMARY_CALCULATION_METHOD } from '../../constants';
|
|
4
|
+
import StackItemSettings from './stack-item-settings';
|
|
5
5
|
import './index.css';
|
|
6
6
|
class StacksSettings extends Component {
|
|
7
7
|
constructor(props) {
|
|
@@ -223,7 +223,7 @@ class StacksSettings extends Component {
|
|
|
223
223
|
summaryMethodsOptions: this.summaryMethodsOptions,
|
|
224
224
|
deleteStack: () => this.deleteStack(index),
|
|
225
225
|
addNumericSummary: () => this.addStackNumericSummary(index),
|
|
226
|
-
modifyGroupbyNumericColumn: (columnOption,
|
|
226
|
+
modifyGroupbyNumericColumn: (columnOption, numericColumnIndex, prevColumnOption, currentAxisesIndex) => this.modifyStackGroupbyNumericColumn(index, {
|
|
227
227
|
numericColumnIndex,
|
|
228
228
|
columnOption
|
|
229
229
|
}, prevColumnOption, currentAxisesIndex),
|
|
@@ -30,7 +30,7 @@ const DataSettings = _ref => {
|
|
|
30
30
|
const {
|
|
31
31
|
columns
|
|
32
32
|
} = selectedTable;
|
|
33
|
-
return columns.filter(column => BaseUtils.isNumericSummaryColumn(column)
|
|
33
|
+
return columns.filter(column => BaseUtils.isNumericSummaryColumn(column));
|
|
34
34
|
}, [selectedTable]);
|
|
35
35
|
const numericColumnOptions = useMemo(() => {
|
|
36
36
|
return numericColumns.map(column => {
|
|
@@ -47,9 +47,6 @@ const DataSettings = _ref => {
|
|
|
47
47
|
});
|
|
48
48
|
}, [numericColumns]);
|
|
49
49
|
const groupTypeOptions = useMemo(() => {
|
|
50
|
-
const {
|
|
51
|
-
column_groupby_column_key
|
|
52
|
-
} = chart.config;
|
|
53
50
|
let options = [{
|
|
54
51
|
value: CHART_Y_GROUP_TYPE.COUNT,
|
|
55
52
|
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -64,19 +61,16 @@ const DataSettings = _ref => {
|
|
|
64
61
|
}, intl.get(CHART_SUMMARY_SHOW['advanced'])), /*#__PURE__*/React.createElement("div", {
|
|
65
62
|
className: "summary-type-explanation"
|
|
66
63
|
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_a_field')))
|
|
64
|
+
}, {
|
|
65
|
+
value: CHART_Y_GROUP_TYPE.MULTIPLE_NUMERIC_COLUMN,
|
|
66
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: "select-module select-module-name ml-0"
|
|
68
|
+
}, intl.get('Summarize_multiple_fields')), /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: "summary-type-explanation"
|
|
70
|
+
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_multiple_fields')))
|
|
67
71
|
}];
|
|
68
|
-
if (!column_groupby_column_key) {
|
|
69
|
-
options.push({
|
|
70
|
-
value: CHART_Y_GROUP_TYPE.MULTIPLE_NUMERIC_COLUMN,
|
|
71
|
-
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
72
|
-
className: "select-module select-module-name ml-0"
|
|
73
|
-
}, intl.get('Summarize_multiple_fields')), /*#__PURE__*/React.createElement("div", {
|
|
74
|
-
className: "summary-type-explanation"
|
|
75
|
-
}, intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_multiple_fields')))
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
72
|
return options;
|
|
79
|
-
}, [
|
|
73
|
+
}, []);
|
|
80
74
|
const onGroupByColumnChange = useCallback(option => {
|
|
81
75
|
const {
|
|
82
76
|
config
|
|
@@ -264,9 +258,9 @@ const DataSettings = _ref => {
|
|
|
264
258
|
summary_type = CHART_SUMMARY_TYPE.ADVANCED;
|
|
265
259
|
column_groupby_multiple_numeric_column = true;
|
|
266
260
|
summary_columns = [];
|
|
267
|
-
column_groupby_column_key = null;
|
|
268
|
-
column_groupby_date_granularity = null;
|
|
269
|
-
column_groupby_geolocation_granularity = null;
|
|
261
|
+
// column_groupby_column_key = null;
|
|
262
|
+
// column_groupby_date_granularity = null;
|
|
263
|
+
// column_groupby_geolocation_granularity = null;
|
|
270
264
|
summary_method = summary_method || CHART_SUMMARY_CALCULATION_METHOD[0];
|
|
271
265
|
summary_column_key = null;
|
|
272
266
|
if (numericColumns && numericColumns[0]) {
|
|
@@ -295,9 +289,9 @@ const DataSettings = _ref => {
|
|
|
295
289
|
summary_type,
|
|
296
290
|
column_groupby_column_key
|
|
297
291
|
} = config;
|
|
298
|
-
if (summary_type === CHART_SUMMARY_TYPE.ADVANCED && column_groupby_column_key) {
|
|
299
|
-
|
|
300
|
-
}
|
|
292
|
+
// if (summary_type === CHART_SUMMARY_TYPE.ADVANCED && column_groupby_column_key) {
|
|
293
|
+
// return groupTypeOptions[1];
|
|
294
|
+
// }
|
|
301
295
|
if (column_groupby_multiple_numeric_column) {
|
|
302
296
|
return groupTypeOptions.find(item => item.value === CHART_Y_GROUP_TYPE.MULTIPLE_NUMERIC_COLUMN);
|
|
303
297
|
}
|
|
@@ -454,10 +448,13 @@ const DataSettings = _ref => {
|
|
|
454
448
|
} = config;
|
|
455
449
|
if (summary_type !== CHART_SUMMARY_TYPE.ADVANCED) return null;
|
|
456
450
|
if (column_groupby_multiple_numeric_column) {
|
|
457
|
-
const columnGroupbyColumn = getTableColumnByKey(selectedTable, column_groupby_column_key);
|
|
451
|
+
// const columnGroupbyColumn = getTableColumnByKey(selectedTable, column_groupby_column_key);
|
|
458
452
|
const usedSummaryColumnKeys = Array.isArray(summary_columns) ? summary_columns.map(item => item.column_key) : [];
|
|
459
453
|
const unUsedSummaryColumns = numericColumns.filter(column => column.key !== summary_column_key && !usedSummaryColumnKeys.includes(column.key));
|
|
460
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
454
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
455
|
+
/*#__PURE__*/
|
|
456
|
+
// !columnGroupbyColumn &&
|
|
457
|
+
React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
461
458
|
index: 0,
|
|
462
459
|
value: {
|
|
463
460
|
column_key: summary_column_key,
|
|
@@ -490,7 +487,7 @@ const DataSettings = _ref => {
|
|
|
490
487
|
summaryColumnKey: 'summary_column_key',
|
|
491
488
|
onChange: onChange
|
|
492
489
|
});
|
|
493
|
-
}, [chart, tables,
|
|
490
|
+
}, [chart, tables, onChange, numericColumns, numericColumnOptions, onGroupbyNumericColumnChange, onSummaryMethodChange, renderGroupbyNumericColumns, onAddNumericColumn]);
|
|
494
491
|
const {
|
|
495
492
|
config
|
|
496
493
|
} = chart;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* specific color */
|
|
2
|
-
.
|
|
2
|
+
.sea-chart-color-type-selector .selected-specific-color {
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.
|
|
7
|
+
.sea-chart-color-type-selector .selected-specific-color-wrapper {
|
|
8
8
|
position: relative;
|
|
9
9
|
width: 100%;
|
|
10
10
|
line-height: 2.375rem;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
13
|
+
.sea-chart-color-type-selector .specific-color-show {
|
|
14
14
|
position: absolute;
|
|
15
15
|
display: inline-block;
|
|
16
16
|
width: 24px;
|
|
@@ -23,87 +23,76 @@
|
|
|
23
23
|
cursor: pointer;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.sea-chart-color-type-selector .specific-color-input {
|
|
27
27
|
padding-left: calc(1.25rem + 24px);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.
|
|
30
|
+
.sea-chart-color-type-selector .specific-color-input:hover {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
border-color: rgb(179, 179, 179)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sea-chart-color-type-selector .specific-color-input:focus {
|
|
36
|
+
border-color: #1991eb !important;
|
|
37
|
+
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.sea-chart-color-type-selector .specific-color-text {
|
|
31
41
|
flex: 1;
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
/* color rules */
|
|
35
|
-
.
|
|
45
|
+
.sea-chart-color-type-selector .sea-chart-color-rules-toggle {
|
|
36
46
|
display: flex;
|
|
37
47
|
justify-content: center;
|
|
38
48
|
align-items: center;
|
|
39
49
|
height: 38px;
|
|
40
50
|
padding: 0 10px;
|
|
41
|
-
border-radius:
|
|
42
|
-
border: 1px solid
|
|
51
|
+
border-radius: 3px;
|
|
52
|
+
border: 1px solid rgba(0, 40, 100, .12);
|
|
43
53
|
cursor: pointer;
|
|
44
54
|
user-select: none;
|
|
45
55
|
background-color: #fff;
|
|
46
56
|
}
|
|
47
57
|
|
|
48
|
-
.
|
|
49
|
-
|
|
58
|
+
.sea-chart-color-type-selector .sea-chart-color-rules-toggle:hover {
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
border-color: rgb(179, 179, 179)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sea-chart-color-type-selector .sea-chart-color-rules-toggle:focus {
|
|
64
|
+
border-color: #1991eb !important;
|
|
65
|
+
box-shadow: 0 0 0 2px rgba(70, 127, 207, 0.25);
|
|
50
66
|
}
|
|
51
67
|
|
|
52
|
-
.
|
|
53
|
-
|
|
68
|
+
.sea-chart-color-type-selector .sea-chart-color-rules-toggle.sea-chart-edit-color-rule {
|
|
69
|
+
justify-content: space-between;
|
|
54
70
|
}
|
|
55
71
|
|
|
56
|
-
.
|
|
72
|
+
.sea-chart-color-type-selector .sea-chart-color-rules-toggle .dtable-icon-add-table {
|
|
57
73
|
font-size: 14px;
|
|
58
74
|
font-weight: 600;
|
|
59
75
|
color: #555;
|
|
60
76
|
}
|
|
61
77
|
|
|
62
|
-
.
|
|
78
|
+
.sea-chart-color-type-selector .sea-chart-color-rules-toggle .dtable-icon-rename {
|
|
63
79
|
color: #999;
|
|
64
80
|
}
|
|
65
81
|
|
|
66
|
-
/* common add btn */
|
|
67
|
-
.statistic-add-item-btn {
|
|
68
|
-
display: flex;
|
|
69
|
-
align-items: center;
|
|
70
|
-
height: 40px;
|
|
71
|
-
font-size: 14px;
|
|
72
|
-
font-weight: 500;
|
|
73
|
-
border-top: 1px solid #dedede;
|
|
74
|
-
background: #fff;
|
|
75
|
-
padding: 0 1rem;
|
|
76
|
-
border-bottom-left-radius: 3px;
|
|
77
|
-
border-bottom-right-radius: 3px;
|
|
78
|
-
position: relative;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.statistic-add-item-btn:hover {
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
background: #f5f5f5;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.statistic-add-item-btn .dtable-icon-add-table {
|
|
87
|
-
margin-right: 10px;
|
|
88
|
-
font-size: 12px;
|
|
89
|
-
font-weight: 600;
|
|
90
|
-
transform: none;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
82
|
/* color selector */
|
|
94
|
-
.
|
|
83
|
+
.sea-chart-color-selector .popover {
|
|
95
84
|
max-width: 425px;
|
|
96
85
|
}
|
|
97
86
|
|
|
98
|
-
.
|
|
87
|
+
.sea-chart-color-selector .colorinput-input:checked ~ .colorinput-color:before {
|
|
99
88
|
display: none;
|
|
100
89
|
}
|
|
101
90
|
|
|
102
|
-
.
|
|
91
|
+
.sea-chart-color-selector .col-auto {
|
|
103
92
|
padding-left: 3px;
|
|
104
93
|
}
|
|
105
94
|
|
|
106
|
-
.
|
|
95
|
+
.sea-chart-color-selector-wrapper {
|
|
107
96
|
width: 356px;
|
|
108
97
|
padding: 10px 10px 12px;
|
|
109
98
|
background-color: #fff;
|
|
@@ -113,14 +102,14 @@
|
|
|
113
102
|
flex-wrap: wrap;
|
|
114
103
|
}
|
|
115
104
|
|
|
116
|
-
.
|
|
105
|
+
.sea-chart-color-option {
|
|
117
106
|
padding: 1px;
|
|
118
107
|
background: #fff;
|
|
119
108
|
border: 1px solid #fff;
|
|
120
109
|
border-radius: 3px;
|
|
121
110
|
}
|
|
122
111
|
|
|
123
|
-
.
|
|
112
|
+
.sea-chart-color-selector .sea-chart-color-option {
|
|
124
113
|
height: 20px;
|
|
125
114
|
width: 20px;
|
|
126
115
|
margin: 4px;
|
|
@@ -133,45 +122,30 @@
|
|
|
133
122
|
cursor: pointer;
|
|
134
123
|
}
|
|
135
124
|
|
|
136
|
-
.
|
|
125
|
+
.sea-chart-color-selector .sea-chart-color-option .dtable-font {
|
|
137
126
|
display: inline-block;
|
|
138
127
|
transform: scale(.6);
|
|
139
128
|
}
|
|
140
129
|
|
|
141
|
-
.
|
|
130
|
+
.sea-chart-color-block {
|
|
142
131
|
width: 26px;
|
|
143
132
|
height: 24px;
|
|
144
133
|
}
|
|
145
134
|
|
|
146
|
-
.
|
|
135
|
+
.sea-chart-color-block:first-child {
|
|
147
136
|
border-top-left-radius: 2px;
|
|
148
137
|
border-bottom-left-radius: 2px;
|
|
149
138
|
}
|
|
150
139
|
|
|
151
|
-
.
|
|
140
|
+
.sea-chart-color-block:last-child {
|
|
152
141
|
border-top-right-radius: 2px;
|
|
153
142
|
border-bottom-right-radius: 2px;
|
|
154
143
|
}
|
|
155
144
|
|
|
156
|
-
.
|
|
145
|
+
.sea-chart-color-type-selector .stack-settings-content-wrapper {
|
|
157
146
|
padding-left: 19px;
|
|
158
147
|
}
|
|
159
148
|
|
|
160
|
-
.statistic-stack-setting {
|
|
161
|
-
padding-bottom: 14px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/* seatable-radio */
|
|
165
|
-
.statistic-panel .seatable-radio .seatable-radio-description {
|
|
166
|
-
line-height: 16px;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/* column-formatter */
|
|
170
|
-
.statistic-chart-container .single-select-option,
|
|
171
|
-
.statistic-chart-container .multiple-select-option {
|
|
172
|
-
margin: 0 !important;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
149
|
.statistic-chart-container .collaborators-formatter .collaborator {
|
|
176
150
|
margin-right: 0 !important;
|
|
177
151
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { Input } from 'reactstrap';
|
|
3
|
+
import { Input, FormGroup, Label } from 'reactstrap';
|
|
4
4
|
import ReactColor from 'react-color';
|
|
5
|
-
import
|
|
5
|
+
import DTableCustomizeSelect from "dtable-ui-component/lib/DTableCustomizeSelect";
|
|
6
6
|
import intl from '../../../intl';
|
|
7
7
|
import ColorRulesPopover from '../../../components/color-popover/color-rules-popover';
|
|
8
8
|
import { getValidColorRules } from '../../../utils/color-utils';
|
|
@@ -19,11 +19,11 @@ class ColorUseTypeSelector extends Component {
|
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
21
21
|
this.getPopoverStyle = () => {
|
|
22
|
-
if (!this.
|
|
22
|
+
if (!this.colorSpecialContainerRef) return {};
|
|
23
23
|
const {
|
|
24
24
|
top,
|
|
25
25
|
height
|
|
26
|
-
} = this.
|
|
26
|
+
} = this.colorSpecialContainerRef.getBoundingClientRect();
|
|
27
27
|
const {
|
|
28
28
|
clientHeight
|
|
29
29
|
} = document.body;
|
|
@@ -155,10 +155,7 @@ class ColorUseTypeSelector extends Component {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
this.onSelectColorOption =
|
|
159
|
-
let {
|
|
160
|
-
value: color_option
|
|
161
|
-
} = _ref;
|
|
158
|
+
this.onSelectColorOption = color_option => {
|
|
162
159
|
const {
|
|
163
160
|
chart,
|
|
164
161
|
labelColorConfigs
|
|
@@ -269,7 +266,7 @@ class ColorUseTypeSelector extends Component {
|
|
|
269
266
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
270
267
|
id: id,
|
|
271
268
|
className: "selected-specific-color mt-1",
|
|
272
|
-
ref: ref => this.
|
|
269
|
+
ref: ref => this.colorSpecialContainerRef = ref
|
|
273
270
|
}, /*#__PURE__*/React.createElement("div", {
|
|
274
271
|
className: "selected-specific-color-wrapper"
|
|
275
272
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -314,7 +311,9 @@ class ColorUseTypeSelector extends Component {
|
|
|
314
311
|
}
|
|
315
312
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
316
313
|
id: id,
|
|
317
|
-
className: classnames('
|
|
314
|
+
className: classnames('sea-chart-color-rules-toggle', 'mt-1', hasRules ? 'sea-chart-edit-color-rule' : 'sea-chart-add-color-rule'),
|
|
315
|
+
tabIndex: "0",
|
|
316
|
+
ref: ref => this.colorRulesContainerRef = ref,
|
|
318
317
|
onClick: this.showColorRulesEditor
|
|
319
318
|
}, hasRules ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, msg), /*#__PURE__*/React.createElement("i", {
|
|
320
319
|
className: "dtable-font dtable-icon-rename"
|
|
@@ -347,12 +346,12 @@ class ColorUseTypeSelector extends Component {
|
|
|
347
346
|
color_option
|
|
348
347
|
} = chart;
|
|
349
348
|
const selectedColorOption = this.colorOptions.find(colorOption => colorOption.value === color_option) || this.colorOptions[0];
|
|
350
|
-
return /*#__PURE__*/React.createElement(
|
|
351
|
-
className: "
|
|
352
|
-
}, /*#__PURE__*/React.createElement(
|
|
349
|
+
return /*#__PURE__*/React.createElement(FormGroup, {
|
|
350
|
+
className: "sea-chart-color-type-selector"
|
|
351
|
+
}, /*#__PURE__*/React.createElement(Label, null, intl.get('Color')), /*#__PURE__*/React.createElement(DTableCustomizeSelect, {
|
|
353
352
|
value: selectedColorOption,
|
|
354
353
|
options: this.colorOptions,
|
|
355
|
-
|
|
354
|
+
onSelectOption: this.onSelectColorOption
|
|
356
355
|
}), color_option === TYPE_COLOR_USING.USE_SPECIFIC_COLORS && this.renderSpecificColorSelector(), color_option === TYPE_COLOR_USING.USE_RULES && this.renderColorRulesEditor());
|
|
357
356
|
}
|
|
358
357
|
}
|
|
@@ -64,12 +64,19 @@ class NumericSummaryItem extends Component {
|
|
|
64
64
|
onDeleteNumericColumn,
|
|
65
65
|
removeCurrentSelectedOptions,
|
|
66
66
|
setCurrentSelectedOptions,
|
|
67
|
-
currentAxisesIndex
|
|
67
|
+
currentAxisesIndex,
|
|
68
|
+
onDelete
|
|
68
69
|
} = this.props;
|
|
69
70
|
// remove current selected options on selectedColumnOption list
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
if (this.selectedColumnOption) {
|
|
72
|
+
removeCurrentSelectedOptions(this.selectedColumnOption.column, currentAxisesIndex);
|
|
73
|
+
setCurrentSelectedOptions();
|
|
74
|
+
}
|
|
75
|
+
if (onDelete) {
|
|
76
|
+
onDelete(index);
|
|
77
|
+
} else {
|
|
78
|
+
onDeleteNumericColumn(index);
|
|
79
|
+
}
|
|
73
80
|
};
|
|
74
81
|
this.state = {
|
|
75
82
|
isExpand: true
|
|
@@ -124,7 +131,7 @@ class NumericSummaryItem extends Component {
|
|
|
124
131
|
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
125
132
|
value: selectedColumnOption,
|
|
126
133
|
placeholder: intl.get('Select_a_column'),
|
|
127
|
-
onChange: option => this.props.onColumnOptionChange(option,
|
|
134
|
+
onChange: option => this.props.onColumnOptionChange(option, index, selectedColumnOption, currentAxisesIndex),
|
|
128
135
|
options: availableOptions,
|
|
129
136
|
style: {
|
|
130
137
|
color: '#6e7687'
|