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
package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js
CHANGED
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
12
|
-
var _dtableStore = require("dtable-store");
|
|
13
|
-
var _components = require("../../../../components");
|
|
14
|
-
var _toggleSetting = _interopRequireDefault(require("../../public-setting/toggle-setting"));
|
|
15
|
-
var _colorUseTypeSelector = _interopRequireDefault(require("../../color-setting/color-use-type-selector"));
|
|
16
|
-
var _labelFontSizeEditor = _interopRequireDefault(require("./label-font-size-editor"));
|
|
17
|
-
var _constants = require("../../../../constants");
|
|
18
|
-
class PieStyleSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import { Form, FormGroup, Label } from 'reactstrap';
|
|
3
|
+
import intl from 'react-intl-universal';
|
|
4
|
+
import { CellType, TableUtils } from 'dtable-store';
|
|
5
|
+
import { DTableSelect } from '../../../../components';
|
|
6
|
+
import ToggleSetting from '../../public-setting/toggle-setting';
|
|
7
|
+
import ColorUseTypeSelector from '../../color-setting/color-use-type-selector';
|
|
8
|
+
import LabelFontSizeEditor from './label-font-size-editor';
|
|
9
|
+
import { DEFAULT_ANNOTATION_SIZE, LABEL_FORMATS, LABEL_FORMATS_MAP, LABEL_POSITIONS, LABEL_POSITIONS_MAP, STAT_TYPE } from '../../../../constants';
|
|
10
|
+
class PieStyleSettings extends Component {
|
|
19
11
|
constructor(props) {
|
|
20
12
|
super(props);
|
|
21
13
|
this.renderShowLegend = () => {
|
|
22
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
15
|
className: "statistic-chart-parameter-item"
|
|
24
|
-
}, /*#__PURE__*/
|
|
16
|
+
}, /*#__PURE__*/React.createElement(ToggleSetting, {
|
|
25
17
|
isChecked: this.props.statItem.show_legend || false,
|
|
26
18
|
handleToggleChange: this.onToggleShowLegend,
|
|
27
|
-
label:
|
|
19
|
+
label: intl.get('Display_legend')
|
|
28
20
|
}));
|
|
29
21
|
};
|
|
30
22
|
this.replaceNumberNotAllowInput = value => {
|
|
@@ -39,11 +31,11 @@ class PieStyleSettings extends _react.Component {
|
|
|
39
31
|
const {
|
|
40
32
|
minimumSlicePercent
|
|
41
33
|
} = this.state;
|
|
42
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
43
35
|
className: "statistic-chart-parameter-item"
|
|
44
|
-
}, /*#__PURE__*/
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormGroup, null, /*#__PURE__*/React.createElement(Label, {
|
|
45
37
|
for: "percent"
|
|
46
|
-
},
|
|
38
|
+
}, intl.get('Minimum_slice_percent')), /*#__PURE__*/React.createElement("input", {
|
|
47
39
|
className: "form-control",
|
|
48
40
|
id: "percent",
|
|
49
41
|
ref: ref => this.inputRef = ref,
|
|
@@ -62,9 +54,9 @@ class PieStyleSettings extends _react.Component {
|
|
|
62
54
|
const {
|
|
63
55
|
label_font_size
|
|
64
56
|
} = statItem;
|
|
65
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
58
|
className: "statistic-chart-parameter-item"
|
|
67
|
-
}, /*#__PURE__*/
|
|
59
|
+
}, /*#__PURE__*/React.createElement(LabelFontSizeEditor, {
|
|
68
60
|
fontSize: label_font_size,
|
|
69
61
|
onChangeFontSize: this.onChangeLabelFontSize
|
|
70
62
|
}));
|
|
@@ -122,12 +114,12 @@ class PieStyleSettings extends _react.Component {
|
|
|
122
114
|
}));
|
|
123
115
|
};
|
|
124
116
|
this.getLabelFormatOptions = () => {
|
|
125
|
-
const options =
|
|
117
|
+
const options = LABEL_FORMATS.map(item => {
|
|
126
118
|
return {
|
|
127
119
|
value: item,
|
|
128
|
-
label: /*#__PURE__*/
|
|
120
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
129
121
|
className: 'select-module select-module-name'
|
|
130
|
-
},
|
|
122
|
+
}, intl.get(LABEL_FORMATS_MAP[item]))
|
|
131
123
|
};
|
|
132
124
|
});
|
|
133
125
|
return options;
|
|
@@ -165,21 +157,21 @@ class PieStyleSettings extends _react.Component {
|
|
|
165
157
|
};
|
|
166
158
|
this.renderLabelFormatSelector = () => {
|
|
167
159
|
let selectedOption = this.getSelectedLabelFormat();
|
|
168
|
-
return /*#__PURE__*/
|
|
160
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
169
161
|
className: "statistic-chart-parameter-item"
|
|
170
|
-
}, /*#__PURE__*/
|
|
162
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Label_format')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
171
163
|
value: selectedOption,
|
|
172
164
|
onChange: this.onSelectLabelFormat,
|
|
173
165
|
options: this.labelFormatOptions
|
|
174
166
|
}));
|
|
175
167
|
};
|
|
176
168
|
this.getLabelPositionOptions = () => {
|
|
177
|
-
const options =
|
|
169
|
+
const options = LABEL_POSITIONS.map(item => {
|
|
178
170
|
return {
|
|
179
171
|
value: item,
|
|
180
|
-
label: /*#__PURE__*/
|
|
172
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
181
173
|
className: 'select-module select-module-name'
|
|
182
|
-
},
|
|
174
|
+
}, intl.get(LABEL_POSITIONS_MAP[item]))
|
|
183
175
|
};
|
|
184
176
|
});
|
|
185
177
|
return options;
|
|
@@ -202,9 +194,9 @@ class PieStyleSettings extends _react.Component {
|
|
|
202
194
|
};
|
|
203
195
|
this.renderLabelPositionSelector = () => {
|
|
204
196
|
let selectedOption = this.getSelectedLabelPosition();
|
|
205
|
-
return /*#__PURE__*/
|
|
197
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
206
198
|
className: "statistic-chart-parameter-item"
|
|
207
|
-
}, /*#__PURE__*/
|
|
199
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Label_position')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
208
200
|
value: selectedOption,
|
|
209
201
|
onChange: this.onSelectLabelPosition,
|
|
210
202
|
options: this.labelPositionOptions
|
|
@@ -244,12 +236,12 @@ class PieStyleSettings extends _react.Component {
|
|
|
244
236
|
if (show_percent) {
|
|
245
237
|
display_label = true;
|
|
246
238
|
}
|
|
247
|
-
return /*#__PURE__*/
|
|
239
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
248
240
|
className: "statistic-chart-parameter-item"
|
|
249
|
-
}, /*#__PURE__*/
|
|
241
|
+
}, /*#__PURE__*/React.createElement(ToggleSetting, {
|
|
250
242
|
isChecked: display_label || false,
|
|
251
243
|
handleToggleChange: this.onToggleDisplayLabel,
|
|
252
|
-
label:
|
|
244
|
+
label: intl.get('Display_label')
|
|
253
245
|
}));
|
|
254
246
|
};
|
|
255
247
|
this.displayColorSelector = () => {
|
|
@@ -265,23 +257,23 @@ class PieStyleSettings extends _react.Component {
|
|
|
265
257
|
return false;
|
|
266
258
|
}
|
|
267
259
|
const table = getTableById(table_id);
|
|
268
|
-
const groupByColumn =
|
|
260
|
+
const groupByColumn = TableUtils.getTableColumnByKey(table, groupby_column_key);
|
|
269
261
|
const {
|
|
270
262
|
type: columnType
|
|
271
263
|
} = groupByColumn;
|
|
272
|
-
if (columnType ===
|
|
264
|
+
if (columnType === CellType.SINGLE_SELECT) {
|
|
273
265
|
return true;
|
|
274
266
|
}
|
|
275
267
|
return false;
|
|
276
268
|
};
|
|
277
269
|
this.renderDisplayAnnotation = () => {
|
|
278
270
|
const display_annotation = this.getDisplayAnnotation();
|
|
279
|
-
return /*#__PURE__*/
|
|
271
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
280
272
|
className: "statistic-chart-parameter-item"
|
|
281
|
-
}, /*#__PURE__*/
|
|
273
|
+
}, /*#__PURE__*/React.createElement(ToggleSetting, {
|
|
282
274
|
isChecked: display_annotation,
|
|
283
275
|
handleToggleChange: this.onToggleDisplayAnnotation,
|
|
284
|
-
label:
|
|
276
|
+
label: intl.get('Display_annotation')
|
|
285
277
|
}));
|
|
286
278
|
};
|
|
287
279
|
this.onToggleDisplayAnnotation = e => {
|
|
@@ -312,12 +304,12 @@ class PieStyleSettings extends _react.Component {
|
|
|
312
304
|
const {
|
|
313
305
|
annotation_font_size
|
|
314
306
|
} = statItem;
|
|
315
|
-
return /*#__PURE__*/
|
|
307
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
316
308
|
className: "statistic-chart-parameter-item"
|
|
317
|
-
}, /*#__PURE__*/
|
|
309
|
+
}, /*#__PURE__*/React.createElement(LabelFontSizeEditor, {
|
|
318
310
|
id: 'annotation-font-size',
|
|
319
|
-
labelText:
|
|
320
|
-
fontSize: annotation_font_size ||
|
|
311
|
+
labelText: intl.get('Font_size'),
|
|
312
|
+
fontSize: annotation_font_size || DEFAULT_ANNOTATION_SIZE,
|
|
321
313
|
onChangeFontSize: this.onChangeAnnotationFontSize
|
|
322
314
|
}));
|
|
323
315
|
};
|
|
@@ -344,16 +336,16 @@ class PieStyleSettings extends _react.Component {
|
|
|
344
336
|
show_percent,
|
|
345
337
|
display_label
|
|
346
338
|
} = statItem;
|
|
347
|
-
return /*#__PURE__*/
|
|
339
|
+
return /*#__PURE__*/React.createElement(Fragment, null, this.renderShowLegend(), /*#__PURE__*/React.createElement("div", {
|
|
348
340
|
className: "statistic-chart-parameter-divider"
|
|
349
|
-
}), this.renderDisplayLabel(), (show_percent || display_label) && /*#__PURE__*/
|
|
341
|
+
}), this.renderDisplayLabel(), (show_percent || display_label) && /*#__PURE__*/React.createElement(Fragment, null, this.renderLabelPositionSelector(), this.renderLabelFormatSelector(), this.renderMinimumPercent(), this.labelFontSizeEditor()), statItem.type === STAT_TYPE.RING && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
350
342
|
className: "statistic-chart-parameter-divider"
|
|
351
|
-
}), this.renderDisplayAnnotation(), this.getDisplayAnnotation() && this.renderAnnotationFontSizeEditor()), this.displayColorSelector() && /*#__PURE__*/
|
|
343
|
+
}), this.renderDisplayAnnotation(), this.getDisplayAnnotation() && this.renderAnnotationFontSizeEditor()), this.displayColorSelector() && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
352
344
|
className: "statistic-chart-parameter-divider"
|
|
353
|
-
}), /*#__PURE__*/
|
|
345
|
+
}), /*#__PURE__*/React.createElement(ColorUseTypeSelector, {
|
|
354
346
|
chart: statItem,
|
|
355
347
|
updateChart: this.props.updateStatisticsSettings
|
|
356
348
|
})));
|
|
357
349
|
}
|
|
358
350
|
}
|
|
359
|
-
|
|
351
|
+
export default PieStyleSettings;
|
package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
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 _toggleSetting = _interopRequireDefault(require("../../public-setting/toggle-setting"));
|
|
12
|
-
class TimeCompareStyle extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import ToggleSetting from '../../public-setting/toggle-setting';
|
|
4
|
+
class TimeCompareStyle extends Component {
|
|
13
5
|
constructor() {
|
|
14
6
|
super(...arguments);
|
|
15
7
|
this.onToggleIncreaseLabel = () => {
|
|
@@ -34,15 +26,15 @@ class TimeCompareStyle extends _react.Component {
|
|
|
34
26
|
display_increase_percentage
|
|
35
27
|
} = statItem;
|
|
36
28
|
if (!display_increase) return null;
|
|
37
|
-
return /*#__PURE__*/
|
|
29
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
38
30
|
className: "statistic-chart-parameter-divider"
|
|
39
|
-
}), /*#__PURE__*/
|
|
31
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
40
32
|
className: "statistic-chart-parameter-item"
|
|
41
|
-
}, /*#__PURE__*/
|
|
33
|
+
}, /*#__PURE__*/React.createElement(ToggleSetting, {
|
|
42
34
|
isChecked: display_increase_percentage || false,
|
|
43
35
|
handleToggleChange: this.onToggleIncreaseLabel,
|
|
44
|
-
label:
|
|
36
|
+
label: intl.get('Display_percentage_increase')
|
|
45
37
|
})));
|
|
46
38
|
}
|
|
47
39
|
}
|
|
48
|
-
|
|
40
|
+
export default TimeCompareStyle;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
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 _components = require("../../../components");
|
|
12
|
-
var _constants = require("../../../constants");
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { DTableSelect } from '../../../components';
|
|
4
|
+
import { STATISTICS_COUNT_SHOW, STATISTICS_COUNT_TYPE, STAT_TYPE, SUMMARY_METHOD, TIME_COLUMN_LIST } from '../../../constants';
|
|
13
5
|
const DATE_COLUMN_SUMMARY_METHOD = ['Max', 'Min'];
|
|
14
|
-
class SummaryMethodSettings extends
|
|
6
|
+
class SummaryMethodSettings extends Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.renderNumericColumn = () => {
|
|
@@ -21,15 +13,15 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
21
13
|
statItem
|
|
22
14
|
} = this.props;
|
|
23
15
|
let selectedColumnOption = this.props.getSelectedColumnOption(summaryColumnKey, numericColumnsOptions);
|
|
24
|
-
return /*#__PURE__*/
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
17
|
className: "statistic-chart-parameter-item"
|
|
26
|
-
}, /*#__PURE__*/
|
|
18
|
+
}, /*#__PURE__*/React.createElement("label", null, statItem.type === STAT_TYPE.PIVOT_TABLE ? intl.get('Summary_column') : intl.get('Numeric_column')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
27
19
|
value: selectedColumnOption,
|
|
28
20
|
onChange: this.onSelectNumericColumn,
|
|
29
21
|
options: numericColumnsOptions,
|
|
30
|
-
placeholder:
|
|
22
|
+
placeholder: intl.get('Select_a_column'),
|
|
31
23
|
noOptionsMessage: () => {
|
|
32
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/React.createElement("span", null, intl.get('No_options'));
|
|
33
25
|
}
|
|
34
26
|
}));
|
|
35
27
|
};
|
|
@@ -42,26 +34,26 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
42
34
|
let selectedMethodOption = this.getSelectedMethodOption(summaryMethod, this.summaryMethodsOptions);
|
|
43
35
|
let summaryMethodOption = this.summaryMethodsOptions;
|
|
44
36
|
let selectedColumnOption = this.props.getSelectedColumnOption(summaryColumnKey, numericColumnsOptions);
|
|
45
|
-
if (selectedColumnOption &&
|
|
37
|
+
if (selectedColumnOption && TIME_COLUMN_LIST.includes(selectedColumnOption.value.type)) {
|
|
46
38
|
summaryMethodOption = summaryMethodOption.filter(option => {
|
|
47
39
|
return option.value === DATE_COLUMN_SUMMARY_METHOD[0] || option.value === DATE_COLUMN_SUMMARY_METHOD[1];
|
|
48
40
|
});
|
|
49
41
|
}
|
|
50
|
-
return /*#__PURE__*/
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
43
|
className: "statistic-chart-parameter-item"
|
|
52
|
-
}, /*#__PURE__*/
|
|
44
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
53
45
|
value: selectedMethodOption,
|
|
54
46
|
onChange: this.onSelectSummaryMethod,
|
|
55
47
|
options: summaryMethodOption
|
|
56
48
|
}));
|
|
57
49
|
};
|
|
58
50
|
this.getSummaryMethodsOptions = () => {
|
|
59
|
-
return
|
|
51
|
+
return SUMMARY_METHOD.map(m => {
|
|
60
52
|
return {
|
|
61
53
|
value: m,
|
|
62
|
-
label: /*#__PURE__*/
|
|
54
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
63
55
|
className: 'select-module select-module-name'
|
|
64
|
-
},
|
|
56
|
+
}, intl.get(STATISTICS_COUNT_SHOW[m]))
|
|
65
57
|
};
|
|
66
58
|
});
|
|
67
59
|
};
|
|
@@ -79,9 +71,9 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
79
71
|
}
|
|
80
72
|
let summaryColumnKey = null;
|
|
81
73
|
let summaryMethod = null;
|
|
82
|
-
if (type ===
|
|
74
|
+
if (type === STATISTICS_COUNT_TYPE.ADVANCED && Array.isArray(numericColumnsOptions) && numericColumnsOptions.length > 0) {
|
|
83
75
|
summaryColumnKey = numericColumnsOptions[0].value.key;
|
|
84
|
-
summaryMethod =
|
|
76
|
+
summaryMethod = SUMMARY_METHOD[0];
|
|
85
77
|
}
|
|
86
78
|
this.props.onChangeSummaryType(type, summaryColumnKey, summaryMethod);
|
|
87
79
|
};
|
|
@@ -96,7 +88,7 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
96
88
|
onSelectNumericColumn
|
|
97
89
|
} = this.props;
|
|
98
90
|
const newSummaryColumnType = columnOption.value.type;
|
|
99
|
-
if (
|
|
91
|
+
if (TIME_COLUMN_LIST.includes(newSummaryColumnType) && !DATE_COLUMN_SUMMARY_METHOD.includes(this.props.summaryMethod)) {
|
|
100
92
|
updateStatItem(Object.assign({}, statItem, {
|
|
101
93
|
summary_method: DATE_COLUMN_SUMMARY_METHOD[1],
|
|
102
94
|
summary_column_key: newSummaryColumnKey
|
|
@@ -115,7 +107,7 @@ class SummaryMethodSettings extends _react.Component {
|
|
|
115
107
|
this.summaryMethodsOptions = this.getSummaryMethodsOptions();
|
|
116
108
|
}
|
|
117
109
|
render() {
|
|
118
|
-
return /*#__PURE__*/
|
|
110
|
+
return /*#__PURE__*/React.createElement(Fragment, null, this.renderNumericColumn(), this.renderSummaryMethod());
|
|
119
111
|
}
|
|
120
112
|
}
|
|
121
|
-
|
|
113
|
+
export default SummaryMethodSettings;
|
|
@@ -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 _components = require("../../../components");
|
|
12
|
-
var _constants = require("../../../constants");
|
|
13
|
-
const SUMMARY_TYPES = [_constants.SUMMARY_TYPE.COUNT, _constants.SUMMARY_TYPE.ADVANCED];
|
|
14
|
-
class SummarySettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { DTableSelect } from '../../../components';
|
|
4
|
+
import { STATISTICS_COUNT_SHOW, STATISTICS_COUNT_TYPE, STAT_TYPE, SUMMARY_METHOD, SUMMARY_TYPE } from '../../../constants';
|
|
5
|
+
const SUMMARY_TYPES = [SUMMARY_TYPE.COUNT, SUMMARY_TYPE.ADVANCED];
|
|
6
|
+
class SummarySettings extends Component {
|
|
15
7
|
constructor(props) {
|
|
16
8
|
super(props);
|
|
17
9
|
this.getSummaryTypeOptions = () => {
|
|
@@ -19,9 +11,9 @@ class SummarySettings extends _react.Component {
|
|
|
19
11
|
return SUMMARY_TYPES.map((type, index) => {
|
|
20
12
|
return {
|
|
21
13
|
value: type,
|
|
22
|
-
label: /*#__PURE__*/
|
|
14
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
23
15
|
className: 'select-module select-module-name'
|
|
24
|
-
},
|
|
16
|
+
}, intl.get(STATISTICS_COUNT_SHOW[type])), /*#__PURE__*/React.createElement("div", {
|
|
25
17
|
className: "summary-type-explanation"
|
|
26
18
|
}, summaryExplanation[type]))
|
|
27
19
|
};
|
|
@@ -34,20 +26,20 @@ class SummarySettings extends _react.Component {
|
|
|
34
26
|
const {
|
|
35
27
|
type
|
|
36
28
|
} = statItem;
|
|
37
|
-
if (type ===
|
|
29
|
+
if (type === STAT_TYPE.PIE || type === STAT_TYPE.RING || type === STAT_TYPE.TREEMAP) {
|
|
38
30
|
return {
|
|
39
|
-
count:
|
|
40
|
-
advanced:
|
|
31
|
+
count: intl.get('Count_the_number_of_records_in_each_group'),
|
|
32
|
+
advanced: intl.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_a_field')
|
|
41
33
|
};
|
|
42
|
-
} else if (type ===
|
|
34
|
+
} else if (type === STAT_TYPE.HORIZONTAL_BAR) {
|
|
43
35
|
return {
|
|
44
|
-
count:
|
|
45
|
-
advanced:
|
|
36
|
+
count: intl.get('Group_the_records_according_to_the_vertical_axis_and_count_the_records_in_each_group'),
|
|
37
|
+
advanced: intl.get('Group_the_records_according_to_the_vertical_axis_and_compute_the_sum_maximum_or_minimum_of_records_in_each_group_by_a_field')
|
|
46
38
|
};
|
|
47
39
|
}
|
|
48
40
|
return {
|
|
49
|
-
count:
|
|
50
|
-
advanced:
|
|
41
|
+
count: intl.get('Count_the_records'),
|
|
42
|
+
advanced: intl.get('Compute_sum_max_min')
|
|
51
43
|
};
|
|
52
44
|
};
|
|
53
45
|
this.renderSummaryTypes = () => {
|
|
@@ -57,9 +49,9 @@ class SummarySettings extends _react.Component {
|
|
|
57
49
|
} = this.props;
|
|
58
50
|
summaryType = summaryType || 'count';
|
|
59
51
|
const selectedSummaryMethod = this.summaryTypeOptions.find(item => item.value === summaryType) || this.summaryTypeOptions[0];
|
|
60
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
53
|
className: "statistic-chart-parameter-item"
|
|
62
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/React.createElement("label", null, label), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
63
55
|
classNamePrefix: 'statistic-chart-summary-types',
|
|
64
56
|
value: selectedSummaryMethod,
|
|
65
57
|
onChange: this.onChangeSummaryType,
|
|
@@ -72,35 +64,35 @@ class SummarySettings extends _react.Component {
|
|
|
72
64
|
numericColumnsOptions
|
|
73
65
|
} = this.props;
|
|
74
66
|
const selectedColumnOption = this.props.getSelectedColumnOption(summaryColumnKey, numericColumnsOptions);
|
|
75
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
76
68
|
className: "statistic-chart-parameter-item"
|
|
77
|
-
}, /*#__PURE__*/
|
|
69
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Numeric_column')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
78
70
|
value: selectedColumnOption,
|
|
79
71
|
onChange: this.onSelectNumericColumn,
|
|
80
72
|
options: numericColumnsOptions,
|
|
81
|
-
placeholder:
|
|
73
|
+
placeholder: intl.get('Select_a_column'),
|
|
82
74
|
noOptionsMessage: () => {
|
|
83
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/React.createElement("span", null, intl.get('No_options'));
|
|
84
76
|
}
|
|
85
77
|
}));
|
|
86
78
|
};
|
|
87
79
|
this.renderSummaryMethod = () => {
|
|
88
80
|
const selectedMethodOption = this.getSelectedMethodOption(this.props.summaryMethod, this.summaryMethodsOptions);
|
|
89
|
-
return /*#__PURE__*/
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
82
|
className: "statistic-chart-parameter-item"
|
|
91
|
-
}, /*#__PURE__*/
|
|
83
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Summary_method')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
92
84
|
value: selectedMethodOption,
|
|
93
85
|
onChange: this.onSelectSummaryMethod,
|
|
94
86
|
options: this.summaryMethodsOptions
|
|
95
87
|
}));
|
|
96
88
|
};
|
|
97
89
|
this.getSummaryMethodsOptions = () => {
|
|
98
|
-
return
|
|
90
|
+
return SUMMARY_METHOD.map(m => {
|
|
99
91
|
return {
|
|
100
92
|
value: m,
|
|
101
|
-
label: /*#__PURE__*/
|
|
93
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
102
94
|
className: 'select-module select-module-name'
|
|
103
|
-
},
|
|
95
|
+
}, intl.get(STATISTICS_COUNT_SHOW[m]))
|
|
104
96
|
};
|
|
105
97
|
});
|
|
106
98
|
};
|
|
@@ -116,7 +108,7 @@ class SummarySettings extends _react.Component {
|
|
|
116
108
|
return;
|
|
117
109
|
}
|
|
118
110
|
const summaryColumnKey = null;
|
|
119
|
-
const summaryMethod = type ===
|
|
111
|
+
const summaryMethod = type === STATISTICS_COUNT_TYPE.ADVANCED ? SUMMARY_METHOD[0] : null;
|
|
120
112
|
this.props.onChangeSummaryType(type, summaryColumnKey, summaryMethod);
|
|
121
113
|
};
|
|
122
114
|
this.onSelectNumericColumn = columnOption => {
|
|
@@ -137,7 +129,7 @@ class SummarySettings extends _react.Component {
|
|
|
137
129
|
this.summaryTypeOptions = this.getSummaryTypeOptions();
|
|
138
130
|
}
|
|
139
131
|
render() {
|
|
140
|
-
return /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/React.createElement(Fragment, null, this.renderSummaryTypes(), this.props.summaryType === STATISTICS_COUNT_TYPE.ADVANCED && /*#__PURE__*/React.createElement(Fragment, null, this.renderNumericColumn(), this.renderSummaryMethod()));
|
|
141
133
|
}
|
|
142
134
|
}
|
|
143
|
-
|
|
135
|
+
export default SummarySettings;
|