dtable-statistic 4.3.3 → 4.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/api/dtable-db-api.js +3 -10
- package/es/calculator/base-calculator.js +12 -20
- package/es/calculator/basic-chart-calculator.js +65 -72
- package/es/calculator/combination-calculator.js +57 -64
- package/es/calculator/compare-bar-calculator.js +26 -33
- package/es/calculator/completeness-calculator.js +30 -37
- package/es/calculator/copy-value.js +1 -7
- package/es/calculator/dashboard-calculator.js +13 -20
- package/es/calculator/heat-map-calculator.js +18 -25
- package/es/calculator/horizontal-bar-calculator.js +8 -15
- package/es/calculator/index.js +35 -42
- package/es/calculator/map-calculator.js +22 -29
- package/es/calculator/mirror-calculator.js +20 -27
- package/es/calculator/number-card-calculator.js +10 -17
- package/es/calculator/pivot-table-calculator.js +58 -65
- package/es/calculator/scatter-calculator.js +14 -21
- package/es/calculator/thread-manager.js +1 -7
- package/es/calculator/trend-calculator.js +22 -29
- package/es/calculator/workers/basic-chart-calculator-worker.js +76 -83
- package/es/calculator/workers/calculator.worker.js +30 -33
- package/es/calculator/workers/card-calculator-worker.js +13 -19
- package/es/calculator/workers/combination-calculator-worker.js +46 -53
- package/es/calculator/workers/compare-bar-chart-calculator-worker.js +22 -29
- package/es/calculator/workers/completeness-calculator-worker.js +34 -41
- package/es/calculator/workers/dashboard-calculator-worker.js +18 -24
- package/es/calculator/workers/mirror-calculator-worker.js +22 -29
- package/es/calculator/workers/pivot-table-calculator-worker.js +77 -84
- package/es/calculator/workers/scatter-calculator-worker.js +20 -27
- package/es/calculator/workers/trend-calculator-worker.js +27 -34
- package/es/calculator/world-map-calculator.js +17 -24
- package/es/components/common-add-tool.js +5 -12
- package/es/components/dialog/chart-addition-edit-dialog.js +12 -20
- package/es/components/dialog/chart-addition-widgets/chart-selector.js +101 -108
- package/es/components/dialog/color-theme-dialog.js +15 -22
- package/es/components/dialog/delete-confirmation-dialog.js +11 -18
- package/es/components/dialog/enlarged-chart-dialog.js +20 -28
- package/es/components/dialog/new-table-dialog.js +16 -23
- package/es/components/dialog/new-view-dialog.js +14 -21
- package/es/components/dialog/rename-view-dialog.js +14 -22
- package/es/components/dialog/statistic-record-dialog/index.js +37 -45
- package/es/components/dialog/statistic-types-dialog/index.js +14 -22
- package/es/components/dialog/table-select-dialog.js +15 -23
- package/es/components/dropdown-menu/statistic-dropdown-menu.js +41 -49
- package/es/components/dtable-popover.js +12 -19
- package/es/components/dtable-search-input.js +13 -21
- package/es/components/dtable-select.js +15 -21
- package/es/components/icon.js +4 -11
- package/es/components/index.js +11 -76
- package/es/components/loading.js +3 -10
- package/es/components/modal-portal.js +5 -12
- package/es/components/popover/color-rules/color-rule.js +25 -33
- package/es/components/popover/color-rules/index.js +6 -14
- package/es/components/popover/color-rules/rule-filters/filter.js +27 -34
- package/es/components/popover/color-rules/rule-filters/index.js +17 -25
- package/es/components/popover/color-rules/rule-filters/number-input.js +9 -17
- package/es/components/popover/color-rules-popover.js +24 -32
- package/es/components/popover/color-selector-popover.js +10 -17
- package/es/components/seatable-radio/index.js +9 -16
- package/es/components/select/index.js +2 -9
- package/es/components/select/option-group.js +19 -27
- package/es/components/select/option.js +6 -14
- package/es/components/select/select.js +17 -25
- package/es/components/toast/alert.js +24 -31
- package/es/components/toast/index.js +3 -10
- package/es/components/toast/toast.js +12 -20
- package/es/components/toast/toastManager.js +9 -17
- package/es/components/toast/toaster.js +6 -14
- package/es/constants/color-rules.js +6 -12
- package/es/constants/dtable-select-style.js +4 -9
- package/es/constants/event-types.js +4 -10
- package/es/constants/index.js +67 -96
- package/es/constants/key-codes.js +0 -2
- package/es/constants/map.js +2 -8
- package/es/constants/model.js +20 -26
- package/es/constants/regions.js +3 -8
- package/es/constants/zIndexes.js +1 -7
- package/es/custom-g2.js +208 -236
- package/es/dashboard.js +50 -58
- package/es/desktop-dashboard.js +47 -55
- package/es/index.js +3 -6
- package/es/locale/index.js +10 -13
- package/es/locale/lang/de.js +1 -7
- package/es/locale/lang/en.js +1 -7
- package/es/locale/lang/fr.js +1 -7
- package/es/locale/lang/zh_CN.js +1 -7
- package/es/mobile-dashboard.js +38 -46
- package/es/model/bar-group.js +11 -19
- package/es/model/bar.js +10 -18
- package/es/model/base-model.js +2 -9
- package/es/model/basic-number-card.js +8 -16
- package/es/model/collaborators.js +2 -9
- package/es/model/combination.js +12 -20
- package/es/model/compare-bar.js +16 -24
- package/es/model/completeness-group.js +8 -16
- package/es/model/completeness.js +5 -13
- package/es/model/custom-bar.js +6 -14
- package/es/model/dashboard.js +6 -14
- package/es/model/generic-model.js +133 -141
- package/es/model/heat-map.js +11 -19
- package/es/model/horizontal-bar-group.js +10 -18
- package/es/model/horizontal-bar.js +10 -18
- package/es/model/index.js +53 -185
- package/es/model/map.js +15 -23
- package/es/model/mirror.js +13 -21
- package/es/model/pie.js +10 -18
- package/es/model/ring.js +11 -19
- package/es/model/scatter.js +6 -14
- package/es/model/statistic-dashboard.js +2 -9
- package/es/model/table.js +10 -18
- package/es/model/trend.js +12 -20
- package/es/model/world-map.js +13 -21
- package/es/service/chart-service.js +7 -14
- package/es/service/dashboard-service.js +34 -41
- package/es/service/map-json.js +8 -14
- package/es/stat-editor/chart-name-editor.js +8 -15
- package/es/stat-editor/index.js +16 -24
- package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +21 -29
- package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +49 -57
- package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +4 -11
- package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/index.js +43 -51
- package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +23 -31
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +37 -45
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +19 -27
- package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +26 -34
- package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +47 -55
- package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +22 -30
- package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +27 -35
- package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +24 -32
- package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +33 -41
- package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +22 -30
- package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +27 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +46 -54
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +23 -31
- package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +26 -34
- package/es/stat-editor/stat-settings/basic-chart-settings/index.js +77 -85
- package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +21 -29
- package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +73 -81
- package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +16 -24
- package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +19 -27
- package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +18 -26
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +49 -57
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +47 -55
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +11 -19
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +45 -53
- package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +9 -17
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +20 -28
- package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +30 -38
- package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +50 -58
- package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +17 -25
- package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +47 -55
- package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +11 -19
- package/es/stat-editor/stat-settings/color-setting/color-picker.js +12 -19
- package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +62 -70
- package/es/stat-editor/stat-settings/map/map-level.js +13 -20
- package/es/stat-editor/stat-settings/map/map-province-city.js +20 -27
- package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/base-settings.js +20 -28
- package/es/stat-editor/stat-settings/public-setting/calender.js +22 -29
- package/es/stat-editor/stat-settings/public-setting/column-settings.js +6 -13
- package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +9 -16
- package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +13 -21
- package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +11 -19
- package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +27 -35
- package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +8 -15
- package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +18 -26
- package/es/stat-list/chart-preview.js +20 -28
- package/es/stat-list/index.js +27 -35
- package/es/stat-view/area-chart.js +43 -50
- package/es/stat-view/bar-chart.js +47 -54
- package/es/stat-view/base-chart.js +24 -32
- package/es/stat-view/basic-number-card.js +19 -26
- package/es/stat-view/combination-chart.js +49 -56
- package/es/stat-view/compare-chart.js +39 -46
- package/es/stat-view/completeness-chart.js +28 -35
- package/es/stat-view/custom-bar.js +31 -38
- package/es/stat-view/dashboard-chart.js +15 -22
- package/es/stat-view/heat-map.js +43 -50
- package/es/stat-view/horizontal-bar-chart.js +51 -58
- package/es/stat-view/index.js +73 -80
- package/es/stat-view/line-chart.js +39 -46
- package/es/stat-view/map.js +33 -40
- package/es/stat-view/mirror.js +21 -28
- package/es/stat-view/pie-chart.js +29 -36
- package/es/stat-view/pivot-table/index.js +32 -39
- package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +31 -39
- package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +29 -37
- package/es/stat-view/pivot-table/pivot-table-display-name.js +46 -54
- package/es/stat-view/pivot-table/two-dimension-table.js +62 -70
- package/es/stat-view/ring-chart.js +38 -45
- package/es/stat-view/scatter-chart.js +30 -37
- package/es/stat-view/treemap-chart.js +37 -44
- package/es/stat-view/trend-chart.js +32 -39
- package/es/stat-view/world-map.js +33 -40
- package/es/tabs/index.js +32 -40
- package/es/tabs/tab.js +26 -34
- package/es/utils/basic-chart-utils.js +2 -9
- package/es/utils/cell-format.js +14 -22
- package/es/utils/cell-value.js +7 -14
- package/es/utils/collaborator.js +4 -13
- package/es/utils/color-utils.js +18 -29
- package/es/utils/column-utils.js +18 -29
- package/es/utils/column.js +4 -11
- package/es/utils/common-utils.js +41 -65
- package/es/utils/date-format.js +2 -8
- package/es/utils/export-table-utils.js +82 -91
- package/es/utils/index.js +11 -100
- package/es/utils/map.js +26 -36
- package/es/utils/model.js +6 -14
- package/es/utils/object.js +6 -15
- package/es/utils/pivot-table.js +16 -23
- package/es/utils/row-utils.js +23 -33
- package/es/utils/search.js +21 -29
- package/es/utils/sql-utils.js +65 -75
- package/es/utils/stat-utils.js +60 -66
- package/es/utils/trend-utils.js +32 -40
- package/package.json +1 -1
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactColor = require("react-color");
|
|
10
|
-
require("../../../assets/css/color-picker.css");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChromePicker } from 'react-color';
|
|
3
|
+
import '../../../assets/css/color-picker.css';
|
|
11
4
|
const COVER = {
|
|
12
5
|
position: 'fixed',
|
|
13
6
|
top: '0px',
|
|
@@ -15,7 +8,7 @@ const COVER = {
|
|
|
15
8
|
bottom: '0px',
|
|
16
9
|
left: '0px'
|
|
17
10
|
};
|
|
18
|
-
class ColorPicker extends
|
|
11
|
+
class ColorPicker extends React.PureComponent {
|
|
19
12
|
constructor(props) {
|
|
20
13
|
super(props);
|
|
21
14
|
this.onInputChanged = event => {
|
|
@@ -94,29 +87,29 @@ class ColorPicker extends _react.default.PureComponent {
|
|
|
94
87
|
const {
|
|
95
88
|
readOnly
|
|
96
89
|
} = this.props;
|
|
97
|
-
return /*#__PURE__*/
|
|
90
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
98
91
|
className: "statistic-chart-color-picker-container",
|
|
99
92
|
ref: ref => this.colorPickerContainerRef = ref
|
|
100
|
-
}, /*#__PURE__*/
|
|
93
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
101
94
|
className: "picker-control ".concat(readOnly ? 'readOnly' : '')
|
|
102
|
-
}, /*#__PURE__*/
|
|
95
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
103
96
|
className: "color-control ".concat(isWhiteColor ? 'white-color' : '', " ").concat(readOnly ? 'readOnly' : ''),
|
|
104
97
|
onClick: this.onPickColorToggle,
|
|
105
98
|
style: {
|
|
106
99
|
background: activeColor
|
|
107
100
|
}
|
|
108
|
-
}), /*#__PURE__*/
|
|
101
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
109
102
|
className: "text-control",
|
|
110
103
|
type: "text",
|
|
111
104
|
value: activeColor,
|
|
112
105
|
onChange: this.onInputChanged,
|
|
113
106
|
readOnly: readOnly
|
|
114
|
-
})), this.state.isShowColorPicker && /*#__PURE__*/
|
|
107
|
+
})), this.state.isShowColorPicker && /*#__PURE__*/React.createElement("div", {
|
|
115
108
|
style: this.getPopoverStyle()
|
|
116
|
-
}, /*#__PURE__*/
|
|
109
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
117
110
|
style: COVER,
|
|
118
111
|
onClick: this.onPickColorToggle
|
|
119
|
-
}), /*#__PURE__*/
|
|
112
|
+
}), /*#__PURE__*/React.createElement(ChromePicker, {
|
|
120
113
|
disableAlpha: true,
|
|
121
114
|
color: activeColor,
|
|
122
115
|
onChange: this.onPickChanged
|
|
@@ -126,4 +119,4 @@ class ColorPicker extends _react.default.PureComponent {
|
|
|
126
119
|
ColorPicker.defaultProps = {
|
|
127
120
|
activeColor: '#000000'
|
|
128
121
|
};
|
|
129
|
-
|
|
122
|
+
export default ColorPicker;
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _reactstrap = require("reactstrap");
|
|
12
|
-
var _reactColor = _interopRequireDefault(require("react-color"));
|
|
13
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
14
|
-
var _components = require("../../../components");
|
|
15
|
-
var _colorRulesPopover = _interopRequireDefault(require("../../../components/popover/color-rules-popover"));
|
|
16
|
-
var _colorUtils = require("../../../utils/color-utils");
|
|
17
|
-
var _constants = require("../../../constants");
|
|
18
|
-
var _colorRules = require("../../../constants/color-rules");
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { Input } from 'reactstrap';
|
|
4
|
+
import ReactColor from 'react-color';
|
|
5
|
+
import intl from 'react-intl-universal';
|
|
6
|
+
import { DTableSelect } from '../../../components';
|
|
7
|
+
import ColorRulesPopover from '../../../components/popover/color-rules-popover';
|
|
8
|
+
import { getValidColorRules } from '../../../utils/color-utils';
|
|
9
|
+
import { STAT_TYPE, TYPE_COLOR_USING, TYPE_DISPLAY_COLOR_USING } from '../../../constants';
|
|
10
|
+
import { COLOR_RULE_FILTER_TYPE_MAP } from '../../../constants/color-rules';
|
|
19
11
|
const COVER = {
|
|
20
12
|
top: '0px',
|
|
21
13
|
right: '0px',
|
|
22
14
|
bottom: '0px',
|
|
23
15
|
left: '0px'
|
|
24
16
|
};
|
|
25
|
-
class ColorUseTypeSelector extends
|
|
17
|
+
class ColorUseTypeSelector extends Component {
|
|
26
18
|
constructor(props) {
|
|
27
19
|
super(props);
|
|
28
20
|
this.getPopoverStyle = () => {
|
|
@@ -52,25 +44,25 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
52
44
|
};
|
|
53
45
|
this.getUsableColorTypes = chartType => {
|
|
54
46
|
switch (chartType) {
|
|
55
|
-
case
|
|
56
|
-
case
|
|
57
|
-
case
|
|
58
|
-
case
|
|
59
|
-
case
|
|
60
|
-
case
|
|
61
|
-
case
|
|
62
|
-
case
|
|
47
|
+
case STAT_TYPE.BAR_GROUP:
|
|
48
|
+
case STAT_TYPE.BAR_STACK:
|
|
49
|
+
case STAT_TYPE.HORIZONTAL_GROUP_BAR:
|
|
50
|
+
case STAT_TYPE.STACKED_HORIZONTAL_BAR:
|
|
51
|
+
case STAT_TYPE.PIE:
|
|
52
|
+
case STAT_TYPE.RING:
|
|
53
|
+
case STAT_TYPE.GROUP_LINE:
|
|
54
|
+
case STAT_TYPE.AREA_GROUP_CHART:
|
|
63
55
|
{
|
|
64
|
-
return [
|
|
56
|
+
return [TYPE_COLOR_USING.USE_DEFAULT, TYPE_COLOR_USING.USE_COLUMN_COLORS];
|
|
65
57
|
}
|
|
66
|
-
case
|
|
67
|
-
case
|
|
58
|
+
case STAT_TYPE.BAR:
|
|
59
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
68
60
|
{
|
|
69
|
-
return [
|
|
61
|
+
return [TYPE_COLOR_USING.USE_DEFAULT, TYPE_COLOR_USING.USE_SPECIFIC_COLORS, TYPE_COLOR_USING.USE_RULES];
|
|
70
62
|
}
|
|
71
63
|
default:
|
|
72
64
|
{
|
|
73
|
-
return [
|
|
65
|
+
return [TYPE_COLOR_USING.USE_DEFAULT];
|
|
74
66
|
}
|
|
75
67
|
}
|
|
76
68
|
};
|
|
@@ -85,9 +77,9 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
85
77
|
return useableColorTypes.map(colorType => {
|
|
86
78
|
return {
|
|
87
79
|
value: colorType,
|
|
88
|
-
label: /*#__PURE__*/
|
|
80
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
89
81
|
className: "select-module select-module-name"
|
|
90
|
-
},
|
|
82
|
+
}, intl.get(TYPE_DISPLAY_COLOR_USING[colorType]))
|
|
91
83
|
};
|
|
92
84
|
});
|
|
93
85
|
};
|
|
@@ -100,7 +92,7 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
100
92
|
type
|
|
101
93
|
} = chart;
|
|
102
94
|
switch (type) {
|
|
103
|
-
case
|
|
95
|
+
case STAT_TYPE.BAR:
|
|
104
96
|
{
|
|
105
97
|
const {
|
|
106
98
|
y_axis_label_color
|
|
@@ -110,7 +102,7 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
110
102
|
}
|
|
111
103
|
return labelColorConfigs[0].color;
|
|
112
104
|
}
|
|
113
|
-
case
|
|
105
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
114
106
|
{
|
|
115
107
|
const {
|
|
116
108
|
horizontal_axis_label_color
|
|
@@ -134,13 +126,13 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
134
126
|
type
|
|
135
127
|
} = chart;
|
|
136
128
|
switch (type) {
|
|
137
|
-
case
|
|
129
|
+
case STAT_TYPE.BAR:
|
|
138
130
|
{
|
|
139
|
-
return
|
|
131
|
+
return getValidColorRules(chart.y_axis_label_color_rules);
|
|
140
132
|
}
|
|
141
|
-
case
|
|
133
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
142
134
|
{
|
|
143
|
-
return
|
|
135
|
+
return getValidColorRules(chart.horizontal_axis_label_color_rules);
|
|
144
136
|
}
|
|
145
137
|
default:
|
|
146
138
|
{
|
|
@@ -156,10 +148,10 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
156
148
|
type
|
|
157
149
|
} = chart;
|
|
158
150
|
switch (type) {
|
|
159
|
-
case
|
|
160
|
-
case
|
|
151
|
+
case STAT_TYPE.BAR:
|
|
152
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
161
153
|
{
|
|
162
|
-
return [
|
|
154
|
+
return [COLOR_RULE_FILTER_TYPE_MAP.NUMERIC_VALUE];
|
|
163
155
|
}
|
|
164
156
|
default:
|
|
165
157
|
{
|
|
@@ -178,14 +170,14 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
178
170
|
let updatedChart = Object.assign({}, chart, {
|
|
179
171
|
color_option
|
|
180
172
|
});
|
|
181
|
-
if (color_option ===
|
|
173
|
+
if (color_option === TYPE_COLOR_USING.USE_SPECIFIC_COLORS) {
|
|
182
174
|
switch (chart.type) {
|
|
183
|
-
case
|
|
175
|
+
case STAT_TYPE.BAR:
|
|
184
176
|
{
|
|
185
177
|
updatedChart.y_axis_label_color = updatedChart.y_axis_label_color || labelColorConfigs[0].color;
|
|
186
178
|
break;
|
|
187
179
|
}
|
|
188
|
-
case
|
|
180
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
189
181
|
{
|
|
190
182
|
updatedChart.horizontal_axis_label_color = updatedChart.horizontal_axis_label_color || labelColorConfigs[0].color;
|
|
191
183
|
break;
|
|
@@ -226,12 +218,12 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
226
218
|
} = this.props;
|
|
227
219
|
let updatedChart = Object.assign({}, chart);
|
|
228
220
|
switch (chart.type) {
|
|
229
|
-
case
|
|
221
|
+
case STAT_TYPE.BAR:
|
|
230
222
|
{
|
|
231
223
|
updatedChart.y_axis_label_color = color;
|
|
232
224
|
break;
|
|
233
225
|
}
|
|
234
|
-
case
|
|
226
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
235
227
|
{
|
|
236
228
|
updatedChart.horizontal_axis_label_color = color;
|
|
237
229
|
break;
|
|
@@ -259,12 +251,12 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
259
251
|
} = this.props;
|
|
260
252
|
let updatedChart = Object.assign({}, chart);
|
|
261
253
|
switch (chart.type) {
|
|
262
|
-
case
|
|
254
|
+
case STAT_TYPE.BAR:
|
|
263
255
|
{
|
|
264
256
|
updatedChart.y_axis_label_color_rules = colorRules;
|
|
265
257
|
break;
|
|
266
258
|
}
|
|
267
|
-
case
|
|
259
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
268
260
|
{
|
|
269
261
|
updatedChart.horizontal_axis_label_color_rules = colorRules;
|
|
270
262
|
break;
|
|
@@ -281,30 +273,30 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
281
273
|
specificColor
|
|
282
274
|
} = this.state;
|
|
283
275
|
const id = 'statistic_selected_specific_color';
|
|
284
|
-
return /*#__PURE__*/
|
|
276
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
285
277
|
id: id,
|
|
286
278
|
className: "selected-specific-color mt-1",
|
|
287
279
|
ref: ref => this.colorPickerContainerRef = ref
|
|
288
|
-
}, /*#__PURE__*/
|
|
280
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
289
281
|
className: "selected-specific-color-wrapper"
|
|
290
|
-
}, /*#__PURE__*/
|
|
282
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
291
283
|
className: "specific-color-show",
|
|
292
284
|
style: {
|
|
293
285
|
backgroundColor: specificColor
|
|
294
286
|
},
|
|
295
287
|
onClick: this.onToggleColorSelector
|
|
296
|
-
}), /*#__PURE__*/
|
|
288
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
297
289
|
type: "text",
|
|
298
290
|
className: "specific-color-input",
|
|
299
291
|
value: specificColor,
|
|
300
292
|
onChange: event => this.modifySpecificColor(event.target.value)
|
|
301
|
-
}))), this.state.isShowColorSelector && /*#__PURE__*/
|
|
293
|
+
}))), this.state.isShowColorSelector && /*#__PURE__*/React.createElement("div", {
|
|
302
294
|
style: this.getPopoverStyle()
|
|
303
|
-
}, /*#__PURE__*/
|
|
295
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
304
296
|
className: "position-fixed",
|
|
305
297
|
style: COVER,
|
|
306
298
|
onClick: this.onToggleColorSelector
|
|
307
|
-
}), /*#__PURE__*/
|
|
299
|
+
}), /*#__PURE__*/React.createElement(ReactColor, {
|
|
308
300
|
disableAlpha: true,
|
|
309
301
|
color: specificColor,
|
|
310
302
|
onChange: this.modifyHex
|
|
@@ -319,25 +311,25 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
319
311
|
const rulesLen = colorRules ? colorRules.length : 0;
|
|
320
312
|
const hasRules = rulesLen > 0;
|
|
321
313
|
const id = 'statistic_color_rules_toggle';
|
|
322
|
-
let msg =
|
|
314
|
+
let msg = intl.get('Add_rule');
|
|
323
315
|
if (rulesLen === 1) {
|
|
324
|
-
msg =
|
|
316
|
+
msg = intl.get('Added_1_rule');
|
|
325
317
|
} else if (rulesLen > 1) {
|
|
326
|
-
msg =
|
|
318
|
+
msg = intl.get('Added_xxx_rules', {
|
|
327
319
|
rules_count: rulesLen
|
|
328
320
|
});
|
|
329
321
|
}
|
|
330
|
-
return /*#__PURE__*/
|
|
322
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
331
323
|
id: id,
|
|
332
|
-
className: (
|
|
324
|
+
className: classnames('statistic-color-rules-toggle', 'mt-1', hasRules ? 'statistic-edit-color-rule' : 'statistic-add-color-rule'),
|
|
333
325
|
onClick: this.showColorRulesEditor
|
|
334
|
-
}, hasRules ? /*#__PURE__*/
|
|
326
|
+
}, hasRules ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, msg), /*#__PURE__*/React.createElement("i", {
|
|
335
327
|
className: "dtable-font dtable-icon-rename"
|
|
336
|
-
})) : /*#__PURE__*/
|
|
328
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
|
|
337
329
|
className: "dtable-font dtable-icon-add-table"
|
|
338
|
-
}), /*#__PURE__*/
|
|
330
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
339
331
|
className: "ml-2"
|
|
340
|
-
}, msg))), this.state.isShowColorRulesEditor && /*#__PURE__*/
|
|
332
|
+
}, msg))), this.state.isShowColorRulesEditor && /*#__PURE__*/React.createElement(ColorRulesPopover, {
|
|
341
333
|
target: id,
|
|
342
334
|
colorRules: colorRules,
|
|
343
335
|
colorRuleTypes: colorRuleTypes,
|
|
@@ -362,13 +354,13 @@ class ColorUseTypeSelector extends _react.Component {
|
|
|
362
354
|
color_option
|
|
363
355
|
} = chart;
|
|
364
356
|
const selectedColorOption = this.colorOptions.find(colorOption => colorOption.value === color_option) || this.colorOptions[0];
|
|
365
|
-
return /*#__PURE__*/
|
|
357
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
366
358
|
className: "statistic-chart-parameter-item"
|
|
367
|
-
}, /*#__PURE__*/
|
|
359
|
+
}, /*#__PURE__*/React.createElement("label", null, intl.get('Color')), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
368
360
|
value: selectedColorOption,
|
|
369
361
|
options: this.colorOptions,
|
|
370
362
|
onChange: this.onSelectColorOption
|
|
371
|
-
}), color_option ===
|
|
363
|
+
}), color_option === TYPE_COLOR_USING.USE_SPECIFIC_COLORS && this.renderSpecificColorSelector(), color_option === TYPE_COLOR_USING.USE_RULES && this.renderColorRulesEditor());
|
|
372
364
|
}
|
|
373
365
|
}
|
|
374
|
-
|
|
366
|
+
export default ColorUseTypeSelector;
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _components = require("../../../components");
|
|
10
|
-
var _map = require("../../../utils/map");
|
|
11
|
-
var _map2 = require("../../../constants/map");
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { DTableSelect } from '../../../components';
|
|
3
|
+
import { fixGeoGranularity } from '../../../utils/map';
|
|
4
|
+
import { MAP_LEVEL } from '../../../constants/map';
|
|
12
5
|
const MAP_LEVELS = [{
|
|
13
|
-
key:
|
|
6
|
+
key: MAP_LEVEL.COUNTRY,
|
|
14
7
|
name: '国家'
|
|
15
8
|
}, {
|
|
16
|
-
key:
|
|
9
|
+
key: MAP_LEVEL.PROVINCE,
|
|
17
10
|
name: '省级'
|
|
18
11
|
}, {
|
|
19
|
-
key:
|
|
12
|
+
key: MAP_LEVEL.CITY,
|
|
20
13
|
name: '市级'
|
|
21
14
|
}];
|
|
22
|
-
class MapLevelSettings extends
|
|
15
|
+
class MapLevelSettings extends Component {
|
|
23
16
|
constructor(props) {
|
|
24
17
|
super(props);
|
|
25
18
|
this.createMapLevelOptions = () => {
|
|
26
19
|
return MAP_LEVELS.map(mapLevel => {
|
|
27
20
|
return {
|
|
28
|
-
label: /*#__PURE__*/
|
|
21
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
29
22
|
className: "select-option-name"
|
|
30
23
|
}, mapLevel.name),
|
|
31
24
|
value: mapLevel.key
|
|
@@ -49,7 +42,7 @@ class MapLevelSettings extends _react.Component {
|
|
|
49
42
|
if (newLevel === map_level) return;
|
|
50
43
|
const updated = {
|
|
51
44
|
map_level: newLevel,
|
|
52
|
-
geolocation_granularity:
|
|
45
|
+
geolocation_granularity: fixGeoGranularity({
|
|
53
46
|
mapLevel: newLevel,
|
|
54
47
|
mapLocation: map_location
|
|
55
48
|
})
|
|
@@ -59,13 +52,13 @@ class MapLevelSettings extends _react.Component {
|
|
|
59
52
|
this.mapLevelOptions = this.createMapLevelOptions();
|
|
60
53
|
}
|
|
61
54
|
render() {
|
|
62
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
56
|
className: "statistic-chart-parameter-item"
|
|
64
|
-
}, /*#__PURE__*/
|
|
57
|
+
}, /*#__PURE__*/React.createElement("label", null, "\u5730\u56FE\u7EA7\u522B"), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
65
58
|
value: this.getSelectedMapLevelOption(),
|
|
66
59
|
options: this.mapLevelOptions,
|
|
67
60
|
onChange: this.onSelectMapLevel
|
|
68
61
|
}));
|
|
69
62
|
}
|
|
70
63
|
}
|
|
71
|
-
|
|
64
|
+
export default MapLevelSettings;
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _components = require("../../../components");
|
|
10
|
-
var _map = require("../../../constants/map");
|
|
11
|
-
var _regions = require("../../../constants/regions");
|
|
12
|
-
var _map2 = require("../../../utils/map");
|
|
13
|
-
class MapProvinceCitySettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import { DTableSelect } from '../../../components';
|
|
3
|
+
import { MAP_LEVEL } from '../../../constants/map';
|
|
4
|
+
import { regions } from '../../../constants/regions';
|
|
5
|
+
import { fixGeoGranularity } from '../../../utils/map';
|
|
6
|
+
class MapProvinceCitySettings extends Component {
|
|
14
7
|
constructor(props) {
|
|
15
8
|
super(props);
|
|
16
9
|
this.isProvinceWithCities = province => {
|
|
17
|
-
const provinceWithCities =
|
|
10
|
+
const provinceWithCities = regions.find(provinceWithCities => provinceWithCities.name === province);
|
|
18
11
|
return provinceWithCities && provinceWithCities.cities.length > 0;
|
|
19
12
|
};
|
|
20
13
|
this.createProvinceOptions = () => {
|
|
21
|
-
return
|
|
14
|
+
return regions.map(provinceWithCities => {
|
|
22
15
|
const {
|
|
23
16
|
name
|
|
24
17
|
} = provinceWithCities;
|
|
25
18
|
return {
|
|
26
|
-
label: /*#__PURE__*/
|
|
19
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
27
20
|
className: "select-option-name"
|
|
28
21
|
}, name),
|
|
29
22
|
value: name
|
|
@@ -31,14 +24,14 @@ class MapProvinceCitySettings extends _react.Component {
|
|
|
31
24
|
});
|
|
32
25
|
};
|
|
33
26
|
this.createProvinceCitiesOptions = province => {
|
|
34
|
-
const provinceWithCities =
|
|
27
|
+
const provinceWithCities = regions.find(provinceWithCities => provinceWithCities.name === province);
|
|
35
28
|
if (!provinceWithCities || provinceWithCities.cities.length === 0) return [];
|
|
36
29
|
return provinceWithCities.cities.map(city => {
|
|
37
30
|
const {
|
|
38
31
|
name
|
|
39
32
|
} = city;
|
|
40
33
|
return {
|
|
41
|
-
label: /*#__PURE__*/
|
|
34
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
42
35
|
className: "select-option-name"
|
|
43
36
|
}, name),
|
|
44
37
|
value: name
|
|
@@ -83,7 +76,7 @@ class MapProvinceCitySettings extends _react.Component {
|
|
|
83
76
|
if (map_location && newMapLocation.province === map_location.province) return;
|
|
84
77
|
const updated = {
|
|
85
78
|
map_location: newMapLocation,
|
|
86
|
-
geolocation_granularity:
|
|
79
|
+
geolocation_granularity: fixGeoGranularity({
|
|
87
80
|
mapLevel: map_level,
|
|
88
81
|
mapLocation: newMapLocation
|
|
89
82
|
})
|
|
@@ -104,7 +97,7 @@ class MapProvinceCitySettings extends _react.Component {
|
|
|
104
97
|
if (map_location && newMapLocation.city === map_location.city) return;
|
|
105
98
|
const updated = {
|
|
106
99
|
map_location: newMapLocation,
|
|
107
|
-
geolocation_granularity:
|
|
100
|
+
geolocation_granularity: fixGeoGranularity({
|
|
108
101
|
mapLevel: map_level,
|
|
109
102
|
mapLocation: newMapLocation
|
|
110
103
|
})
|
|
@@ -117,9 +110,9 @@ class MapProvinceCitySettings extends _react.Component {
|
|
|
117
110
|
} = this.props.statItem;
|
|
118
111
|
const province = map_location && map_location.province;
|
|
119
112
|
const citiesOptions = this.getProvinceCitiesOptions(province);
|
|
120
|
-
return /*#__PURE__*/
|
|
113
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
121
114
|
className: "statistic-chart-parameter-item"
|
|
122
|
-
}, /*#__PURE__*/
|
|
115
|
+
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
123
116
|
value: this.getSelectedCity(citiesOptions),
|
|
124
117
|
options: citiesOptions,
|
|
125
118
|
onChange: this.onSelectCity,
|
|
@@ -133,13 +126,13 @@ class MapProvinceCitySettings extends _react.Component {
|
|
|
133
126
|
const {
|
|
134
127
|
map_level
|
|
135
128
|
} = this.props.statItem;
|
|
136
|
-
if (map_level !==
|
|
129
|
+
if (map_level !== MAP_LEVEL.PROVINCE && map_level !== MAP_LEVEL.CITY) {
|
|
137
130
|
return null;
|
|
138
131
|
}
|
|
139
|
-
const isCity = map_level ===
|
|
140
|
-
return /*#__PURE__*/
|
|
132
|
+
const isCity = map_level === MAP_LEVEL.CITY;
|
|
133
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
141
134
|
className: "statistic-chart-parameter-item"
|
|
142
|
-
}, /*#__PURE__*/
|
|
135
|
+
}, /*#__PURE__*/React.createElement("label", null, isCity ? '城市' : '省份'), /*#__PURE__*/React.createElement(DTableSelect, {
|
|
143
136
|
value: this.getSelectedProvinceOption(),
|
|
144
137
|
options: this.provinceOptions,
|
|
145
138
|
onChange: this.onSelectProvince,
|
|
@@ -147,4 +140,4 @@ class MapProvinceCitySettings extends _react.Component {
|
|
|
147
140
|
})), isCity && this.renderCitySelector());
|
|
148
141
|
}
|
|
149
142
|
}
|
|
150
|
-
|
|
143
|
+
export default MapProvinceCitySettings;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 _components = require("../../../components");
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import { DTableSelect } from '../../../components';
|
|
12
4
|
const LABEL_POSITIONS_X = ['left', 'center', 'right'];
|
|
13
5
|
const LABEL_POSITIONS_Y = ['bottom', 'center', 'top'];
|
|
14
6
|
const LABEL_POSITIONS_SHOW_X = {
|
|
@@ -21,7 +13,7 @@ const LABEL_POSITIONS_SHOW_Y = {
|
|
|
21
13
|
center: 'Center',
|
|
22
14
|
top: 'Top'
|
|
23
15
|
};
|
|
24
|
-
class AxisLabelPosition extends
|
|
16
|
+
class AxisLabelPosition extends Component {
|
|
25
17
|
constructor(props) {
|
|
26
18
|
super(props);
|
|
27
19
|
this.getLabelPositionOptions = () => {
|
|
@@ -36,9 +28,9 @@ class AxisLabelPosition extends _react.Component {
|
|
|
36
28
|
return positions.map(g => {
|
|
37
29
|
return {
|
|
38
30
|
value: g,
|
|
39
|
-
label: /*#__PURE__*/
|
|
31
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
40
32
|
className: 'select-module select-module-name'
|
|
41
|
-
},
|
|
33
|
+
}, intl.get(LABEL_POSITIONS_SHOW_X[g]))
|
|
42
34
|
};
|
|
43
35
|
});
|
|
44
36
|
}
|
|
@@ -46,9 +38,9 @@ class AxisLabelPosition extends _react.Component {
|
|
|
46
38
|
return positions.map(g => {
|
|
47
39
|
return {
|
|
48
40
|
value: g,
|
|
49
|
-
label: /*#__PURE__*/
|
|
41
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
50
42
|
className: 'select-module select-module-name'
|
|
51
|
-
},
|
|
43
|
+
}, intl.get(LABEL_POSITIONS_SHOW_Y[g]))
|
|
52
44
|
};
|
|
53
45
|
});
|
|
54
46
|
}
|
|
@@ -91,9 +83,9 @@ class AxisLabelPosition extends _react.Component {
|
|
|
91
83
|
return item.value === x_axis_label_position || item.value === horizontal_axis_label_position;
|
|
92
84
|
});
|
|
93
85
|
}
|
|
94
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
87
|
className: "mt-1"
|
|
96
|
-
}, /*#__PURE__*/
|
|
88
|
+
}, /*#__PURE__*/React.createElement(DTableSelect, {
|
|
97
89
|
value: selectedOption,
|
|
98
90
|
onChange: this.onSelectAxisPosition,
|
|
99
91
|
options: this.labelPositionOptions
|
|
@@ -105,4 +97,4 @@ class AxisLabelPosition extends _react.Component {
|
|
|
105
97
|
return this.renderXAxisLabelPosition();
|
|
106
98
|
}
|
|
107
99
|
}
|
|
108
|
-
|
|
100
|
+
export default AxisLabelPosition;
|