dtable-statistic 4.3.3 → 4.3.4
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/es/api/dtable-db-api.js +3 -10
- package/es/calculator/base-calculator.js +12 -20
- package/es/calculator/basic-chart-calculator.js +65 -72
- package/es/calculator/combination-calculator.js +57 -64
- package/es/calculator/compare-bar-calculator.js +26 -33
- package/es/calculator/completeness-calculator.js +30 -37
- package/es/calculator/copy-value.js +1 -7
- package/es/calculator/dashboard-calculator.js +13 -20
- package/es/calculator/heat-map-calculator.js +18 -25
- package/es/calculator/horizontal-bar-calculator.js +8 -15
- package/es/calculator/index.js +35 -42
- package/es/calculator/map-calculator.js +22 -29
- package/es/calculator/mirror-calculator.js +20 -27
- package/es/calculator/number-card-calculator.js +10 -17
- package/es/calculator/pivot-table-calculator.js +58 -65
- package/es/calculator/scatter-calculator.js +14 -21
- package/es/calculator/thread-manager.js +1 -7
- package/es/calculator/trend-calculator.js +22 -29
- package/es/calculator/workers/basic-chart-calculator-worker.js +76 -83
- package/es/calculator/workers/calculator.worker.js +30 -33
- package/es/calculator/workers/card-calculator-worker.js +13 -19
- package/es/calculator/workers/combination-calculator-worker.js +46 -53
- package/es/calculator/workers/compare-bar-chart-calculator-worker.js +22 -29
- package/es/calculator/workers/completeness-calculator-worker.js +34 -41
- package/es/calculator/workers/dashboard-calculator-worker.js +18 -24
- package/es/calculator/workers/mirror-calculator-worker.js +22 -29
- package/es/calculator/workers/pivot-table-calculator-worker.js +77 -84
- package/es/calculator/workers/scatter-calculator-worker.js +20 -27
- package/es/calculator/workers/trend-calculator-worker.js +27 -34
- package/es/calculator/world-map-calculator.js +17 -24
- package/es/components/common-add-tool.js +5 -12
- package/es/components/dialog/chart-addition-edit-dialog.js +12 -20
- package/es/components/dialog/chart-addition-widgets/chart-selector.js +101 -108
- package/es/components/dialog/color-theme-dialog.js +15 -22
- package/es/components/dialog/delete-confirmation-dialog.js +11 -18
- package/es/components/dialog/enlarged-chart-dialog.js +20 -28
- package/es/components/dialog/new-table-dialog.js +16 -23
- package/es/components/dialog/new-view-dialog.js +14 -21
- package/es/components/dialog/rename-view-dialog.js +14 -22
- package/es/components/dialog/statistic-record-dialog/index.js +37 -45
- package/es/components/dialog/statistic-types-dialog/index.js +14 -22
- package/es/components/dialog/table-select-dialog.js +15 -23
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +41 -49
- package/es/components/dtable-popover.js +12 -19
- package/es/components/dtable-search-input.js +13 -21
- package/es/components/dtable-select.js +15 -21
- package/es/components/icon.js +4 -11
- package/es/components/index.js +11 -76
- package/es/components/loading.js +3 -10
- package/es/components/modal-portal.js +5 -12
- package/es/components/popover/color-rules/color-rule.js +25 -33
- package/es/components/popover/color-rules/index.js +6 -14
- package/es/components/popover/color-rules/rule-filters/filter.js +27 -34
- package/es/components/popover/color-rules/rule-filters/index.js +17 -25
- package/es/components/popover/color-rules/rule-filters/number-input.js +9 -17
- package/es/components/popover/color-rules-popover.js +24 -32
- package/es/components/popover/color-selector-popover.js +10 -17
- package/es/components/seatable-radio/index.js +9 -16
- package/es/components/select/index.js +2 -9
- package/es/components/select/option-group.js +19 -27
- package/es/components/select/option.js +6 -14
- package/es/components/select/select.js +17 -25
- package/es/components/toast/alert.js +24 -31
- package/es/components/toast/index.js +3 -10
- package/es/components/toast/toast.js +12 -20
- package/es/components/toast/toastManager.js +9 -17
- package/es/components/toast/toaster.js +6 -14
- package/es/constants/color-rules.js +6 -12
- package/es/constants/dtable-select-style.js +4 -9
- package/es/constants/event-types.js +4 -10
- package/es/constants/index.js +67 -96
- package/es/constants/key-codes.js +0 -2
- package/es/constants/map.js +2 -8
- package/es/constants/model.js +20 -26
- package/es/constants/regions.js +3 -8
- package/es/constants/zIndexes.js +1 -7
- package/es/custom-g2.js +208 -236
- package/es/dashboard.js +50 -58
- package/es/desktop-dashboard.js +47 -55
- package/es/index.js +3 -6
- package/es/locale/index.js +10 -13
- package/es/locale/lang/de.js +1 -7
- package/es/locale/lang/en.js +1 -7
- package/es/locale/lang/fr.js +1 -7
- package/es/locale/lang/zh_CN.js +1 -7
- package/es/mobile-dashboard.js +38 -46
- package/es/model/bar-group.js +11 -19
- package/es/model/bar.js +10 -18
- package/es/model/base-model.js +2 -9
- package/es/model/basic-number-card.js +8 -16
- package/es/model/collaborators.js +2 -9
- package/es/model/combination.js +12 -20
- package/es/model/compare-bar.js +16 -24
- package/es/model/completeness-group.js +8 -16
- package/es/model/completeness.js +5 -13
- package/es/model/custom-bar.js +6 -14
- package/es/model/dashboard.js +6 -14
- package/es/model/generic-model.js +133 -141
- package/es/model/heat-map.js +11 -19
- package/es/model/horizontal-bar-group.js +10 -18
- package/es/model/horizontal-bar.js +10 -18
- package/es/model/index.js +53 -185
- package/es/model/map.js +15 -23
- package/es/model/mirror.js +13 -21
- package/es/model/pie.js +10 -18
- package/es/model/ring.js +11 -19
- package/es/model/scatter.js +6 -14
- package/es/model/statistic-dashboard.js +2 -9
- package/es/model/table.js +10 -18
- package/es/model/trend.js +12 -20
- package/es/model/world-map.js +13 -21
- package/es/service/chart-service.js +7 -14
- package/es/service/dashboard-service.js +34 -41
- package/es/service/map-json.js +8 -14
- package/es/stat-editor/chart-name-editor.js +8 -15
- package/es/stat-editor/index.js +16 -24
- package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +21 -29
- package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +49 -57
- package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +4 -11
- package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/index.js +43 -51
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +37 -45
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +26 -34
- package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +47 -55
- package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +22 -30
- package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +27 -35
- package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +24 -32
- package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +33 -41
- package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +22 -30
- package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +27 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +46 -54
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +23 -31
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +26 -34
- package/es/stat-editor/stat-settings/basic-chart-settings/index.js +77 -85
- package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +21 -29
- package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +73 -81
- package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +16 -24
- package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +19 -27
- package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +49 -57
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +47 -55
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +11 -19
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +45 -53
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +9 -17
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +20 -28
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +30 -38
- package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +50 -58
- package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +47 -55
- package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +11 -19
- package/es/stat-editor/stat-settings/color-setting/color-picker.js +12 -19
- package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +62 -70
- package/es/stat-editor/stat-settings/map/map-level.js +13 -20
- package/es/stat-editor/stat-settings/map/map-province-city.js +20 -27
- package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/base-settings.js +20 -28
- package/es/stat-editor/stat-settings/public-setting/calender.js +22 -29
- package/es/stat-editor/stat-settings/public-setting/column-settings.js +6 -13
- package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +9 -16
- package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +13 -21
- package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +27 -35
- package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +18 -26
- package/es/stat-list/chart-preview.js +20 -28
- package/es/stat-list/index.js +27 -35
- package/es/stat-view/area-chart.js +43 -50
- package/es/stat-view/bar-chart.js +47 -54
- package/es/stat-view/base-chart.js +24 -32
- package/es/stat-view/basic-number-card.js +19 -26
- package/es/stat-view/combination-chart.js +49 -56
- package/es/stat-view/compare-chart.js +39 -46
- package/es/stat-view/completeness-chart.js +28 -35
- package/es/stat-view/custom-bar.js +31 -38
- package/es/stat-view/dashboard-chart.js +15 -22
- package/es/stat-view/heat-map.js +43 -50
- package/es/stat-view/horizontal-bar-chart.js +51 -58
- package/es/stat-view/index.js +73 -80
- package/es/stat-view/line-chart.js +39 -46
- package/es/stat-view/map.js +33 -40
- package/es/stat-view/mirror.js +21 -28
- package/es/stat-view/pie-chart.js +29 -36
- package/es/stat-view/pivot-table/index.js +32 -39
- package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +31 -39
- package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +29 -37
- package/es/stat-view/pivot-table/pivot-table-display-name.js +46 -54
- package/es/stat-view/pivot-table/two-dimension-table.js +62 -70
- package/es/stat-view/ring-chart.js +38 -45
- package/es/stat-view/scatter-chart.js +30 -37
- package/es/stat-view/treemap-chart.js +37 -44
- package/es/stat-view/trend-chart.js +32 -39
- package/es/stat-view/world-map.js +33 -40
- package/es/tabs/index.js +32 -40
- package/es/tabs/tab.js +26 -34
- package/es/utils/basic-chart-utils.js +2 -9
- package/es/utils/cell-format.js +14 -22
- package/es/utils/cell-value.js +7 -14
- package/es/utils/collaborator.js +4 -13
- package/es/utils/color-utils.js +18 -29
- package/es/utils/column-utils.js +18 -29
- package/es/utils/column.js +4 -11
- package/es/utils/common-utils.js +41 -65
- package/es/utils/date-format.js +2 -8
- package/es/utils/export-table-utils.js +82 -91
- package/es/utils/index.js +11 -100
- package/es/utils/map.js +26 -36
- package/es/utils/model.js +6 -14
- package/es/utils/object.js +6 -15
- package/es/utils/pivot-table.js +16 -23
- package/es/utils/row-utils.js +23 -33
- package/es/utils/search.js +21 -29
- package/es/utils/sql-utils.js +65 -75
- package/es/utils/stat-utils.js +60 -66
- package/es/utils/trend-utils.js +32 -40
- package/package.json +1 -1
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _dtableStore = require("dtable-store");
|
|
12
|
-
var _components = require("../../../components");
|
|
13
|
-
var _baseSettings = _interopRequireDefault(require("../public-setting/base-settings"));
|
|
14
|
-
var _groupbySettings = _interopRequireDefault(require("./groupby-settings"));
|
|
15
|
-
var _numericSummaryItem = _interopRequireDefault(require("../public-setting/numeric-summary-item"));
|
|
16
|
-
var _summaryMethodSetting = _interopRequireDefault(require("./summary-method-setting"));
|
|
17
|
-
var _indToggleSetting = _interopRequireDefault(require("../public-setting/ind-toggle-setting"));
|
|
18
|
-
var _constants = require("../../../constants");
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { isNumericColumn, TableUtils } from 'dtable-store';
|
|
4
|
+
import { DTableSelect } from '../../../components';
|
|
5
|
+
import BaseSettings from '../public-setting/base-settings';
|
|
6
|
+
import GroupbySettings from './groupby-settings';
|
|
7
|
+
import NumericSummaryItem from '../public-setting/numeric-summary-item';
|
|
8
|
+
import SummaryMethodSettings from './summary-method-setting';
|
|
9
|
+
import IndToggleSetting from '../public-setting/ind-toggle-setting';
|
|
10
|
+
import { GROUPBY_TYPE, STATISTICS_COUNT_SHOW, SUMMARY_METHOD, SUMMARY_METHOD_MAP, SUMMARY_TYPE, TIME_COLUMN_LIST } from '../../../constants';
|
|
19
11
|
const GROUP_TYPES = {
|
|
20
12
|
COUNT: 'count',
|
|
21
13
|
SINGLE_NUMERIC_COLUMN: 'single_numeric_column',
|
|
@@ -23,11 +15,11 @@ const GROUP_TYPES = {
|
|
|
23
15
|
};
|
|
24
16
|
const GROUP_EXPLANATIONS = {
|
|
25
17
|
COUNT: {
|
|
26
|
-
name:
|
|
18
|
+
name: STATISTICS_COUNT_SHOW['count'],
|
|
27
19
|
content: 'Count_the_number_of_records_in_each_group'
|
|
28
20
|
},
|
|
29
21
|
SINGLE_NUMERIC_COLUMN: {
|
|
30
|
-
name:
|
|
22
|
+
name: STATISTICS_COUNT_SHOW['advanced'],
|
|
31
23
|
content: 'Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_a_field'
|
|
32
24
|
},
|
|
33
25
|
MULTIPLE_NUMERIC_COLUMN: {
|
|
@@ -35,16 +27,16 @@ const GROUP_EXPLANATIONS = {
|
|
|
35
27
|
content: 'Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_multiple_fields'
|
|
36
28
|
}
|
|
37
29
|
};
|
|
38
|
-
class PivotSettings extends
|
|
30
|
+
class PivotSettings extends Component {
|
|
39
31
|
constructor(props) {
|
|
40
32
|
super(props);
|
|
41
33
|
this.getSummaryMethodsOptions = () => {
|
|
42
|
-
return
|
|
34
|
+
return SUMMARY_METHOD.map(m => {
|
|
43
35
|
return {
|
|
44
36
|
value: m,
|
|
45
|
-
label: /*#__PURE__*/
|
|
37
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
46
38
|
className: 'select-module select-module-name'
|
|
47
|
-
},
|
|
39
|
+
}, intl.get(STATISTICS_COUNT_SHOW[m]))
|
|
48
40
|
};
|
|
49
41
|
});
|
|
50
42
|
};
|
|
@@ -52,17 +44,17 @@ class PivotSettings extends _react.Component {
|
|
|
52
44
|
return Object.keys(GROUP_TYPES).map(key => {
|
|
53
45
|
return {
|
|
54
46
|
value: GROUP_TYPES[key],
|
|
55
|
-
label: /*#__PURE__*/
|
|
47
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
56
48
|
className: 'select-module select-module-name'
|
|
57
|
-
},
|
|
49
|
+
}, intl.get(GROUP_EXPLANATIONS[key].name)), /*#__PURE__*/React.createElement("div", {
|
|
58
50
|
className: "summary-type-explanation"
|
|
59
|
-
},
|
|
51
|
+
}, intl.get(GROUP_EXPLANATIONS[key].content)))
|
|
60
52
|
};
|
|
61
53
|
});
|
|
62
54
|
};
|
|
63
55
|
this.onSelectGroupbyColumn = (type, groupbyColumnKey, groupbyDateGranularity, groupbyGeolocationGranularity) => {
|
|
64
56
|
let updated;
|
|
65
|
-
if (type ===
|
|
57
|
+
if (type === GROUPBY_TYPE.ROW) {
|
|
66
58
|
updated = {
|
|
67
59
|
groupby_column_key: groupbyColumnKey,
|
|
68
60
|
groupby_date_granularity: groupbyDateGranularity,
|
|
@@ -81,7 +73,7 @@ class PivotSettings extends _react.Component {
|
|
|
81
73
|
};
|
|
82
74
|
this.onSelectGroupbyDateGranularity = (type, dateGranularity) => {
|
|
83
75
|
let updated;
|
|
84
|
-
if (type ===
|
|
76
|
+
if (type === GROUPBY_TYPE.ROW) {
|
|
85
77
|
updated = {
|
|
86
78
|
groupby_date_granularity: dateGranularity
|
|
87
79
|
};
|
|
@@ -94,7 +86,7 @@ class PivotSettings extends _react.Component {
|
|
|
94
86
|
};
|
|
95
87
|
this.onSelectGroupbyGeolocationGranularity = (type, geolocationGranularity) => {
|
|
96
88
|
let updated;
|
|
97
|
-
if (type ===
|
|
89
|
+
if (type === GROUPBY_TYPE.ROW) {
|
|
98
90
|
updated = {
|
|
99
91
|
groupby_geolocation_granularity: geolocationGranularity
|
|
100
92
|
};
|
|
@@ -143,31 +135,31 @@ class PivotSettings extends _react.Component {
|
|
|
143
135
|
summary_column_key
|
|
144
136
|
} = this.props.statItem || {};
|
|
145
137
|
if (value === GROUP_TYPES.SINGLE_NUMERIC_COLUMN) {
|
|
146
|
-
summary_type =
|
|
138
|
+
summary_type = SUMMARY_TYPE.ADVANCED;
|
|
147
139
|
column_groupby_multiple_numeric_column = false;
|
|
148
140
|
summary_columns_option = [];
|
|
149
|
-
summary_method = summary_method ||
|
|
141
|
+
summary_method = summary_method || SUMMARY_METHOD[0];
|
|
150
142
|
} else if (value === GROUP_TYPES.COUNT) {
|
|
151
143
|
column_groupby_multiple_numeric_column = false;
|
|
152
144
|
summary_columns_option = [];
|
|
153
|
-
summary_type =
|
|
145
|
+
summary_type = SUMMARY_TYPE.COUNT;
|
|
154
146
|
column_groupby_date_granularity = null;
|
|
155
147
|
column_groupby_geolocation_granularity = null;
|
|
156
148
|
summary_column_key = null;
|
|
157
149
|
} else if (value === GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN) {
|
|
158
|
-
summary_type =
|
|
150
|
+
summary_type = SUMMARY_TYPE.ADVANCED;
|
|
159
151
|
column_groupby_multiple_numeric_column = true;
|
|
160
152
|
if (column_groupby_column_key) {
|
|
161
153
|
summary_columns_option = [{
|
|
162
154
|
key: this.getNumericalColumnOptions()[0].value.key,
|
|
163
|
-
method:
|
|
155
|
+
method: SUMMARY_METHOD[0],
|
|
164
156
|
type: this.getNumericalColumnOptions()[0].value.type
|
|
165
157
|
}];
|
|
166
158
|
} else {
|
|
167
159
|
const pivotTableSummaryColumnOption = pivotTableSummaryColumnOptions[0];
|
|
168
160
|
summary_columns_option = [];
|
|
169
161
|
summary_column_key = pivotTableSummaryColumnOption && pivotTableSummaryColumnOption.value.key;
|
|
170
|
-
summary_method =
|
|
162
|
+
summary_method = SUMMARY_METHOD[1];
|
|
171
163
|
}
|
|
172
164
|
}
|
|
173
165
|
let updated = {
|
|
@@ -195,16 +187,16 @@ class PivotSettings extends _react.Component {
|
|
|
195
187
|
summary_type,
|
|
196
188
|
column_groupby_column_key
|
|
197
189
|
} = statItem;
|
|
198
|
-
if (summary_type ===
|
|
190
|
+
if (summary_type === SUMMARY_TYPE.ADVANCED && column_groupby_column_key && !column_groupby_multiple_numeric_column) {
|
|
199
191
|
return this.groupTypeOptions[1];
|
|
200
192
|
}
|
|
201
193
|
if (column_groupby_multiple_numeric_column) {
|
|
202
194
|
return this.groupTypeOptions.find(item => item.value === GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN);
|
|
203
195
|
}
|
|
204
|
-
if (summary_type ===
|
|
196
|
+
if (summary_type === SUMMARY_TYPE.COUNT) {
|
|
205
197
|
return this.groupTypeOptions[0];
|
|
206
198
|
}
|
|
207
|
-
if (summary_type ===
|
|
199
|
+
if (summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
208
200
|
return this.groupTypeOptions[1];
|
|
209
201
|
}
|
|
210
202
|
};
|
|
@@ -221,8 +213,8 @@ class PivotSettings extends _react.Component {
|
|
|
221
213
|
if (!table) return [];
|
|
222
214
|
const newPivotTableSummaryColumnOptions = [];
|
|
223
215
|
pivotTableSummaryColumnOptions.forEach(item => {
|
|
224
|
-
const column =
|
|
225
|
-
if (
|
|
216
|
+
const column = TableUtils.getTableColumnByKey(table, item.value.key) || {};
|
|
217
|
+
if (isNumericColumn(column)) {
|
|
226
218
|
newPivotTableSummaryColumnOptions.push(item);
|
|
227
219
|
}
|
|
228
220
|
});
|
|
@@ -247,15 +239,15 @@ class PivotSettings extends _react.Component {
|
|
|
247
239
|
const updated = {
|
|
248
240
|
summary_column_key: columnOption.value.key
|
|
249
241
|
};
|
|
250
|
-
if (
|
|
242
|
+
if (TIME_COLUMN_LIST.includes(columnOption.value.type)) {
|
|
251
243
|
const {
|
|
252
244
|
statItem
|
|
253
245
|
} = this.props;
|
|
254
246
|
const {
|
|
255
247
|
summary_method
|
|
256
248
|
} = statItem || {};
|
|
257
|
-
if (summary_method ===
|
|
258
|
-
updated.summary_method =
|
|
249
|
+
if (summary_method === SUMMARY_METHOD_MAP.Sum || summary_method === SUMMARY_METHOD_MAP.Mean) {
|
|
250
|
+
updated.summary_method = SUMMARY_METHOD_MAP.Min;
|
|
259
251
|
}
|
|
260
252
|
}
|
|
261
253
|
this.props.updateStatItem(Object.assign({}, this.props.statItem, updated));
|
|
@@ -269,9 +261,9 @@ class PivotSettings extends _react.Component {
|
|
|
269
261
|
const updated = {
|
|
270
262
|
key: columnOption.value.key
|
|
271
263
|
};
|
|
272
|
-
if (
|
|
273
|
-
if (selectedItem.method ===
|
|
274
|
-
updated.method =
|
|
264
|
+
if (TIME_COLUMN_LIST.includes(columnOption.value.type)) {
|
|
265
|
+
if (selectedItem.method === SUMMARY_METHOD_MAP.Sum || selectedItem.method === SUMMARY_METHOD_MAP.Mean) {
|
|
266
|
+
updated.method = SUMMARY_METHOD_MAP.Min;
|
|
275
267
|
}
|
|
276
268
|
}
|
|
277
269
|
selectedItem = Object.assign({}, selectedItem, updated);
|
|
@@ -291,7 +283,7 @@ class PivotSettings extends _react.Component {
|
|
|
291
283
|
const summaryColumnOption = summary_columns_option[index];
|
|
292
284
|
const update = {
|
|
293
285
|
key: columnOption.value.key,
|
|
294
|
-
method: summaryColumnOption && summaryColumnOption.method ||
|
|
286
|
+
method: summaryColumnOption && summaryColumnOption.method || SUMMARY_METHOD_MAP.Sum
|
|
295
287
|
};
|
|
296
288
|
summary_columns_option = summary_columns_option || [];
|
|
297
289
|
summary_columns_option = [...summary_columns_option];
|
|
@@ -360,12 +352,12 @@ class PivotSettings extends _react.Component {
|
|
|
360
352
|
summary_columns_option = [...summary_columns_option];
|
|
361
353
|
summary_columns_option.push({
|
|
362
354
|
key: newNumericColumnKey,
|
|
363
|
-
method:
|
|
355
|
+
method: SUMMARY_METHOD[0]
|
|
364
356
|
});
|
|
365
357
|
} else {
|
|
366
358
|
summary_columns_option = [{
|
|
367
359
|
key: newNumericColumnKey,
|
|
368
|
-
method:
|
|
360
|
+
method: SUMMARY_METHOD[0]
|
|
369
361
|
}];
|
|
370
362
|
}
|
|
371
363
|
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
@@ -396,7 +388,7 @@ class PivotSettings extends _react.Component {
|
|
|
396
388
|
if (column_groupby_column_key) {
|
|
397
389
|
const [, ...restSummaryColumnsOption] = summary_columns_option;
|
|
398
390
|
return restSummaryColumnsOption.map((item, index) => {
|
|
399
|
-
return /*#__PURE__*/
|
|
391
|
+
return /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
400
392
|
key: "number-column-".concat(index),
|
|
401
393
|
statItem: statItem,
|
|
402
394
|
index: index + 1,
|
|
@@ -410,7 +402,7 @@ class PivotSettings extends _react.Component {
|
|
|
410
402
|
});
|
|
411
403
|
}
|
|
412
404
|
return summary_columns_option.map((item, index) => {
|
|
413
|
-
return /*#__PURE__*/
|
|
405
|
+
return /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
414
406
|
key: "number-column-".concat(index),
|
|
415
407
|
statItem: statItem,
|
|
416
408
|
numericColumnsOptions: this.props.pivotTableSummaryColumnOptions,
|
|
@@ -457,7 +449,7 @@ class PivotSettings extends _react.Component {
|
|
|
457
449
|
if (settingType === 'style') {
|
|
458
450
|
return null;
|
|
459
451
|
}
|
|
460
|
-
return /*#__PURE__*/
|
|
452
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BaseSettings, {
|
|
461
453
|
statItem: statItem,
|
|
462
454
|
selectedTableId: selectedTableId,
|
|
463
455
|
selectedViewId: selectedViewId,
|
|
@@ -466,47 +458,47 @@ class PivotSettings extends _react.Component {
|
|
|
466
458
|
getTableById: this.props.getTableById,
|
|
467
459
|
getConvertedChart: this.props.getConvertedChart,
|
|
468
460
|
updateStatItem: this.props.updateStatItem
|
|
469
|
-
}), /*#__PURE__*/
|
|
461
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
470
462
|
className: "statistic-chart-parameter-divider"
|
|
471
|
-
}), /*#__PURE__*/
|
|
463
|
+
}), /*#__PURE__*/React.createElement(GroupbySettings, {
|
|
472
464
|
selectedTable: selectedTable,
|
|
473
465
|
columnsOptions: generalColumnsOptions,
|
|
474
466
|
dateGranularityOptions: dateGranularityOptions,
|
|
475
467
|
geolocationGranularityOptions: geolocationGranularityOptions,
|
|
476
|
-
label:
|
|
477
|
-
placeholder:
|
|
468
|
+
label: intl.get('Row_grouping_field'),
|
|
469
|
+
placeholder: intl.get('Select_a_column'),
|
|
478
470
|
groupbyColumnKey: groupby_column_key,
|
|
479
471
|
groupbyDateGranularity: groupby_date_granularity,
|
|
480
472
|
groupbyGeolocationGranularity: groupby_geolocation_granularity,
|
|
481
473
|
getSelectedColumnOption: this.props.getSelectedColumnOption,
|
|
482
|
-
onSelectGroupbyColumn: this.onSelectGroupbyColumn.bind(this,
|
|
483
|
-
onSelectGroupbyDateGranularity: this.onSelectGroupbyDateGranularity.bind(this,
|
|
484
|
-
onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this,
|
|
474
|
+
onSelectGroupbyColumn: this.onSelectGroupbyColumn.bind(this, GROUPBY_TYPE.ROW),
|
|
475
|
+
onSelectGroupbyDateGranularity: this.onSelectGroupbyDateGranularity.bind(this, GROUPBY_TYPE.ROW),
|
|
476
|
+
onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this, GROUPBY_TYPE.ROW),
|
|
485
477
|
renderIncludeEmpty: renderIncludeEmpty
|
|
486
|
-
}), /*#__PURE__*/
|
|
478
|
+
}), /*#__PURE__*/React.createElement(GroupbySettings, {
|
|
487
479
|
selectedTable: selectedTable,
|
|
488
480
|
columnsOptions: generalColumnsOptions,
|
|
489
481
|
dateGranularityOptions: dateGranularityOptions,
|
|
490
482
|
geolocationGranularityOptions: geolocationGranularityOptions,
|
|
491
|
-
label:
|
|
492
|
-
placeholder:
|
|
483
|
+
label: intl.get('Column_grouping_field'),
|
|
484
|
+
placeholder: intl.get('Select_a_column'),
|
|
493
485
|
groupbyColumnKey: column_groupby_column_key,
|
|
494
486
|
groupbyDateGranularity: column_groupby_date_granularity,
|
|
495
487
|
groupbyGeolocationGranularity: column_groupby_geolocation_granularity,
|
|
496
488
|
getSelectedColumnOption: this.props.getSelectedColumnOption,
|
|
497
|
-
onSelectGroupbyColumn: this.onSelectGroupbyColumn.bind(this,
|
|
498
|
-
onSelectGroupbyDateGranularity: this.onSelectGroupbyDateGranularity.bind(this,
|
|
499
|
-
onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this,
|
|
500
|
-
}), /*#__PURE__*/
|
|
489
|
+
onSelectGroupbyColumn: this.onSelectGroupbyColumn.bind(this, GROUPBY_TYPE.COLUMN),
|
|
490
|
+
onSelectGroupbyDateGranularity: this.onSelectGroupbyDateGranularity.bind(this, GROUPBY_TYPE.COLUMN),
|
|
491
|
+
onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this, GROUPBY_TYPE.COLUMN)
|
|
492
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
501
493
|
className: "statistic-chart-parameter-divider"
|
|
502
|
-
}), /*#__PURE__*/
|
|
494
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
503
495
|
className: "statistic-chart-parameter-item"
|
|
504
|
-
}, /*#__PURE__*/
|
|
496
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Summary_type')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
505
497
|
classNamePrefix: "statistic-chart-summary-types",
|
|
506
498
|
value: selectedGroupItem,
|
|
507
499
|
options: this.groupTypeOptions,
|
|
508
500
|
onChange: this.onChangeGroupType
|
|
509
|
-
})), summary_type ===
|
|
501
|
+
})), summary_type === SUMMARY_TYPE.ADVANCED && (column_groupby_multiple_numeric_column ? /*#__PURE__*/React.createElement(React.Fragment, null, column_groupby_column_key && /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
510
502
|
statItem: statItem,
|
|
511
503
|
key: "number-column-".concat(0),
|
|
512
504
|
index: 0,
|
|
@@ -518,7 +510,7 @@ class PivotSettings extends _react.Component {
|
|
|
518
510
|
summaryMethodOptions: this.summaryMethodsOptions,
|
|
519
511
|
onChangeColumnOption: this.onChangeGroupbyMultiNumericColumn,
|
|
520
512
|
onChangeSummaryMethod: this.onChangeMultiSummaryMethod
|
|
521
|
-
}), !column_groupby_column_key && /*#__PURE__*/
|
|
513
|
+
}), !column_groupby_column_key && /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
522
514
|
statItem: statItem,
|
|
523
515
|
key: "number-column-".concat(0),
|
|
524
516
|
index: 0,
|
|
@@ -530,7 +522,7 @@ class PivotSettings extends _react.Component {
|
|
|
530
522
|
summaryMethodOptions: this.summaryMethodsOptions,
|
|
531
523
|
onChangeColumnOption: this.onChangeGroupbyNumericColumn,
|
|
532
524
|
onChangeSummaryMethod: this.onChangeSummaryMethod
|
|
533
|
-
})) : /*#__PURE__*/
|
|
525
|
+
})) : /*#__PURE__*/React.createElement(SummaryMethodSettings, {
|
|
534
526
|
statItem: statItem,
|
|
535
527
|
numericColumnsOptions: pivotTableSummaryColumnOptions,
|
|
536
528
|
summaryType: summary_type,
|
|
@@ -541,24 +533,24 @@ class PivotSettings extends _react.Component {
|
|
|
541
533
|
onSelectSummaryMethod: this.updateSummaryMethod,
|
|
542
534
|
onSelectNumericColumn: this.updateSummaryColumn,
|
|
543
535
|
updateStatItem: this.props.updateStatItem
|
|
544
|
-
})), column_groupby_multiple_numeric_column && /*#__PURE__*/
|
|
536
|
+
})), column_groupby_multiple_numeric_column && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
545
537
|
className: "statistics-add-number"
|
|
546
|
-
}, this.renderGroupbyNumericColumns()), this.canAddSummaryColumn() && /*#__PURE__*/
|
|
538
|
+
}, this.renderGroupbyNumericColumns()), this.canAddSummaryColumn() && /*#__PURE__*/React.createElement("div", {
|
|
547
539
|
className: "statistics-add-number-column",
|
|
548
540
|
onClick: this.onAddNumericColumn
|
|
549
|
-
}, /*#__PURE__*/
|
|
541
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
550
542
|
className: "number-column-item dtable-font dtable-icon-add-table"
|
|
551
|
-
}), /*#__PURE__*/
|
|
543
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
552
544
|
className: "number-column-item add-number-column-description"
|
|
553
|
-
},
|
|
545
|
+
}, intl.get('Add_new_summary_column')))), /*#__PURE__*/React.createElement("div", {
|
|
554
546
|
className: "statistic-chart-parameter-divider"
|
|
555
|
-
}), /*#__PURE__*/
|
|
547
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
556
548
|
className: "statistic-chart-parameter-item"
|
|
557
|
-
}, /*#__PURE__*/
|
|
549
|
+
}, /*#__PURE__*/React.createElement(IndToggleSetting, {
|
|
558
550
|
isChecked: display_total,
|
|
559
551
|
handleToggleChange: this.onToggleDisplayData,
|
|
560
|
-
label:
|
|
552
|
+
label: intl.get('Display_total')
|
|
561
553
|
})));
|
|
562
554
|
}
|
|
563
555
|
}
|
|
564
|
-
|
|
556
|
+
export default PivotSettings;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _baseSettings = _interopRequireDefault(require("../public-setting/base-settings"));
|
|
12
|
-
var _barChartStyleSetting = _interopRequireDefault(require("./style-setting/bar-chart-style-setting"));
|
|
13
|
-
var _columnSettings = _interopRequireDefault(require("../public-setting/column-settings"));
|
|
14
|
-
class ScatterSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import BaseSettings from '../public-setting/base-settings';
|
|
4
|
+
import BarChartStyle from './style-setting/bar-chart-style-setting';
|
|
5
|
+
import ColumnSettings from '../public-setting/column-settings';
|
|
6
|
+
class ScatterSettings extends Component {
|
|
15
7
|
constructor() {
|
|
16
8
|
super(...arguments);
|
|
17
9
|
this.onSelectXAxisColumn = option => {
|
|
@@ -64,7 +56,7 @@ class ScatterSettings extends _react.Component {
|
|
|
64
56
|
group_column
|
|
65
57
|
} = statItem || {};
|
|
66
58
|
if (settingType === 'style') {
|
|
67
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/React.createElement(BarChartStyle, {
|
|
68
60
|
hideDisplayDataSetting: true,
|
|
69
61
|
showRangeSetting: false,
|
|
70
62
|
statItem: statItem,
|
|
@@ -77,7 +69,7 @@ class ScatterSettings extends _react.Component {
|
|
|
77
69
|
const selectedXAxisColumn = getSelectedColumnOption(x_axis_column, numericColumnsOptions);
|
|
78
70
|
const selectedYAxisColumn = getSelectedColumnOption(y_axis_column, numericColumnsOptions);
|
|
79
71
|
const selectedGroupColumn = getSelectedColumnOption(group_column, generalColumnsOptions);
|
|
80
|
-
return /*#__PURE__*/
|
|
72
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BaseSettings, {
|
|
81
73
|
statItem: statItem,
|
|
82
74
|
selectedTableId: selectedTableId,
|
|
83
75
|
selectedViewId: selectedViewId,
|
|
@@ -86,27 +78,27 @@ class ScatterSettings extends _react.Component {
|
|
|
86
78
|
getTableById: this.props.getTableById,
|
|
87
79
|
getConvertedChart: this.props.getConvertedChart,
|
|
88
80
|
updateStatItem: this.props.updateStatItem
|
|
89
|
-
}), /*#__PURE__*/
|
|
81
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
90
82
|
className: "statistic-chart-parameter-divider"
|
|
91
|
-
}), /*#__PURE__*/
|
|
83
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
92
84
|
className: "statistic-chart-parameter-item"
|
|
93
|
-
}, /*#__PURE__*/
|
|
85
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('X-axis')), /*#__PURE__*/React.createElement(ColumnSettings, {
|
|
94
86
|
columnsOptions: numericColumnsOptions,
|
|
95
87
|
selectedColumnOption: selectedXAxisColumn,
|
|
96
88
|
onChangeSelectedColumn: this.onSelectXAxisColumn
|
|
97
|
-
})), /*#__PURE__*/
|
|
89
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
98
90
|
className: "statistic-chart-parameter-item"
|
|
99
|
-
}, /*#__PURE__*/
|
|
91
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Y-axis')), /*#__PURE__*/React.createElement(ColumnSettings, {
|
|
100
92
|
columnsOptions: numericColumnsOptions,
|
|
101
93
|
selectedColumnOption: selectedYAxisColumn,
|
|
102
94
|
onChangeSelectedColumn: this.onSelectYAxisColumn
|
|
103
|
-
})), /*#__PURE__*/
|
|
95
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
104
96
|
className: "statistic-chart-parameter-item"
|
|
105
|
-
}, /*#__PURE__*/
|
|
97
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Group_by')), /*#__PURE__*/React.createElement(ColumnSettings, {
|
|
106
98
|
columnsOptions: generalColumnsOptions,
|
|
107
99
|
selectedColumnOption: selectedGroupColumn,
|
|
108
100
|
onChangeSelectedColumn: this.onSelectGroupColumn
|
|
109
101
|
})));
|
|
110
102
|
}
|
|
111
103
|
}
|
|
112
|
-
|
|
104
|
+
export default ScatterSettings;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
12
|
-
var _numericSummaryItem = _interopRequireDefault(require("../public-setting/numeric-summary-item"));
|
|
13
|
-
class StackItemSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import intl from 'react-intl-universal';
|
|
4
|
+
import NumericSummaryItem from '../public-setting/numeric-summary-item';
|
|
5
|
+
class StackItemSettings extends Component {
|
|
14
6
|
constructor(props) {
|
|
15
7
|
super(props);
|
|
16
8
|
this.onToggleExpand = () => {
|
|
@@ -29,7 +21,7 @@ class StackItemSettings extends _react.Component {
|
|
|
29
21
|
column_groupby_numeric_columns
|
|
30
22
|
} = stack;
|
|
31
23
|
return Array.isArray(column_groupby_numeric_columns) && column_groupby_numeric_columns.map((item, index) => {
|
|
32
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/React.createElement(NumericSummaryItem, {
|
|
33
25
|
statItem: statItem,
|
|
34
26
|
key: "stack-number-column-".concat(index),
|
|
35
27
|
index: index,
|
|
@@ -55,33 +47,33 @@ class StackItemSettings extends _react.Component {
|
|
|
55
47
|
const {
|
|
56
48
|
expanded
|
|
57
49
|
} = this.state;
|
|
58
|
-
return /*#__PURE__*/
|
|
59
|
-
className: (
|
|
50
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: classnames('statistic-chart-parameter-item', {
|
|
60
52
|
collapsible: !expanded
|
|
61
53
|
})
|
|
62
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
55
|
className: "statistic-y-axis-title"
|
|
64
|
-
}, /*#__PURE__*/
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
|
|
65
57
|
onClick: this.onToggleExpand,
|
|
66
|
-
className: (
|
|
58
|
+
className: classnames('dtable-font', 'statistic-y-axis-title-expand-icon', {
|
|
67
59
|
'dtable-icon-drop-down': expanded,
|
|
68
60
|
'dtable-icon-right-slide': !expanded
|
|
69
61
|
})
|
|
70
|
-
}), /*#__PURE__*/
|
|
62
|
+
}), /*#__PURE__*/React.createElement("label", null, label)), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("i", {
|
|
71
63
|
onClick: this.props.deleteStack,
|
|
72
64
|
className: "dtable-font dtable-icon-fork-number"
|
|
73
|
-
}))), expanded && /*#__PURE__*/
|
|
65
|
+
}))), expanded && /*#__PURE__*/React.createElement("div", {
|
|
74
66
|
className: "stack-settings-content-wrapper"
|
|
75
|
-
}, /*#__PURE__*/
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
68
|
className: "statistics-add-number"
|
|
77
|
-
}, this.renderGroupbyNumericColumns()), Array.isArray(numericColumnsOptions) && numericColumnsOptions.length > 0 && /*#__PURE__*/
|
|
69
|
+
}, this.renderGroupbyNumericColumns()), Array.isArray(numericColumnsOptions) && numericColumnsOptions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
78
70
|
className: "statistics-add-number-column",
|
|
79
71
|
onClick: this.props.addNumericSummary
|
|
80
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
81
73
|
className: "number-column-item dtable-font dtable-icon-add-table"
|
|
82
|
-
}), /*#__PURE__*/
|
|
74
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
83
75
|
className: "number-column-item add-number-column-description"
|
|
84
|
-
},
|
|
76
|
+
}, intl.get('Add_new_numeric_column'))))));
|
|
85
77
|
}
|
|
86
78
|
}
|
|
87
|
-
|
|
79
|
+
export default StackItemSettings;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _stackItemSettings = _interopRequireDefault(require("./stack-item-settings"));
|
|
12
|
-
var _constants = require("../../../constants");
|
|
13
|
-
class StacksSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import StackItemSettings from './stack-item-settings';
|
|
4
|
+
import { STATISTICS_COUNT_SHOW, STAT_TYPE, SUMMARY_METHOD } from '../../../constants';
|
|
5
|
+
class StacksSettings extends Component {
|
|
14
6
|
constructor(props) {
|
|
15
7
|
super(props);
|
|
16
8
|
this.addStack = () => {
|
|
@@ -21,7 +13,7 @@ class StacksSettings extends _react.Component {
|
|
|
21
13
|
y_axises
|
|
22
14
|
} = statItem;
|
|
23
15
|
const defaultStack = {
|
|
24
|
-
type:
|
|
16
|
+
type: STAT_TYPE.BAR_STACK,
|
|
25
17
|
column_groupby_numeric_columns: null
|
|
26
18
|
};
|
|
27
19
|
const updatedStacks = y_axises ? [...y_axises, defaultStack] : [defaultStack];
|
|
@@ -64,7 +56,7 @@ class StacksSettings extends _react.Component {
|
|
|
64
56
|
const newNumericColumnKey = numericColumnsOptions[0].value.key;
|
|
65
57
|
updatedNumericColumns.push({
|
|
66
58
|
column_key: newNumericColumnKey,
|
|
67
|
-
summary_method:
|
|
59
|
+
summary_method: SUMMARY_METHOD[0]
|
|
68
60
|
});
|
|
69
61
|
updatedStack.column_groupby_numeric_columns = updatedNumericColumns;
|
|
70
62
|
updatedStacks[index] = updatedStack;
|
|
@@ -134,12 +126,12 @@ class StacksSettings extends _react.Component {
|
|
|
134
126
|
}));
|
|
135
127
|
};
|
|
136
128
|
this.getSummaryMethodsOptions = () => {
|
|
137
|
-
return
|
|
129
|
+
return SUMMARY_METHOD.map(m => {
|
|
138
130
|
return {
|
|
139
131
|
value: m,
|
|
140
|
-
label: /*#__PURE__*/
|
|
132
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
141
133
|
className: 'select-module select-module-name'
|
|
142
|
-
},
|
|
134
|
+
}, intl.get(STATISTICS_COUNT_SHOW[m]))
|
|
143
135
|
};
|
|
144
136
|
});
|
|
145
137
|
};
|
|
@@ -152,12 +144,12 @@ class StacksSettings extends _react.Component {
|
|
|
152
144
|
const {
|
|
153
145
|
y_axises
|
|
154
146
|
} = statItem;
|
|
155
|
-
return /*#__PURE__*/
|
|
156
|
-
return /*#__PURE__*/
|
|
147
|
+
return /*#__PURE__*/React.createElement(Fragment, null, Array.isArray(y_axises) && y_axises.map((yAxis, index) => {
|
|
148
|
+
return /*#__PURE__*/React.createElement(StackItemSettings, {
|
|
157
149
|
key: "stack-settings-".concat(index),
|
|
158
150
|
statItem: statItem,
|
|
159
151
|
stack: yAxis,
|
|
160
|
-
label: "".concat(
|
|
152
|
+
label: "".concat(intl.get('Stack')).concat(index + 1),
|
|
161
153
|
numericColumnsOptions: this.props.numericColumnsOptions,
|
|
162
154
|
summaryMethodsOptions: this.summaryMethodsOptions,
|
|
163
155
|
deleteStack: () => this.deleteStack(index),
|
|
@@ -174,14 +166,14 @@ class StacksSettings extends _react.Component {
|
|
|
174
166
|
numericColumnIndex
|
|
175
167
|
})
|
|
176
168
|
});
|
|
177
|
-
}), /*#__PURE__*/
|
|
169
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
178
170
|
className: "statistics-add-stack",
|
|
179
171
|
onClick: this.addStack
|
|
180
|
-
}, /*#__PURE__*/
|
|
172
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
181
173
|
className: "dtable-font dtable-icon-add-table"
|
|
182
|
-
}), /*#__PURE__*/
|
|
174
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
183
175
|
className: "add-stack-description"
|
|
184
|
-
},
|
|
176
|
+
}, intl.get('Add_new_stack'))));
|
|
185
177
|
}
|
|
186
178
|
}
|
|
187
|
-
|
|
179
|
+
export default StacksSettings;
|