dtable-statistic 4.4.23 → 4.4.24-alpha.1
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/assets/css/dashboard.css +1 -0
- package/es/assets/css/dialog.css +30 -0
- package/es/components/dialog/chart-edit-dialog.js +92 -0
- package/es/components/dialog/enlarged-chart-dialog.js +8 -13
- package/es/components/dialog/statistic-record-dialog/index.js +22 -30
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +2 -2
- package/es/components/index.js +1 -15
- package/es/constants/index.js +1 -2
- package/es/dashboard.js +5 -31
- package/es/desktop-dashboard.js +51 -32
- package/es/mobile-dashboard.js +8 -16
- package/es/model/conver-statItem.js +124 -0
- package/es/service/chart-service.js +8 -15
- package/es/service/dashboard-service.js +25 -29
- package/es/stat-list/chart-preview.js +19 -20
- package/es/stat-list/index.js +13 -19
- package/es/stat-view/index.js +46 -156
- package/es/utils/common-utils.js +2 -352
- package/es/utils/export-table-utils.js +0 -69
- package/es/utils/index.js +0 -89
- package/package.json +5 -7
- package/es/assets/css/color-picker.css +0 -53
- package/es/assets/css/color-rules-popover.css +0 -144
- package/es/assets/css/slider.css +0 -77
- package/es/assets/css/statistic-chart.module.css +0 -11
- package/es/assets/css/statistic-custom-title.module.css +0 -3
- package/es/assets/css/statistic-custom.module.css +0 -4
- package/es/assets/css/statistic-numeric-column-item.module.css +0 -43
- package/es/assets/css/statistic-time-picker.module.css +0 -21
- package/es/calculator/base-calculator.js +0 -80
- package/es/calculator/basic-chart-calculator.js +0 -349
- package/es/calculator/combination-calculator.js +0 -246
- package/es/calculator/compare-bar-calculator.js +0 -197
- package/es/calculator/completeness-calculator.js +0 -215
- package/es/calculator/copy-value.js +0 -53
- package/es/calculator/dashboard-calculator.js +0 -70
- package/es/calculator/heat-map-calculator.js +0 -148
- package/es/calculator/horizontal-bar-calculator.js +0 -67
- package/es/calculator/index.js +0 -81
- package/es/calculator/map-calculator.js +0 -103
- package/es/calculator/mirror-calculator.js +0 -146
- package/es/calculator/number-card-calculator.js +0 -60
- package/es/calculator/pivot-table-calculator.js +0 -821
- package/es/calculator/scatter-calculator.js +0 -75
- package/es/calculator/thread-manager.js +0 -57
- package/es/calculator/trend-calculator.js +0 -113
- package/es/calculator/workers/basic-chart-calculator-worker.js +0 -495
- package/es/calculator/workers/calculator.worker.js +0 -44
- package/es/calculator/workers/card-calculator-worker.js +0 -40
- package/es/calculator/workers/combination-calculator-worker.js +0 -276
- package/es/calculator/workers/compare-bar-chart-calculator-worker.js +0 -150
- package/es/calculator/workers/completeness-calculator-worker.js +0 -208
- package/es/calculator/workers/dashboard-calculator-worker.js +0 -68
- package/es/calculator/workers/mirror-calculator-worker.js +0 -152
- package/es/calculator/workers/pivot-table-calculator-worker.js +0 -718
- package/es/calculator/workers/scatter-calculator-worker.js +0 -80
- package/es/calculator/workers/trend-calculator-worker.js +0 -108
- package/es/calculator/world-map-calculator.js +0 -124
- package/es/components/common-add-tool.js +0 -28
- package/es/components/dialog/chart-addition-edit-dialog.js +0 -90
- package/es/components/dialog/chart-addition-widgets/chart-selector.js +0 -259
- package/es/components/dialog/chart-addition-widgets/statistic-chart-selector.module.css +0 -83
- package/es/components/dialog/statistic-types-dialog/index.css +0 -14
- package/es/components/dialog/statistic-types-dialog/index.js +0 -62
- package/es/components/popover/color-rules/color-rule.js +0 -183
- package/es/components/popover/color-rules/index.js +0 -87
- package/es/components/popover/color-rules/rule-filters/filter.js +0 -221
- package/es/components/popover/color-rules/rule-filters/index.css +0 -210
- package/es/components/popover/color-rules/rule-filters/index.js +0 -97
- package/es/components/popover/color-rules/rule-filters/number-input.js +0 -78
- package/es/components/popover/color-rules-popover.js +0 -217
- package/es/components/popover/color-selector-popover.js +0 -82
- package/es/components/seatable-radio/index.css +0 -51
- package/es/components/seatable-radio/index.js +0 -35
- package/es/custom-g2.js +0 -644
- package/es/model/bar-group.js +0 -58
- package/es/model/bar.js +0 -47
- package/es/model/base-model.js +0 -18
- package/es/model/basic-number-card.js +0 -25
- package/es/model/combination.js +0 -48
- package/es/model/compare-bar.js +0 -56
- package/es/model/completeness-group.js +0 -31
- package/es/model/completeness.js +0 -25
- package/es/model/custom-bar.js +0 -25
- package/es/model/dashboard.js +0 -20
- package/es/model/generic-model.js +0 -222
- package/es/model/heat-map.js +0 -33
- package/es/model/horizontal-bar-group.js +0 -55
- package/es/model/horizontal-bar.js +0 -47
- package/es/model/index.js +0 -187
- package/es/model/map.js +0 -38
- package/es/model/mirror.js +0 -33
- package/es/model/pie.js +0 -38
- package/es/model/ring.js +0 -40
- package/es/model/scatter.js +0 -22
- package/es/model/table.js +0 -32
- package/es/model/trend.js +0 -32
- package/es/model/world-map.js +0 -34
- package/es/stat-editor/chart-name-editor.js +0 -68
- package/es/stat-editor/index.js +0 -75
- package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +0 -153
- package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +0 -422
- package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +0 -203
- package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +0 -23
- package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +0 -104
- package/es/stat-editor/stat-settings/advance-chart-settings/index.js +0 -334
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +0 -119
- package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +0 -132
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +0 -240
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +0 -89
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +0 -138
- package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +0 -331
- package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +0 -143
- package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +0 -109
- package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +0 -153
- package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +0 -144
- package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +0 -214
- package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +0 -121
- package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +0 -172
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +0 -366
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +0 -142
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +0 -150
- package/es/stat-editor/stat-settings/basic-chart-settings/index.js +0 -473
- package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +0 -182
- package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +0 -564
- package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +0 -112
- package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +0 -87
- package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +0 -187
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +0 -300
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +0 -113
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +0 -289
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +0 -58
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +0 -359
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +0 -48
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +0 -121
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +0 -143
- package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +0 -269
- package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +0 -104
- package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +0 -366
- package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +0 -55
- package/es/stat-editor/stat-settings/color-setting/color-picker.js +0 -130
- package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +0 -374
- package/es/stat-editor/stat-settings/map/map-level.js +0 -72
- package/es/stat-editor/stat-settings/map/map-province-city.js +0 -151
- package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +0 -108
- package/es/stat-editor/stat-settings/public-setting/base-settings.js +0 -154
- package/es/stat-editor/stat-settings/public-setting/calender.js +0 -125
- package/es/stat-editor/stat-settings/public-setting/column-settings.js +0 -24
- package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +0 -62
- package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +0 -61
- package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +0 -35
- package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +0 -60
- package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +0 -123
- package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +0 -33
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.css +0 -29
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +0 -82
- package/es/stat-view/area-chart.js +0 -551
- package/es/stat-view/bar-chart.js +0 -582
- package/es/stat-view/base-chart.js +0 -132
- package/es/stat-view/basic-number-card.js +0 -201
- package/es/stat-view/combination-chart.js +0 -546
- package/es/stat-view/compare-chart.js +0 -483
- package/es/stat-view/completeness-chart.js +0 -390
- package/es/stat-view/custom-bar.js +0 -418
- package/es/stat-view/dashboard-chart.js +0 -266
- package/es/stat-view/heat-map.js +0 -463
- package/es/stat-view/horizontal-bar-chart.js +0 -562
- package/es/stat-view/line-chart.js +0 -518
- package/es/stat-view/map.js +0 -448
- package/es/stat-view/mirror.js +0 -275
- package/es/stat-view/pie-chart.js +0 -290
- package/es/stat-view/pivot-table/index.js +0 -196
- package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +0 -156
- package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +0 -176
- package/es/stat-view/pivot-table/pivot-table-display-name.js +0 -215
- package/es/stat-view/pivot-table/statistic-pivot-table.module.css +0 -132
- package/es/stat-view/pivot-table/two-dimension-table.js +0 -384
- package/es/stat-view/ring-chart.js +0 -392
- package/es/stat-view/scatter-chart.js +0 -306
- package/es/stat-view/treemap-chart.js +0 -253
- package/es/stat-view/trend-chart.js +0 -249
- package/es/stat-view/world-map.js +0 -431
- package/es/utils/basic-chart-utils.js +0 -29
- package/es/utils/cell-format.js +0 -115
- package/es/utils/collaborator.js +0 -50
- package/es/utils/color-utils.js +0 -134
- package/es/utils/column-utils.js +0 -110
- package/es/utils/column.js +0 -20
- package/es/utils/date-format.js +0 -71
- package/es/utils/map.js +0 -114
- package/es/utils/model.js +0 -19
- package/es/utils/row-utils.js +0 -134
- package/es/utils/search.js +0 -73
- package/es/utils/sql-utils.js +0 -359
- package/es/utils/stat-utils.js +0 -351
- package/es/utils/trend-utils.js +0 -135
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _rcSlider = _interopRequireDefault(require("rc-slider"));
|
|
11
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
12
|
-
var _colorGroupSelector = _interopRequireDefault(require("../../color-setting/color-group-selector"));
|
|
13
|
-
var _DTableSelect = _interopRequireDefault(require("dtable-ui-component/lib/DTableSelect"));
|
|
14
|
-
var _constants = require("../../../../constants");
|
|
15
|
-
require("../../../../assets/css/slider.css");
|
|
16
|
-
class MapStyleSetting extends _react.Component {
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
this.onSliderChange = value => {
|
|
20
|
-
this.setState({
|
|
21
|
-
legendSize: value
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
this.onAfterChange = value => {
|
|
25
|
-
const {
|
|
26
|
-
statItem
|
|
27
|
-
} = this.props;
|
|
28
|
-
this.props.updateStatItem(Object.assign({}, statItem, {
|
|
29
|
-
legend_size: value
|
|
30
|
-
}));
|
|
31
|
-
};
|
|
32
|
-
this.getSelectedDirectionOption = () => {
|
|
33
|
-
const {
|
|
34
|
-
statItem
|
|
35
|
-
} = this.props;
|
|
36
|
-
const {
|
|
37
|
-
legend_direction = 'vertical'
|
|
38
|
-
} = statItem;
|
|
39
|
-
if (legend_direction === 'vertical') {
|
|
40
|
-
return this.legendDirectionOptions[0];
|
|
41
|
-
}
|
|
42
|
-
return this.legendDirectionOptions[1];
|
|
43
|
-
};
|
|
44
|
-
this.renderLabelColor = () => {
|
|
45
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
-
className: "statistic-chart-parameter-item"
|
|
47
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, _reactIntlUniversal.default.get('Bubble_color')), /*#__PURE__*/_react.default.createElement("div", {
|
|
48
|
-
className: "row gutters-xs ml-0"
|
|
49
|
-
}, _constants.LABEL_COLORS.map((item, index) => {
|
|
50
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
-
key: "map-bubble-color-".concat(index),
|
|
52
|
-
className: "col-auto pl-0"
|
|
53
|
-
}, /*#__PURE__*/_react.default.createElement("label", {
|
|
54
|
-
className: "colorinput"
|
|
55
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
56
|
-
className: "colorinput-color statistic-colorinput",
|
|
57
|
-
onClick: this.updateBubbleColor.bind(this, item),
|
|
58
|
-
style: {
|
|
59
|
-
backgroundColor: item,
|
|
60
|
-
borderColor: item
|
|
61
|
-
}
|
|
62
|
-
}, item === (this.props.statItem.bubble_color || _constants.LABEL_COLORS[0]) && /*#__PURE__*/_react.default.createElement("i", {
|
|
63
|
-
className: "dtable-font dtable-icon-check-mark statistic-check-mark"
|
|
64
|
-
}))));
|
|
65
|
-
})));
|
|
66
|
-
};
|
|
67
|
-
this.updateBubbleColor = color => {
|
|
68
|
-
const {
|
|
69
|
-
statItem
|
|
70
|
-
} = this.props;
|
|
71
|
-
this.props.updateStatItem(Object.assign({}, statItem, {
|
|
72
|
-
bubble_color: color
|
|
73
|
-
}));
|
|
74
|
-
};
|
|
75
|
-
this.renderColorSetting = () => {
|
|
76
|
-
const {
|
|
77
|
-
onChangeColor,
|
|
78
|
-
statItem
|
|
79
|
-
} = this.props;
|
|
80
|
-
const {
|
|
81
|
-
type
|
|
82
|
-
} = statItem;
|
|
83
|
-
return !type.includes('bubble') ? /*#__PURE__*/_react.default.createElement(_colorGroupSelector.default, {
|
|
84
|
-
currentColor: statItem.data_color,
|
|
85
|
-
onChangeColor: onChangeColor
|
|
86
|
-
}) : this.renderLabelColor();
|
|
87
|
-
};
|
|
88
|
-
this.onDirectionChange = option => {
|
|
89
|
-
const {
|
|
90
|
-
statItem
|
|
91
|
-
} = this.props;
|
|
92
|
-
this.props.updateStatItem(Object.assign({}, statItem, {
|
|
93
|
-
legend_direction: option.value
|
|
94
|
-
}));
|
|
95
|
-
};
|
|
96
|
-
this.renderLegendDirection = () => {
|
|
97
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
-
className: "statistic-chart-parameter-item"
|
|
99
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, _reactIntlUniversal.default.get('Legend_direction')), /*#__PURE__*/_react.default.createElement(_DTableSelect.default, {
|
|
100
|
-
value: this.getSelectedDirectionOption(),
|
|
101
|
-
options: this.legendDirectionOptions,
|
|
102
|
-
onChange: this.onDirectionChange
|
|
103
|
-
}));
|
|
104
|
-
};
|
|
105
|
-
this.renderLegendSize = () => {
|
|
106
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
-
className: "statistic-chart-parameter-item"
|
|
108
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, _reactIntlUniversal.default.get('Legend_size')), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_rcSlider.default, {
|
|
109
|
-
value: this.state.legendSize,
|
|
110
|
-
step: 0.5,
|
|
111
|
-
min: 1,
|
|
112
|
-
max: 5,
|
|
113
|
-
onChange: this.onSliderChange,
|
|
114
|
-
onAfterChange: this.onAfterChange
|
|
115
|
-
})));
|
|
116
|
-
};
|
|
117
|
-
this.legendDirectionOptions = [{
|
|
118
|
-
value: 'vertical',
|
|
119
|
-
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
120
|
-
className: "select-option-name"
|
|
121
|
-
}, _reactIntlUniversal.default.get('Vertical'))
|
|
122
|
-
}, {
|
|
123
|
-
value: 'horizontal',
|
|
124
|
-
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
125
|
-
className: "select-option-name"
|
|
126
|
-
}, _reactIntlUniversal.default.get('Horizontal'))
|
|
127
|
-
}];
|
|
128
|
-
this.state = {
|
|
129
|
-
legendSize: props.statItem.legend_size || 1
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
render() {
|
|
133
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderColorSetting(), /*#__PURE__*/_react.default.createElement("div", {
|
|
134
|
-
className: "statistic-chart-parameter-divider"
|
|
135
|
-
}), this.renderLegendDirection(), this.renderLegendSize());
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
var _default = exports.default = MapStyleSetting;
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
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 _DTableSelect = _interopRequireDefault(require("dtable-ui-component/lib/DTableSelect"));
|
|
12
|
-
var _numericSummaryItem = _interopRequireDefault(require("../public-setting/numeric-summary-item"));
|
|
13
|
-
var _constants = require("../../../constants");
|
|
14
|
-
const GROUP_TYPES = {
|
|
15
|
-
COUNT: 'count',
|
|
16
|
-
SINGLE_NUMERIC_COLUMN: 'single_numeric_column',
|
|
17
|
-
MULTIPLE_NUMERIC_COLUMN: 'multiple_numeric_column'
|
|
18
|
-
};
|
|
19
|
-
class SummarySettings extends _react.Component {
|
|
20
|
-
constructor(props) {
|
|
21
|
-
super(props);
|
|
22
|
-
this.getSummaryTypeOptions = () => {
|
|
23
|
-
const summaryTypes = [{
|
|
24
|
-
value: GROUP_TYPES.COUNT,
|
|
25
|
-
label: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
-
className: 'select-module select-module-name'
|
|
27
|
-
}, _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW['count'])), /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
-
className: "summary-type-explanation"
|
|
29
|
-
}, this.summaryExplanation['count']))
|
|
30
|
-
}, {
|
|
31
|
-
value: GROUP_TYPES.SINGLE_NUMERIC_COLUMN,
|
|
32
|
-
label: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
-
className: 'select-module select-module-name'
|
|
34
|
-
}, _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW['advanced'])), /*#__PURE__*/_react.default.createElement("div", {
|
|
35
|
-
className: "summary-type-explanation"
|
|
36
|
-
}, this.summaryExplanation['advanced']))
|
|
37
|
-
}];
|
|
38
|
-
|
|
39
|
-
// multiple_numeric_column
|
|
40
|
-
if (this.props.useMultipleSummaryColumns) {
|
|
41
|
-
summaryTypes.push({
|
|
42
|
-
value: GROUP_TYPES.MULTIPLE_NUMERIC_COLUMN,
|
|
43
|
-
label: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
44
|
-
className: 'select-module select-module-name'
|
|
45
|
-
}, _reactIntlUniversal.default.get('Summarize_multiple_fields')), /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
-
className: "summary-type-explanation"
|
|
47
|
-
}, _reactIntlUniversal.default.get('Compute_the_sum_maximum_or_minimum_value_of_records_in_each_group_by_multiple_fields')))
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return summaryTypes;
|
|
51
|
-
};
|
|
52
|
-
this.getSummaryExplanation = () => {
|
|
53
|
-
const {
|
|
54
|
-
statItem
|
|
55
|
-
} = this.props;
|
|
56
|
-
const chartType = statItem.type;
|
|
57
|
-
let variable = '';
|
|
58
|
-
if (chartType === 'map') {
|
|
59
|
-
variable = '位置字段';
|
|
60
|
-
}
|
|
61
|
-
if (chartType === 'world_map') {
|
|
62
|
-
variable = _reactIntlUniversal.default.get('Location_field');
|
|
63
|
-
}
|
|
64
|
-
if (chartType === 'heat_map') {
|
|
65
|
-
variable = _reactIntlUniversal.default.get('Time_field');
|
|
66
|
-
}
|
|
67
|
-
if (chartType === 'mirror') {
|
|
68
|
-
variable = _reactIntlUniversal.default.get('Statistic_field');
|
|
69
|
-
}
|
|
70
|
-
if (chartType === 'combination_chart') {
|
|
71
|
-
variable = _reactIntlUniversal.default.get('X-axis');
|
|
72
|
-
}
|
|
73
|
-
if (chartType === 'trend_chart') {
|
|
74
|
-
return {
|
|
75
|
-
count: _reactIntlUniversal.default.get('Calculate_the_number_of_records_in_two_time_periods'),
|
|
76
|
-
advanced: _reactIntlUniversal.default.get('Use_a_field_to_calculate_the_sum_maximum_or_minimum_value_of_records_in_two_time_periods')
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
count: _reactIntlUniversal.default.get('Count_by_var', {
|
|
81
|
-
var: variable
|
|
82
|
-
}),
|
|
83
|
-
advanced: _reactIntlUniversal.default.get('Compute_sum_max_min_by_var', {
|
|
84
|
-
var: variable
|
|
85
|
-
})
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
this.getSummaryMethodsOptions = () => {
|
|
89
|
-
return _constants.SUMMARY_METHOD.map(method => {
|
|
90
|
-
return {
|
|
91
|
-
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
92
|
-
className: "select-option-name"
|
|
93
|
-
}, _reactIntlUniversal.default.get(_constants.STATISTICS_COUNT_SHOW[method])),
|
|
94
|
-
value: method
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
this.getSelectedMethodOption = (method, summaryMethodsOptions) => {
|
|
99
|
-
return summaryMethodsOptions.find(m => m.value === method) || summaryMethodsOptions[0];
|
|
100
|
-
};
|
|
101
|
-
this.renderSummaryTypes = () => {
|
|
102
|
-
let {
|
|
103
|
-
label
|
|
104
|
-
} = this.props;
|
|
105
|
-
const selectedSummaryType = this.getSelectedSummaryType();
|
|
106
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
-
className: "statistic-chart-parameter-item"
|
|
108
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, label), /*#__PURE__*/_react.default.createElement(_DTableSelect.default, {
|
|
109
|
-
classNamePrefix: 'statistic-chart-summary-types',
|
|
110
|
-
value: selectedSummaryType,
|
|
111
|
-
onChange: this.onChangeSummaryType,
|
|
112
|
-
options: this.summaryTypeOptions
|
|
113
|
-
}));
|
|
114
|
-
};
|
|
115
|
-
this.getSelectedSummaryType = () => {
|
|
116
|
-
const {
|
|
117
|
-
summaryType = 'count',
|
|
118
|
-
statItem,
|
|
119
|
-
useMultipleSummaryColumns
|
|
120
|
-
} = this.props;
|
|
121
|
-
if (summaryType === _constants.SUMMARY_TYPE.COUNT) {
|
|
122
|
-
return this.summaryTypeOptions[0];
|
|
123
|
-
}
|
|
124
|
-
if (statItem.type === _constants.STAT_TYPE.COMBINATION_CHART && statItem.y_axis_left_group_by_multiple_numeric_column && useMultipleSummaryColumns) {
|
|
125
|
-
return this.summaryTypeOptions[2];
|
|
126
|
-
}
|
|
127
|
-
return this.summaryTypeOptions[1];
|
|
128
|
-
};
|
|
129
|
-
this.onChangeSummaryType = option => {
|
|
130
|
-
const type = option.value;
|
|
131
|
-
let {
|
|
132
|
-
summaryType
|
|
133
|
-
} = this.props;
|
|
134
|
-
if (type === summaryType) return;
|
|
135
|
-
this.props.onChangeSummaryType(type);
|
|
136
|
-
};
|
|
137
|
-
this.onSelectSummaryColumn = option => {
|
|
138
|
-
this.props.onSelectSummaryColumn(option.value.key);
|
|
139
|
-
};
|
|
140
|
-
this.renderNumericColumn = () => {
|
|
141
|
-
const {
|
|
142
|
-
summaryColumn
|
|
143
|
-
} = this.props;
|
|
144
|
-
const selectedColumnOption = this.numericColumnsOptions.find(o => o.value.key === summaryColumn) || null;
|
|
145
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
146
|
-
className: "statistic-chart-parameter-item"
|
|
147
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, _reactIntlUniversal.default.get('Numeric_column')), /*#__PURE__*/_react.default.createElement(_DTableSelect.default, {
|
|
148
|
-
value: selectedColumnOption,
|
|
149
|
-
onChange: this.onSelectSummaryColumn,
|
|
150
|
-
options: this.numericColumnsOptions,
|
|
151
|
-
placeholder: _reactIntlUniversal.default.get('Select_column'),
|
|
152
|
-
noOptionsMessage: () => {
|
|
153
|
-
return /*#__PURE__*/_react.default.createElement("span", null, _reactIntlUniversal.default.get('No_options'));
|
|
154
|
-
}
|
|
155
|
-
}));
|
|
156
|
-
};
|
|
157
|
-
this.renderSummaryMethod = () => {
|
|
158
|
-
let selectedMethodOption = this.getSelectedMethodOption(this.props.summaryMethod, this.summaryMethodsOptions);
|
|
159
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
-
className: "statistic-chart-parameter-item"
|
|
161
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, _reactIntlUniversal.default.get('Summary_method')), /*#__PURE__*/_react.default.createElement(_DTableSelect.default, {
|
|
162
|
-
value: selectedMethodOption,
|
|
163
|
-
onChange: this.onSelectSummaryMethod,
|
|
164
|
-
options: this.summaryMethodsOptions
|
|
165
|
-
}));
|
|
166
|
-
};
|
|
167
|
-
this.onSelectSummaryMethod = option => {
|
|
168
|
-
this.props.onSelectSummaryMethod(option.value);
|
|
169
|
-
};
|
|
170
|
-
this.renderNumericSummaryItem = () => {
|
|
171
|
-
const {
|
|
172
|
-
statItem,
|
|
173
|
-
onSelectSummaryColumn,
|
|
174
|
-
onSelectSummaryMethod
|
|
175
|
-
} = this.props;
|
|
176
|
-
const {
|
|
177
|
-
type
|
|
178
|
-
} = statItem;
|
|
179
|
-
let column_key, summary_method;
|
|
180
|
-
if (type === _constants.STAT_TYPE.COMBINATION_CHART) {
|
|
181
|
-
column_key = statItem.y_axis_left_summary_column;
|
|
182
|
-
summary_method = statItem.y_axis_left_summary_method;
|
|
183
|
-
}
|
|
184
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_numericSummaryItem.default, {
|
|
185
|
-
statItem: statItem,
|
|
186
|
-
key: "number-column-".concat(0),
|
|
187
|
-
numericColumnsOptions: this.numericColumnsOptions,
|
|
188
|
-
summaryMethodOptions: this.summaryMethodsOptions,
|
|
189
|
-
index: 0,
|
|
190
|
-
numericColumnItem: {
|
|
191
|
-
column_key,
|
|
192
|
-
summary_method
|
|
193
|
-
},
|
|
194
|
-
onChangeColumnOption: (index, option) => onSelectSummaryColumn(option.value.key),
|
|
195
|
-
onChangeSummaryMethod: (index, option) => onSelectSummaryMethod(option.value)
|
|
196
|
-
}), this.renderGroupbyNumericColumns(), Array.isArray(this.numericColumnsOptions) && this.numericColumnsOptions.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
197
|
-
className: "statistics-add-number-column",
|
|
198
|
-
onClick: this.onAddNumericColumn
|
|
199
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
200
|
-
className: "number-column-item dtable-font dtable-icon-add-table"
|
|
201
|
-
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
202
|
-
className: "number-column-item add-number-column-description"
|
|
203
|
-
}, _reactIntlUniversal.default.get('Add_new_numeric_column'))));
|
|
204
|
-
};
|
|
205
|
-
this.onDeleteNumericColumnItem = index => {
|
|
206
|
-
let {
|
|
207
|
-
y_axis_left_group_by_numeric_columns
|
|
208
|
-
} = this.props.statItem || {};
|
|
209
|
-
y_axis_left_group_by_numeric_columns = y_axis_left_group_by_numeric_columns || [];
|
|
210
|
-
y_axis_left_group_by_numeric_columns = [...y_axis_left_group_by_numeric_columns];
|
|
211
|
-
y_axis_left_group_by_numeric_columns.splice(index - 1, 1);
|
|
212
|
-
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
213
|
-
y_axis_left_group_by_numeric_columns: [...y_axis_left_group_by_numeric_columns]
|
|
214
|
-
}));
|
|
215
|
-
};
|
|
216
|
-
this.onAddNumericColumn = () => {
|
|
217
|
-
let {
|
|
218
|
-
statItem
|
|
219
|
-
} = this.props;
|
|
220
|
-
let {
|
|
221
|
-
y_axis_left_group_by_numeric_columns
|
|
222
|
-
} = statItem || {};
|
|
223
|
-
let newNumericColumnKey = this.numericColumnsOptions[0].value.key;
|
|
224
|
-
if (Array.isArray(y_axis_left_group_by_numeric_columns)) {
|
|
225
|
-
y_axis_left_group_by_numeric_columns = [...y_axis_left_group_by_numeric_columns];
|
|
226
|
-
y_axis_left_group_by_numeric_columns.push({
|
|
227
|
-
column_key: newNumericColumnKey,
|
|
228
|
-
summary_method: _constants.SUMMARY_METHOD[0]
|
|
229
|
-
});
|
|
230
|
-
} else {
|
|
231
|
-
y_axis_left_group_by_numeric_columns = [{
|
|
232
|
-
column_key: newNumericColumnKey,
|
|
233
|
-
summary_method: _constants.SUMMARY_METHOD[0]
|
|
234
|
-
}];
|
|
235
|
-
}
|
|
236
|
-
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
237
|
-
y_axis_left_group_by_numeric_columns: [...y_axis_left_group_by_numeric_columns]
|
|
238
|
-
}));
|
|
239
|
-
};
|
|
240
|
-
this.onChangeNumericSummaryColumn = (index, columnOption) => {
|
|
241
|
-
let {
|
|
242
|
-
y_axis_left_group_by_numeric_columns
|
|
243
|
-
} = this.props.statItem || {};
|
|
244
|
-
y_axis_left_group_by_numeric_columns = y_axis_left_group_by_numeric_columns || [];
|
|
245
|
-
y_axis_left_group_by_numeric_columns = [...y_axis_left_group_by_numeric_columns];
|
|
246
|
-
let selectedItem = y_axis_left_group_by_numeric_columns[index - 1];
|
|
247
|
-
selectedItem = Object.assign({}, selectedItem, {
|
|
248
|
-
column_key: columnOption.value.key
|
|
249
|
-
});
|
|
250
|
-
y_axis_left_group_by_numeric_columns[index - 1] = selectedItem;
|
|
251
|
-
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
252
|
-
y_axis_left_group_by_numeric_columns
|
|
253
|
-
}));
|
|
254
|
-
};
|
|
255
|
-
this.onChangeNumericSummaryMethod = (index, option) => {
|
|
256
|
-
let {
|
|
257
|
-
y_axis_left_group_by_numeric_columns
|
|
258
|
-
} = this.props.statItem || {};
|
|
259
|
-
y_axis_left_group_by_numeric_columns = y_axis_left_group_by_numeric_columns || [];
|
|
260
|
-
y_axis_left_group_by_numeric_columns = [...y_axis_left_group_by_numeric_columns];
|
|
261
|
-
let selectedItem = y_axis_left_group_by_numeric_columns[index - 1];
|
|
262
|
-
selectedItem = Object.assign({}, selectedItem, {
|
|
263
|
-
summary_method: option.value
|
|
264
|
-
});
|
|
265
|
-
y_axis_left_group_by_numeric_columns[index - 1] = selectedItem;
|
|
266
|
-
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
267
|
-
y_axis_left_group_by_numeric_columns
|
|
268
|
-
}));
|
|
269
|
-
};
|
|
270
|
-
this.renderGroupbyNumericColumns = () => {
|
|
271
|
-
const {
|
|
272
|
-
statItem
|
|
273
|
-
} = this.props;
|
|
274
|
-
let {
|
|
275
|
-
y_axis_left_group_by_numeric_columns
|
|
276
|
-
} = statItem;
|
|
277
|
-
if (!y_axis_left_group_by_numeric_columns || !Array.isArray(y_axis_left_group_by_numeric_columns)) return null;
|
|
278
|
-
return y_axis_left_group_by_numeric_columns.map((item, index) => {
|
|
279
|
-
return /*#__PURE__*/_react.default.createElement(_numericSummaryItem.default, {
|
|
280
|
-
statItem: statItem,
|
|
281
|
-
key: "number-column-".concat(index),
|
|
282
|
-
numericColumnsOptions: this.numericColumnsOptions,
|
|
283
|
-
summaryMethodOptions: this.summaryMethodsOptions,
|
|
284
|
-
index: index + 1,
|
|
285
|
-
numericColumnItem: item,
|
|
286
|
-
onDeleteNumericColumnItem: this.onDeleteNumericColumnItem,
|
|
287
|
-
onChangeColumnOption: this.onChangeNumericSummaryColumn,
|
|
288
|
-
onChangeSummaryMethod: this.onChangeNumericSummaryMethod
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
};
|
|
292
|
-
this.useMultipleSummaryColumns = () => {
|
|
293
|
-
const {
|
|
294
|
-
statItem,
|
|
295
|
-
summaryType,
|
|
296
|
-
useMultipleSummaryColumns
|
|
297
|
-
} = this.props;
|
|
298
|
-
if (statItem.type === _constants.STAT_TYPE.COMBINATION_CHART) {
|
|
299
|
-
if (useMultipleSummaryColumns && summaryType === _constants.SUMMARY_TYPE.ADVANCED && statItem.y_axis_left_group_by_multiple_numeric_column) {
|
|
300
|
-
return true;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
return false;
|
|
304
|
-
};
|
|
305
|
-
const {
|
|
306
|
-
numericColumns,
|
|
307
|
-
getColumnsOptions
|
|
308
|
-
} = props;
|
|
309
|
-
this.numericColumnsOptions = getColumnsOptions(numericColumns);
|
|
310
|
-
this.summaryMethodsOptions = this.getSummaryMethodsOptions();
|
|
311
|
-
this.summaryExplanation = this.getSummaryExplanation();
|
|
312
|
-
this.summaryTypeOptions = this.getSummaryTypeOptions();
|
|
313
|
-
}
|
|
314
|
-
componentWillReceiveProps(nextProps) {
|
|
315
|
-
if (nextProps.selectedTableId !== this.props.selectedTableId) {
|
|
316
|
-
const {
|
|
317
|
-
numericColumns,
|
|
318
|
-
getColumnsOptions
|
|
319
|
-
} = nextProps;
|
|
320
|
-
this.numericColumnsOptions = getColumnsOptions(numericColumns);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
render() {
|
|
324
|
-
const {
|
|
325
|
-
summaryType
|
|
326
|
-
} = this.props;
|
|
327
|
-
const _useMultipleSummaryColumns = this.useMultipleSummaryColumns();
|
|
328
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, this.renderSummaryTypes(), !_useMultipleSummaryColumns && summaryType === _constants.SUMMARY_TYPE.ADVANCED && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, this.renderNumericColumn(), this.renderSummaryMethod()), _useMultipleSummaryColumns && this.renderNumericSummaryItem());
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
var _default = exports.default = SummarySettings;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
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 _DTableSelect = _interopRequireDefault(require("dtable-ui-component/lib/DTableSelect"));
|
|
12
|
-
var _columnSettings = _interopRequireDefault(require("../public-setting/column-settings"));
|
|
13
|
-
var _baseSettings = _interopRequireDefault(require("../public-setting/base-settings"));
|
|
14
|
-
var _summarySettings = _interopRequireDefault(require("./summary-settings"));
|
|
15
|
-
var _columnUtils = require("../../../utils/column-utils");
|
|
16
|
-
const COMPARE_GRANULARITY = ['day', 'week', 'quarter', 'month', 'year', 'days_7', 'days_30'];
|
|
17
|
-
const COMPARED_LIST = {
|
|
18
|
-
[COMPARE_GRANULARITY[0]]: 'Yesterday_vs_the_day_before_yesterday',
|
|
19
|
-
[COMPARE_GRANULARITY[1]]: 'Last_week_vs_the_week_before_last',
|
|
20
|
-
[COMPARE_GRANULARITY[3]]: 'Last_month_vs_the_month_before_last',
|
|
21
|
-
[COMPARE_GRANULARITY[2]]: 'Last_quarter_vs_the_quarter_before_last',
|
|
22
|
-
[COMPARE_GRANULARITY[4]]: 'Last_year_vs_the_year_before_last',
|
|
23
|
-
[COMPARE_GRANULARITY[5]]: 'Last_7_days_vs_previous_7_days',
|
|
24
|
-
[COMPARE_GRANULARITY[6]]: 'Last_30_days_vs_previous_30_days'
|
|
25
|
-
};
|
|
26
|
-
class TrendSettings extends _react.Component {
|
|
27
|
-
constructor(props) {
|
|
28
|
-
super(props);
|
|
29
|
-
this.getGranularityOptions = options => {
|
|
30
|
-
return options.map(g => {
|
|
31
|
-
return {
|
|
32
|
-
value: g,
|
|
33
|
-
label: /*#__PURE__*/_react.default.createElement("span", {
|
|
34
|
-
className: 'select-module select-module-name'
|
|
35
|
-
}, _reactIntlUniversal.default.get(COMPARED_LIST[g]))
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
this.getSelectedDateColumnOption = () => {
|
|
40
|
-
return this.dateColumnsOptions.find(option => option.value.key === this.props.statItem.date_column);
|
|
41
|
-
};
|
|
42
|
-
this.onSelectDateColumn = option => {
|
|
43
|
-
const {
|
|
44
|
-
date_column
|
|
45
|
-
} = this.props.statItem;
|
|
46
|
-
const new_date_column = option.value.key;
|
|
47
|
-
if (new_date_column === date_column) return;
|
|
48
|
-
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
49
|
-
date_column: new_date_column
|
|
50
|
-
}));
|
|
51
|
-
};
|
|
52
|
-
this.onSelectGroupbyGeolocationGranularity = option => {
|
|
53
|
-
const {
|
|
54
|
-
date_granularity
|
|
55
|
-
} = this.props.statItem;
|
|
56
|
-
if (option.value === date_granularity) return;
|
|
57
|
-
this.props.updateStatItem(Object.assign({}, this.props.statItem, {
|
|
58
|
-
date_granularity: option.value
|
|
59
|
-
}));
|
|
60
|
-
};
|
|
61
|
-
this.renderDateGranularity = () => {
|
|
62
|
-
const {
|
|
63
|
-
statItem
|
|
64
|
-
} = this.props;
|
|
65
|
-
const {
|
|
66
|
-
date_granularity
|
|
67
|
-
} = statItem;
|
|
68
|
-
const selectedGeolocationGranularity = this.dateGranularityOptions.find(option => option.value === date_granularity);
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
className: "statistic-chart-parameter-item"
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, _reactIntlUniversal.default.get('Comparison_mode')), /*#__PURE__*/_react.default.createElement(_DTableSelect.default, {
|
|
72
|
-
value: selectedGeolocationGranularity,
|
|
73
|
-
onChange: this.onSelectGroupbyGeolocationGranularity,
|
|
74
|
-
options: this.dateGranularityOptions
|
|
75
|
-
}));
|
|
76
|
-
};
|
|
77
|
-
const {
|
|
78
|
-
columns,
|
|
79
|
-
getColumnsOptions
|
|
80
|
-
} = props;
|
|
81
|
-
const dateColumns = columns.filter(column => (0, _columnUtils.isStatisticDateColumn)(column));
|
|
82
|
-
this.dateColumnsOptions = getColumnsOptions(dateColumns);
|
|
83
|
-
this.dateGranularityOptions = this.getGranularityOptions(COMPARE_GRANULARITY);
|
|
84
|
-
}
|
|
85
|
-
componentWillReceiveProps(nextProps) {
|
|
86
|
-
if (nextProps.selectedTableId !== this.props.selectedTableId) {
|
|
87
|
-
const {
|
|
88
|
-
columns,
|
|
89
|
-
getColumnsOptions
|
|
90
|
-
} = nextProps;
|
|
91
|
-
const dateColumns = columns.filter(column => (0, _columnUtils.isStatisticDateColumn)(column));
|
|
92
|
-
this.dateColumnsOptions = getColumnsOptions(dateColumns);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
render() {
|
|
96
|
-
const {
|
|
97
|
-
getTables,
|
|
98
|
-
getViews,
|
|
99
|
-
settingType,
|
|
100
|
-
selectedTableId,
|
|
101
|
-
statItem,
|
|
102
|
-
getColumnsOptions,
|
|
103
|
-
numericColumns
|
|
104
|
-
} = this.props;
|
|
105
|
-
const selectedDateColumnOption = this.getSelectedDateColumnOption();
|
|
106
|
-
if (settingType === 'style') {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_baseSettings.default, {
|
|
110
|
-
statItem: statItem,
|
|
111
|
-
selectedTableId: statItem.table_id,
|
|
112
|
-
selectedViewId: statItem.view_id,
|
|
113
|
-
getTables: getTables,
|
|
114
|
-
getViews: getViews,
|
|
115
|
-
getTableById: this.props.getTableById,
|
|
116
|
-
getConvertedChart: this.props.getConvertedChart,
|
|
117
|
-
updateStatItem: this.props.updateStatItem
|
|
118
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
-
className: "statistic-chart-parameter-divider"
|
|
120
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
-
className: "statistic-chart-parameter-item"
|
|
122
|
-
}, /*#__PURE__*/_react.default.createElement("label", null, _reactIntlUniversal.default.get('Time_field')), /*#__PURE__*/_react.default.createElement(_columnSettings.default, {
|
|
123
|
-
columnsOptions: this.dateColumnsOptions,
|
|
124
|
-
selectedColumnOption: selectedDateColumnOption,
|
|
125
|
-
onChangeSelectedColumn: this.onSelectDateColumn
|
|
126
|
-
})), this.renderDateGranularity(), /*#__PURE__*/_react.default.createElement("div", {
|
|
127
|
-
className: "statistic-chart-parameter-divider"
|
|
128
|
-
}), /*#__PURE__*/_react.default.createElement(_summarySettings.default, {
|
|
129
|
-
label: _reactIntlUniversal.default.get('Summary_method'),
|
|
130
|
-
statItem: statItem,
|
|
131
|
-
selectedTableId: selectedTableId,
|
|
132
|
-
numericColumns: numericColumns,
|
|
133
|
-
summaryType: statItem.summary_type,
|
|
134
|
-
summaryMethod: statItem.summary_method,
|
|
135
|
-
summaryColumn: statItem.summary_column,
|
|
136
|
-
getColumnsOptions: getColumnsOptions,
|
|
137
|
-
onChangeSummaryType: this.props.onChangeSummaryType,
|
|
138
|
-
onSelectSummaryColumn: this.props.onSelectSummaryColumn,
|
|
139
|
-
onSelectSummaryMethod: this.props.onSelectSummaryMethod
|
|
140
|
-
}));
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
var _default = exports.default = TrendSettings;
|