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,40 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _dtableStore = require("dtable-store");
|
|
13
|
-
var _components = require("../../../components");
|
|
14
|
-
var _columnSettings = _interopRequireDefault(require("../public-setting/column-settings"));
|
|
15
|
-
var _baseSettings = _interopRequireDefault(require("../public-setting/base-settings"));
|
|
16
|
-
var _combinationStyleSetting = _interopRequireDefault(require("./style-setting/combination-style-setting"));
|
|
17
|
-
var _toggleSetting = _interopRequireDefault(require("../public-setting/toggle-setting"));
|
|
18
|
-
var _summarySettings = _interopRequireDefault(require("./summary-settings"));
|
|
19
|
-
var _constants = require("../../../constants");
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import { Input } from 'reactstrap';
|
|
3
|
+
import intl from 'react-intl-universal';
|
|
4
|
+
import { CellType, TableUtils } from 'dtable-store';
|
|
5
|
+
import { DTableSelect } from '../../../components';
|
|
6
|
+
import ColumnSettings from '../public-setting/column-settings';
|
|
7
|
+
import BaseSettings from '../public-setting/base-settings';
|
|
8
|
+
import CombinationStyleSettings from './style-setting/combination-style-setting';
|
|
9
|
+
import ToggleSetting from '../public-setting/toggle-setting';
|
|
10
|
+
import SummarySettings from './summary-settings';
|
|
11
|
+
import { BASIC_CHART_COLUMN_LIST, DATE_GRANULARITY, GEOLOCATION_GRANULARITY, STATISTICS_COUNT_SHOW, SUMMARY_METHOD, SUMMARY_TYPE } from '../../../constants';
|
|
20
12
|
const DATE_COLUMN_OPTIONS = ['date', 'mtime', 'ctime'];
|
|
21
|
-
const DATE_GRANULARITY_LIST = [
|
|
22
|
-
const GEOLOCATION_GRANULARITY_LIST = [
|
|
13
|
+
const DATE_GRANULARITY_LIST = [DATE_GRANULARITY.DAY, DATE_GRANULARITY.WEEK, DATE_GRANULARITY.MONTH, DATE_GRANULARITY.QUARTER, DATE_GRANULARITY.YEAR];
|
|
14
|
+
const GEOLOCATION_GRANULARITY_LIST = [GEOLOCATION_GRANULARITY.PROVINCE, GEOLOCATION_GRANULARITY.CITY, GEOLOCATION_GRANULARITY.DISTRICT];
|
|
23
15
|
const GROUP_TYPES = {
|
|
24
16
|
COUNT: 'count',
|
|
25
17
|
SINGLE_NUMERIC_COLUMN: 'single_numeric_column',
|
|
26
18
|
MULTIPLE_NUMERIC_COLUMN: 'multiple_numeric_column'
|
|
27
19
|
};
|
|
28
|
-
class CombinationSettings extends
|
|
20
|
+
class CombinationSettings extends Component {
|
|
29
21
|
constructor(props) {
|
|
30
22
|
super(props);
|
|
31
23
|
this.getGranularityOptions = options => {
|
|
32
24
|
return options.map(g => {
|
|
33
25
|
return {
|
|
34
26
|
value: g,
|
|
35
|
-
label: /*#__PURE__*/
|
|
27
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
36
28
|
className: 'select-module select-module-name'
|
|
37
|
-
},
|
|
29
|
+
}, intl.get(STATISTICS_COUNT_SHOW[g]))
|
|
38
30
|
};
|
|
39
31
|
});
|
|
40
32
|
};
|
|
@@ -43,9 +35,9 @@ class CombinationSettings extends _react.Component {
|
|
|
43
35
|
statItem
|
|
44
36
|
} = this.props;
|
|
45
37
|
let selectedDateGranularity = this.getSelectedDateGranularity(statItem.x_axis_date_granularity);
|
|
46
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
47
39
|
className: "mt-1"
|
|
48
|
-
}, /*#__PURE__*/
|
|
40
|
+
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
49
41
|
value: selectedDateGranularity,
|
|
50
42
|
onChange: this.onSelectGroupbyDateGranularity,
|
|
51
43
|
options: this.dateGranularityOptions
|
|
@@ -64,9 +56,9 @@ class CombinationSettings extends _react.Component {
|
|
|
64
56
|
} = this.props;
|
|
65
57
|
let selectedGeolocationGranularity = this.getSelectedGeolocationGranularity(statItem.x_axis_geolocation_granularity);
|
|
66
58
|
if (this.geolocationGranularityOptions.length === 0) return null;
|
|
67
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
68
60
|
className: "mt-1"
|
|
69
|
-
}, /*#__PURE__*/
|
|
61
|
+
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
70
62
|
value: selectedGeolocationGranularity,
|
|
71
63
|
onChange: this.onSelectGroupbyGeolocationGranularity,
|
|
72
64
|
options: this.geolocationGranularityOptions
|
|
@@ -87,7 +79,7 @@ class CombinationSettings extends _react.Component {
|
|
|
87
79
|
};
|
|
88
80
|
this.getAvailableColumns = columns => {
|
|
89
81
|
if (!columns || !Array.isArray(columns)) return [];
|
|
90
|
-
return columns.filter(c =>
|
|
82
|
+
return columns.filter(c => BASIC_CHART_COLUMN_LIST.includes(c.type));
|
|
91
83
|
};
|
|
92
84
|
this.getSelectedStatColumnOption = () => {
|
|
93
85
|
return this.columnsOptions.find(option => option.value.key === this.props.statItem.x_axis_column_key);
|
|
@@ -109,12 +101,12 @@ class CombinationSettings extends _react.Component {
|
|
|
109
101
|
type,
|
|
110
102
|
key
|
|
111
103
|
} = option.value;
|
|
112
|
-
if (type ===
|
|
104
|
+
if (type === CellType.DATE) {
|
|
113
105
|
x_axis_date_granularity = this.dateGranularityOptions[2].value;
|
|
114
106
|
} else {
|
|
115
107
|
x_axis_date_granularity = null;
|
|
116
108
|
}
|
|
117
|
-
if (type ===
|
|
109
|
+
if (type === CellType.GEOLOCATION) {
|
|
118
110
|
const selectedTable = getTableById(selectedTableId);
|
|
119
111
|
const geoColumn = selectedTable.columns.find(column => column.key === key) || {};
|
|
120
112
|
const {
|
|
@@ -139,11 +131,11 @@ class CombinationSettings extends _react.Component {
|
|
|
139
131
|
}));
|
|
140
132
|
};
|
|
141
133
|
this.getSummaryMethodsOptions = () => {
|
|
142
|
-
return
|
|
134
|
+
return SUMMARY_METHOD.map(method => {
|
|
143
135
|
return {
|
|
144
|
-
label: /*#__PURE__*/
|
|
136
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
145
137
|
className: "select-option-name"
|
|
146
|
-
},
|
|
138
|
+
}, intl.get(STATISTICS_COUNT_SHOW[method])),
|
|
147
139
|
value: method
|
|
148
140
|
};
|
|
149
141
|
});
|
|
@@ -163,9 +155,9 @@ class CombinationSettings extends _react.Component {
|
|
|
163
155
|
const {
|
|
164
156
|
statName
|
|
165
157
|
} = this.state;
|
|
166
|
-
return /*#__PURE__*/
|
|
158
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
167
159
|
className: "statistic-chart-parameter-item"
|
|
168
|
-
}, /*#__PURE__*/
|
|
160
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('X-axis')), /*#__PURE__*/React.createElement(Input, {
|
|
169
161
|
type: "text",
|
|
170
162
|
onBlur: this.onSaveName,
|
|
171
163
|
onChange: this.onChangeName,
|
|
@@ -186,10 +178,10 @@ class CombinationSettings extends _react.Component {
|
|
|
186
178
|
y_axis_left_summary_method,
|
|
187
179
|
y_axis_left_group_by_numeric_columns
|
|
188
180
|
} = statItem;
|
|
189
|
-
let newSummaryType = option === GROUP_TYPES.COUNT ?
|
|
181
|
+
let newSummaryType = option === GROUP_TYPES.COUNT ? SUMMARY_TYPE.COUNT : SUMMARY_TYPE.ADVANCED;
|
|
190
182
|
if (position === 'left') {
|
|
191
|
-
if (newSummaryType ===
|
|
192
|
-
if (option === GROUP_TYPES.SINGLE_NUMERIC_COLUMN && !y_axis_left_group_by_multiple_numeric_column && y_axis_left_summary_type !==
|
|
183
|
+
if (newSummaryType === SUMMARY_TYPE.COUNT && y_axis_left_summary_type === SUMMARY_TYPE.COUNT) return;
|
|
184
|
+
if (option === GROUP_TYPES.SINGLE_NUMERIC_COLUMN && !y_axis_left_group_by_multiple_numeric_column && y_axis_left_summary_type !== SUMMARY_TYPE.COUNT) return;
|
|
193
185
|
if (option === GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN && y_axis_left_group_by_multiple_numeric_column) return;
|
|
194
186
|
if (option === GROUP_TYPES.COUNT) {
|
|
195
187
|
y_axis_left_summary_column = null;
|
|
@@ -199,13 +191,13 @@ class CombinationSettings extends _react.Component {
|
|
|
199
191
|
}
|
|
200
192
|
if (option === GROUP_TYPES.SINGLE_NUMERIC_COLUMN) {
|
|
201
193
|
y_axis_left_summary_column = null;
|
|
202
|
-
y_axis_left_summary_method =
|
|
194
|
+
y_axis_left_summary_method = SUMMARY_METHOD[0];
|
|
203
195
|
y_axis_left_group_by_multiple_numeric_column = false;
|
|
204
196
|
y_axis_left_group_by_numeric_columns = [];
|
|
205
197
|
}
|
|
206
198
|
if (option === GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN) {
|
|
207
199
|
y_axis_left_summary_column = null;
|
|
208
|
-
y_axis_left_summary_method =
|
|
200
|
+
y_axis_left_summary_method = SUMMARY_METHOD[0];
|
|
209
201
|
y_axis_left_group_by_multiple_numeric_column = true;
|
|
210
202
|
y_axis_left_group_by_numeric_columns = [];
|
|
211
203
|
}
|
|
@@ -220,8 +212,8 @@ class CombinationSettings extends _react.Component {
|
|
|
220
212
|
}
|
|
221
213
|
if (y_axis_right_summary_type === newSummaryType) return;
|
|
222
214
|
y_axis_right_summary_type = newSummaryType;
|
|
223
|
-
let y_axis_right_summary_method =
|
|
224
|
-
if (newSummaryType ===
|
|
215
|
+
let y_axis_right_summary_method = SUMMARY_METHOD[0];
|
|
216
|
+
if (newSummaryType === SUMMARY_TYPE.COUNT) {
|
|
225
217
|
y_axis_right_summary_column = null;
|
|
226
218
|
y_axis_right_summary_method = null;
|
|
227
219
|
}
|
|
@@ -304,12 +296,12 @@ class CombinationSettings extends _react.Component {
|
|
|
304
296
|
let {
|
|
305
297
|
x_axis_include_empty
|
|
306
298
|
} = statItem || {};
|
|
307
|
-
return /*#__PURE__*/
|
|
299
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
308
300
|
className: "mt-1"
|
|
309
|
-
}, /*#__PURE__*/
|
|
301
|
+
}, /*#__PURE__*/React.createElement(ToggleSetting, {
|
|
310
302
|
isChecked: x_axis_include_empty || false,
|
|
311
303
|
handleToggleChange: this.onToggleIncludeEmpty,
|
|
312
|
-
label:
|
|
304
|
+
label: intl.get('Including_empty_cell')
|
|
313
305
|
}));
|
|
314
306
|
};
|
|
315
307
|
const {
|
|
@@ -359,19 +351,19 @@ class CombinationSettings extends _react.Component {
|
|
|
359
351
|
y_axis_right_summary_column
|
|
360
352
|
} = statItem;
|
|
361
353
|
const selectedTable = getTableById(selectedTableId);
|
|
362
|
-
let groupbyColumn = x_axis_column_key &&
|
|
354
|
+
let groupbyColumn = x_axis_column_key && TableUtils.getTableColumnByKey(selectedTable, x_axis_column_key);
|
|
363
355
|
let {
|
|
364
356
|
type: groupbyColumnType
|
|
365
357
|
} = groupbyColumn || {};
|
|
366
358
|
if (settingType === 'style') {
|
|
367
|
-
return /*#__PURE__*/
|
|
359
|
+
return /*#__PURE__*/React.createElement(CombinationStyleSettings, {
|
|
368
360
|
selectedTableId: selectedTableId,
|
|
369
361
|
statItem: statItem,
|
|
370
362
|
eventBus: eventBus,
|
|
371
363
|
updateStatItem: updateStatItem
|
|
372
364
|
});
|
|
373
365
|
}
|
|
374
|
-
return /*#__PURE__*/
|
|
366
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BaseSettings, {
|
|
375
367
|
statItem: statItem,
|
|
376
368
|
selectedTableId: selectedTableId,
|
|
377
369
|
selectedViewId: statItem.view_id,
|
|
@@ -380,18 +372,18 @@ class CombinationSettings extends _react.Component {
|
|
|
380
372
|
getTableById: this.props.getTableById,
|
|
381
373
|
getConvertedChart: this.props.getConvertedChart,
|
|
382
374
|
updateStatItem: updateStatItem
|
|
383
|
-
}), /*#__PURE__*/
|
|
375
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
384
376
|
className: "statistic-chart-parameter-divider"
|
|
385
|
-
}), /*#__PURE__*/
|
|
377
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
386
378
|
className: "statistic-chart-parameter-item"
|
|
387
|
-
}, /*#__PURE__*/
|
|
379
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('X-axis')), /*#__PURE__*/React.createElement(ColumnSettings, {
|
|
388
380
|
columnsOptions: this.columnsOptions,
|
|
389
381
|
selectedColumnOption: selectedColumnOption,
|
|
390
382
|
onChangeSelectedColumn: this.onSelectStatColumn
|
|
391
|
-
}), DATE_COLUMN_OPTIONS.includes(groupbyColumnType) && this.renderGroupbyDateGranularity(), groupbyColumnType ===
|
|
383
|
+
}), DATE_COLUMN_OPTIONS.includes(groupbyColumnType) && this.renderGroupbyDateGranularity(), groupbyColumnType === CellType.GEOLOCATION && this.renderGroupbyGeolocationGranularity(), this.renderIncludeEmpty()), /*#__PURE__*/React.createElement(SummarySettings, {
|
|
392
384
|
useMultipleSummaryColumns: true,
|
|
393
385
|
chartType: 'combination_chart',
|
|
394
|
-
label:
|
|
386
|
+
label: intl.get('Y-axis(left side)'),
|
|
395
387
|
statItem: statItem,
|
|
396
388
|
selectedTableId: selectedTableId,
|
|
397
389
|
summaryType: y_axis_left_summary_type,
|
|
@@ -403,9 +395,9 @@ class CombinationSettings extends _react.Component {
|
|
|
403
395
|
onSelectSummaryColumn: option => this.onSelectSummaryColumn(option, 'left'),
|
|
404
396
|
onSelectSummaryMethod: option => this.onSelectSummaryMethod(option, 'left'),
|
|
405
397
|
updateStatItem: updateStatItem
|
|
406
|
-
}), /*#__PURE__*/
|
|
398
|
+
}), /*#__PURE__*/React.createElement(SummarySettings, {
|
|
407
399
|
chartType: 'combination_chart',
|
|
408
|
-
label:
|
|
400
|
+
label: intl.get('Y-axis(right side)'),
|
|
409
401
|
statItem: statItem,
|
|
410
402
|
selectedTableId: selectedTableId,
|
|
411
403
|
summaryType: y_axis_right_summary_type,
|
|
@@ -419,4 +411,4 @@ class CombinationSettings extends _react.Component {
|
|
|
419
411
|
}));
|
|
420
412
|
}
|
|
421
413
|
}
|
|
422
|
-
|
|
414
|
+
export default CombinationSettings;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
12
|
-
var _components = require("../../../components");
|
|
13
|
-
var _baseSettings = _interopRequireDefault(require("../public-setting/base-settings"));
|
|
14
|
-
var _columnSettings = _interopRequireDefault(require("../public-setting/column-settings"));
|
|
15
|
-
var _constants = require("../../../constants");
|
|
16
|
-
class DashboardChartSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import { Input } from 'reactstrap';
|
|
3
|
+
import intl from 'react-intl-universal';
|
|
4
|
+
import { DTableSelect } from '../../../components';
|
|
5
|
+
import BaseSettings from '../public-setting/base-settings';
|
|
6
|
+
import ColumnSettings from '../public-setting/column-settings';
|
|
7
|
+
import { STATISTICS_COUNT_SHOW, SUMMARY_METHOD } from '../../../constants';
|
|
8
|
+
class DashboardChartSettings extends Component {
|
|
17
9
|
constructor(props) {
|
|
18
10
|
super(props);
|
|
19
11
|
this.onSelectTargetValueColumn = option => {
|
|
@@ -37,12 +29,12 @@ class DashboardChartSettings extends _react.Component {
|
|
|
37
29
|
}));
|
|
38
30
|
};
|
|
39
31
|
this.getSummaryMethodsOptions = () => {
|
|
40
|
-
let numberCardSummaryMethod = ['Row_count', ...
|
|
32
|
+
let numberCardSummaryMethod = ['Row_count', ...SUMMARY_METHOD];
|
|
41
33
|
return numberCardSummaryMethod.map(method => {
|
|
42
34
|
return {
|
|
43
|
-
label: /*#__PURE__*/
|
|
35
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
44
36
|
className: "select-option-name"
|
|
45
|
-
},
|
|
37
|
+
}, intl.get(STATISTICS_COUNT_SHOW[method])),
|
|
46
38
|
value: method
|
|
47
39
|
};
|
|
48
40
|
});
|
|
@@ -87,9 +79,9 @@ class DashboardChartSettings extends _react.Component {
|
|
|
87
79
|
onSelectSummaryMethod = this.onSelectTotalValueColumnSummaryMethod;
|
|
88
80
|
}
|
|
89
81
|
const selectedMethodOption = this.getSelectedMethodOption(summary_method, this.summaryMethodsOptions);
|
|
90
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
91
83
|
className: "statistic-chart-parameter-item"
|
|
92
|
-
}, /*#__PURE__*/
|
|
84
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
93
85
|
value: selectedMethodOption,
|
|
94
86
|
onChange: onSelectSummaryMethod,
|
|
95
87
|
options: this.summaryMethodsOptions
|
|
@@ -119,9 +111,9 @@ class DashboardChartSettings extends _react.Component {
|
|
|
119
111
|
const {
|
|
120
112
|
statName
|
|
121
113
|
} = this.state;
|
|
122
|
-
return /*#__PURE__*/
|
|
114
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
123
115
|
className: "statistic-chart-parameter-item"
|
|
124
|
-
}, /*#__PURE__*/
|
|
116
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Label')), /*#__PURE__*/React.createElement(Input, {
|
|
125
117
|
type: "text",
|
|
126
118
|
value: statName || '',
|
|
127
119
|
placeholder: statItem.name,
|
|
@@ -168,7 +160,7 @@ class DashboardChartSettings extends _react.Component {
|
|
|
168
160
|
} = statItem;
|
|
169
161
|
const selectedTargetValueColumnOption = this.numericColumnOptions.filter(option => option.value.key === target_value_column)[0];
|
|
170
162
|
const selectedTotalValueColumnOption = this.numericColumnOptions.filter(option => option.value.key === total_value_column)[0];
|
|
171
|
-
return /*#__PURE__*/
|
|
163
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BaseSettings, {
|
|
172
164
|
statItem: statItem,
|
|
173
165
|
selectedTableId: selectedTableId,
|
|
174
166
|
selectedViewId: statItem.view_id,
|
|
@@ -177,21 +169,21 @@ class DashboardChartSettings extends _react.Component {
|
|
|
177
169
|
getTableById: this.props.getTableById,
|
|
178
170
|
getConvertedChart: this.props.getConvertedChart,
|
|
179
171
|
updateStatItem: updateStatItem
|
|
180
|
-
}), /*#__PURE__*/
|
|
172
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
181
173
|
className: "statistic-chart-parameter-divider"
|
|
182
|
-
}), /*#__PURE__*/
|
|
174
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
183
175
|
className: "statistic-chart-parameter-item"
|
|
184
|
-
}, /*#__PURE__*/
|
|
176
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Current_value_field')), /*#__PURE__*/React.createElement(ColumnSettings, {
|
|
185
177
|
columnsOptions: this.numericColumnOptions,
|
|
186
178
|
selectedColumnOption: selectedTargetValueColumnOption,
|
|
187
179
|
onChangeSelectedColumn: this.onSelectTargetValueColumn
|
|
188
180
|
})), this.renderSummaryMethod({
|
|
189
181
|
targetColumn: 'target_value_column'
|
|
190
|
-
}), /*#__PURE__*/
|
|
182
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
191
183
|
className: "statistic-chart-parameter-divider"
|
|
192
|
-
}), /*#__PURE__*/
|
|
184
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
193
185
|
className: "statistic-chart-parameter-item"
|
|
194
|
-
}, /*#__PURE__*/
|
|
186
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Total_value_field')), /*#__PURE__*/React.createElement(ColumnSettings, {
|
|
195
187
|
columnsOptions: this.numericColumnOptions,
|
|
196
188
|
selectedColumnOption: selectedTotalValueColumnOption,
|
|
197
189
|
onChangeSelectedColumn: this.onSelectTotalValueColumn
|
|
@@ -200,4 +192,4 @@ class DashboardChartSettings extends _react.Component {
|
|
|
200
192
|
}));
|
|
201
193
|
}
|
|
202
194
|
}
|
|
203
|
-
|
|
195
|
+
export default DashboardChartSettings;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _components = require("../../../components");
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import { DTableSelect } from '../../../components';
|
|
10
3
|
function GeoGranularitySettings(props) {
|
|
11
4
|
const {
|
|
12
5
|
geoGranularityOptions,
|
|
13
6
|
selectedGeoGranularityOption,
|
|
14
7
|
onChangeGeoGranularity
|
|
15
8
|
} = props;
|
|
16
|
-
return /*#__PURE__*/
|
|
9
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
17
10
|
value: selectedGeoGranularityOption,
|
|
18
11
|
options: geoGranularityOptions,
|
|
19
12
|
onChange: onChangeGeoGranularity
|
|
20
13
|
}));
|
|
21
14
|
}
|
|
22
|
-
|
|
15
|
+
export default GeoGranularitySettings;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
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 _columnSettings = _interopRequireDefault(require("../public-setting/column-settings"));
|
|
13
|
-
var _summarySettings = _interopRequireDefault(require("./summary-settings"));
|
|
14
|
-
var _heatMapSettings = _interopRequireDefault(require("./style-setting/heat-map-settings"));
|
|
15
|
-
var _columnUtils = require("../../../utils/column-utils");
|
|
16
|
-
class HeatMapSettings 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 ColumnSettings from '../public-setting/column-settings';
|
|
5
|
+
import SummarySettings from './summary-settings';
|
|
6
|
+
import StyleSettings from './style-setting/heat-map-settings';
|
|
7
|
+
import { isStatisticDateColumn } from '../../../utils/column-utils';
|
|
8
|
+
class HeatMapSettings extends Component {
|
|
17
9
|
constructor(props) {
|
|
18
10
|
super(props);
|
|
19
11
|
this.getSelectedDateColumnOption = () => {
|
|
@@ -33,7 +25,7 @@ class HeatMapSettings extends _react.Component {
|
|
|
33
25
|
columns,
|
|
34
26
|
getColumnsOptions
|
|
35
27
|
} = props;
|
|
36
|
-
const dateColumns = columns.filter(column =>
|
|
28
|
+
const dateColumns = columns.filter(column => isStatisticDateColumn(column));
|
|
37
29
|
this.dateColumnsOptions = getColumnsOptions(dateColumns);
|
|
38
30
|
}
|
|
39
31
|
componentWillReceiveProps(nextProps) {
|
|
@@ -42,7 +34,7 @@ class HeatMapSettings extends _react.Component {
|
|
|
42
34
|
columns,
|
|
43
35
|
getColumnsOptions
|
|
44
36
|
} = nextProps;
|
|
45
|
-
const dateColumns = columns.filter(column =>
|
|
37
|
+
const dateColumns = columns.filter(column => isStatisticDateColumn(column));
|
|
46
38
|
this.dateColumnsOptions = getColumnsOptions(dateColumns);
|
|
47
39
|
}
|
|
48
40
|
}
|
|
@@ -61,13 +53,13 @@ class HeatMapSettings extends _react.Component {
|
|
|
61
53
|
} = statItem;
|
|
62
54
|
const selectedDateColumnOption = this.getSelectedDateColumnOption();
|
|
63
55
|
if (settingType === 'style') {
|
|
64
|
-
return /*#__PURE__*/
|
|
56
|
+
return /*#__PURE__*/React.createElement(StyleSettings, {
|
|
65
57
|
statItem: statItem,
|
|
66
58
|
onChangeColor: this.props.onChangeColor,
|
|
67
59
|
updateStatItem: this.props.updateStatItem
|
|
68
60
|
});
|
|
69
61
|
}
|
|
70
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BaseSettings, {
|
|
71
63
|
statItem: statItem,
|
|
72
64
|
selectedTableId: selectedTableId,
|
|
73
65
|
selectedViewId: selectedViewId,
|
|
@@ -76,18 +68,18 @@ class HeatMapSettings extends _react.Component {
|
|
|
76
68
|
getTableById: this.props.getTableById,
|
|
77
69
|
getConvertedChart: this.props.getConvertedChart,
|
|
78
70
|
updateStatItem: this.props.updateStatItem
|
|
79
|
-
}), /*#__PURE__*/
|
|
71
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
80
72
|
className: "statistic-chart-parameter-divider"
|
|
81
|
-
}), /*#__PURE__*/
|
|
73
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
82
74
|
className: "statistic-chart-parameter-item"
|
|
83
|
-
}, /*#__PURE__*/
|
|
75
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Time_field')), /*#__PURE__*/React.createElement(ColumnSettings, {
|
|
84
76
|
columnsOptions: this.dateColumnsOptions,
|
|
85
77
|
selectedColumnOption: selectedDateColumnOption,
|
|
86
78
|
onChangeSelectedColumn: this.onSelectDateColumn
|
|
87
|
-
})), /*#__PURE__*/
|
|
79
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
88
80
|
className: "statistic-chart-parameter-divider"
|
|
89
|
-
}), /*#__PURE__*/
|
|
90
|
-
label:
|
|
81
|
+
}), /*#__PURE__*/React.createElement(SummarySettings, {
|
|
82
|
+
label: intl.get('Summary_method'),
|
|
91
83
|
statItem: statItem,
|
|
92
84
|
selectedTableId: selectedTableId,
|
|
93
85
|
numericColumns: numericColumns,
|
|
@@ -101,4 +93,4 @@ class HeatMapSettings extends _react.Component {
|
|
|
101
93
|
}));
|
|
102
94
|
}
|
|
103
95
|
}
|
|
104
|
-
|
|
96
|
+
export default HeatMapSettings;
|