dtable-statistic 4.4.24-alpha.9 → 5.0.0
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/color-picker.css +53 -0
- package/es/assets/css/color-rules-popover.css +144 -0
- package/es/assets/css/dashboard.css +0 -1
- package/es/assets/css/dialog.css +0 -30
- package/es/assets/css/slider.css +77 -0
- package/es/assets/css/statistic-chart.module.css +11 -0
- package/es/assets/css/statistic-custom-title.module.css +3 -0
- package/es/assets/css/statistic-custom.module.css +4 -0
- package/es/assets/css/statistic-numeric-column-item.module.css +43 -0
- package/es/assets/css/statistic-time-picker.module.css +21 -0
- package/es/calculator/base-calculator.js +80 -0
- package/es/calculator/basic-chart-calculator.js +349 -0
- package/es/calculator/combination-calculator.js +246 -0
- package/es/calculator/compare-bar-calculator.js +197 -0
- package/es/calculator/completeness-calculator.js +215 -0
- package/es/calculator/copy-value.js +53 -0
- package/es/calculator/dashboard-calculator.js +70 -0
- package/es/calculator/heat-map-calculator.js +148 -0
- package/es/calculator/horizontal-bar-calculator.js +67 -0
- package/es/calculator/index.js +81 -0
- package/es/calculator/map-calculator.js +103 -0
- package/es/calculator/mirror-calculator.js +146 -0
- package/es/calculator/number-card-calculator.js +60 -0
- package/es/calculator/pivot-table-calculator.js +821 -0
- package/es/calculator/scatter-calculator.js +75 -0
- package/es/calculator/thread-manager.js +57 -0
- package/es/calculator/trend-calculator.js +113 -0
- package/es/calculator/workers/basic-chart-calculator-worker.js +495 -0
- package/es/calculator/workers/calculator.worker.js +44 -0
- package/es/calculator/workers/card-calculator-worker.js +40 -0
- package/es/calculator/workers/combination-calculator-worker.js +276 -0
- package/es/calculator/workers/compare-bar-chart-calculator-worker.js +150 -0
- package/es/calculator/workers/completeness-calculator-worker.js +208 -0
- package/es/calculator/workers/dashboard-calculator-worker.js +68 -0
- package/es/calculator/workers/mirror-calculator-worker.js +152 -0
- package/es/calculator/workers/pivot-table-calculator-worker.js +718 -0
- package/es/calculator/workers/scatter-calculator-worker.js +80 -0
- package/es/calculator/workers/trend-calculator-worker.js +108 -0
- package/es/calculator/world-map-calculator.js +124 -0
- package/es/components/dialog/chart-addition-edit-dialog.js +90 -0
- package/es/components/dialog/chart-addition-widgets/chart-selector.js +259 -0
- package/es/components/dialog/chart-addition-widgets/statistic-chart-selector.module.css +83 -0
- package/es/components/dialog/enlarged-chart-dialog.js +13 -8
- package/es/components/dialog/statistic-record-dialog/index.js +34 -25
- package/es/components/dialog/statistic-types-dialog/index.css +14 -0
- package/es/components/dialog/statistic-types-dialog/index.js +62 -0
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +2 -2
- package/es/components/popover/color-rules/color-rule.js +183 -0
- package/es/components/popover/color-rules/index.js +87 -0
- package/es/components/popover/color-rules/rule-filters/filter.js +221 -0
- package/es/components/popover/color-rules/rule-filters/index.css +210 -0
- package/es/components/popover/color-rules/rule-filters/index.js +97 -0
- package/es/components/popover/color-rules/rule-filters/number-input.js +78 -0
- package/es/components/popover/color-rules-popover.js +218 -0
- package/es/components/popover/color-selector-popover.js +83 -0
- package/es/constants/index.js +2 -1
- package/es/custom-g2.js +644 -0
- package/es/dashboard.js +31 -9
- package/es/desktop-dashboard.js +32 -51
- package/es/mobile-dashboard.js +16 -8
- package/es/model/bar-group.js +58 -0
- package/es/model/bar.js +47 -0
- package/es/model/base-model.js +18 -0
- package/es/model/basic-number-card.js +25 -0
- package/es/model/combination.js +48 -0
- package/es/model/compare-bar.js +56 -0
- package/es/model/completeness-group.js +31 -0
- package/es/model/completeness.js +25 -0
- package/es/model/custom-bar.js +25 -0
- package/es/model/dashboard.js +20 -0
- package/es/model/generic-model.js +222 -0
- package/es/model/heat-map.js +33 -0
- package/es/model/horizontal-bar-group.js +55 -0
- package/es/model/horizontal-bar.js +47 -0
- package/es/model/index.js +187 -0
- package/es/model/map.js +38 -0
- package/es/model/mirror.js +33 -0
- package/es/model/pie.js +38 -0
- package/es/model/ring.js +40 -0
- package/es/model/scatter.js +22 -0
- package/es/model/table.js +32 -0
- package/es/model/trend.js +32 -0
- package/es/model/world-map.js +34 -0
- package/es/service/chart-service.js +15 -8
- package/es/service/dashboard-service.js +29 -25
- package/es/stat-editor/chart-name-editor.js +68 -0
- package/es/stat-editor/index.js +75 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +153 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +422 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +203 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +23 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +104 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/index.js +334 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +119 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +132 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +240 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +89 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +138 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +331 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +143 -0
- package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +109 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +153 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +144 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +214 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +121 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +172 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +366 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +142 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +150 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/index.js +473 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +182 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +564 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +112 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +87 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +187 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +300 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +113 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +289 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +58 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +359 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +48 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +121 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +143 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +269 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +104 -0
- package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +366 -0
- package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +55 -0
- package/es/stat-editor/stat-settings/color-setting/color-picker.js +130 -0
- package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +374 -0
- package/es/stat-editor/stat-settings/map/map-level.js +72 -0
- package/es/stat-editor/stat-settings/map/map-province-city.js +151 -0
- package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +108 -0
- package/es/stat-editor/stat-settings/public-setting/base-settings.js +154 -0
- package/es/stat-editor/stat-settings/public-setting/calender.js +125 -0
- package/es/stat-editor/stat-settings/public-setting/column-settings.js +24 -0
- package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +62 -0
- package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +61 -0
- package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +35 -0
- package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +60 -0
- package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +123 -0
- package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +33 -0
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.css +29 -0
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +82 -0
- package/es/stat-list/chart-preview.js +20 -19
- package/es/stat-list/index.js +21 -15
- package/es/stat-view/area-chart.js +551 -0
- package/es/stat-view/bar-chart.js +582 -0
- package/es/stat-view/base-chart.js +132 -0
- package/es/stat-view/basic-number-card.js +201 -0
- package/es/stat-view/combination-chart.js +546 -0
- package/es/stat-view/compare-chart.js +483 -0
- package/es/stat-view/completeness-chart.js +390 -0
- package/es/stat-view/custom-bar.js +418 -0
- package/es/stat-view/dashboard-chart.js +266 -0
- package/es/stat-view/heat-map.js +463 -0
- package/es/stat-view/horizontal-bar-chart.js +562 -0
- package/es/stat-view/index.js +156 -47
- package/es/stat-view/line-chart.js +518 -0
- package/es/stat-view/map.js +448 -0
- package/es/stat-view/mirror.js +275 -0
- package/es/stat-view/pie-chart.js +290 -0
- package/es/stat-view/pivot-table/index.js +196 -0
- package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +156 -0
- package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +176 -0
- package/es/stat-view/pivot-table/pivot-table-display-name.js +215 -0
- package/es/stat-view/pivot-table/statistic-pivot-table.module.css +132 -0
- package/es/stat-view/pivot-table/two-dimension-table.js +384 -0
- package/es/stat-view/ring-chart.js +392 -0
- package/es/stat-view/scatter-chart.js +306 -0
- package/es/stat-view/treemap-chart.js +253 -0
- package/es/stat-view/trend-chart.js +249 -0
- package/es/stat-view/world-map.js +431 -0
- package/es/tabs/tab.js +2 -2
- package/es/utils/basic-chart-utils.js +29 -0
- package/es/utils/cell-format.js +115 -0
- package/es/utils/collaborator.js +50 -0
- package/es/utils/color-utils.js +134 -0
- package/es/utils/column-utils.js +110 -0
- package/es/utils/column.js +20 -0
- package/es/utils/common-utils.js +352 -2
- package/es/utils/date-format.js +71 -0
- package/es/utils/export-table-utils.js +69 -0
- package/es/utils/index.js +89 -12
- package/es/utils/map.js +114 -0
- package/es/utils/model.js +19 -0
- package/es/utils/row-utils.js +134 -0
- package/es/utils/search.js +73 -0
- package/es/utils/sql-utils.js +359 -0
- package/es/utils/stat-utils.js +351 -0
- package/es/utils/trend-utils.js +135 -0
- package/package.json +8 -6
- package/es/components/dialog/chart-edit-dialog.js +0 -93
- package/es/components/dtable-popover.js +0 -97
- package/es/components/dtable-search-input.js +0 -135
- package/es/components/index.js +0 -41
- package/es/components/loading.js +0 -15
- package/es/components/modal-portal.js +0 -26
- package/es/model/conver-statItem.js +0 -124
|
@@ -0,0 +1,138 @@
|
|
|
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;
|
|
@@ -0,0 +1,331 @@
|
|
|
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;
|
|
@@ -0,0 +1,143 @@
|
|
|
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;
|