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,30 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _timeComparisonSettings = _interopRequireDefault(require("./time-comparison-settings"));
|
|
21
|
-
var _completenessChartSettings = _interopRequireDefault(require("./completeness-chart-settings"));
|
|
22
|
-
var _pivotTableSettings = _interopRequireDefault(require("./pivot-table-settings"));
|
|
23
|
-
var _customBarSettings = _interopRequireDefault(require("./custom-bar-settings"));
|
|
24
|
-
var _constants = require("../../../constants");
|
|
25
|
-
const DATE_GRANULARITY_LIST = [_constants.DATE_GRANULARITY.DAY, _constants.DATE_GRANULARITY.WEEK, _constants.DATE_GRANULARITY.MONTH, _constants.DATE_GRANULARITY.QUARTER, _constants.DATE_GRANULARITY.YEAR];
|
|
26
|
-
const GEOLOCATION_GRANULARITY_LIST = [_constants.GEOLOCATION_GRANULARITY.PROVINCE, _constants.GEOLOCATION_GRANULARITY.CITY, _constants.GEOLOCATION_GRANULARITY.DISTRICT];
|
|
27
|
-
class BasicChartSettings extends _react.Component {
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import intl from 'react-intl-universal';
|
|
4
|
+
import { COLUMN_OPTIONS, isNumericColumn } from 'dtable-store';
|
|
5
|
+
import ToggleSetting from '../public-setting/toggle-setting';
|
|
6
|
+
import PieSettings from './pie-settings';
|
|
7
|
+
import ScatterSettings from './scatter-settings';
|
|
8
|
+
import BarSettings from './bar-settings';
|
|
9
|
+
import AdvanceBarChartSettings from './advance-bar-chart-settings';
|
|
10
|
+
import HorizontalBar from './horizontal-bar-settings';
|
|
11
|
+
import HorizontalGroupBarChartSettings from './horizontal-group-chart-settings';
|
|
12
|
+
import TimeComparisonSettings from './time-comparison-settings';
|
|
13
|
+
import CompletenessSetting from './completeness-chart-settings';
|
|
14
|
+
import PivotTableSettings from './pivot-table-settings';
|
|
15
|
+
import CustomBarSettings from './custom-bar-settings';
|
|
16
|
+
import { BASIC_CHART_COLUMN_LIST, DATE_GRANULARITY, GEOLOCATION_GRANULARITY, STATISTICS_COUNT_SHOW, STAT_TYPE, TIME_COLUMN_LIST } from '../../../constants';
|
|
17
|
+
const DATE_GRANULARITY_LIST = [DATE_GRANULARITY.DAY, DATE_GRANULARITY.WEEK, DATE_GRANULARITY.MONTH, DATE_GRANULARITY.QUARTER, DATE_GRANULARITY.YEAR];
|
|
18
|
+
const GEOLOCATION_GRANULARITY_LIST = [GEOLOCATION_GRANULARITY.PROVINCE, GEOLOCATION_GRANULARITY.CITY, GEOLOCATION_GRANULARITY.DISTRICT];
|
|
19
|
+
class BasicChartSettings extends Component {
|
|
28
20
|
constructor(props) {
|
|
29
21
|
super(props);
|
|
30
22
|
this.setData = selectedTable => {
|
|
@@ -47,46 +39,46 @@ class BasicChartSettings extends _react.Component {
|
|
|
47
39
|
vertical_axis_include_empty
|
|
48
40
|
} = statItem || {};
|
|
49
41
|
let includeEmptyCells;
|
|
50
|
-
if (type ===
|
|
42
|
+
if (type === STAT_TYPE.PIE || type === STAT_TYPE.RING || type === STAT_TYPE.TREEMAP || type === STAT_TYPE.PIVOT_TABLE) {
|
|
51
43
|
includeEmptyCells = groupby_include_empty_cells;
|
|
52
|
-
} else if (type ===
|
|
44
|
+
} else if (type === STAT_TYPE.HORIZONTAL_BAR || type === STAT_TYPE.HORIZONTAL_GROUP_BAR || type === STAT_TYPE.STACKED_HORIZONTAL_BAR) {
|
|
53
45
|
includeEmptyCells = vertical_axis_include_empty;
|
|
54
46
|
} else {
|
|
55
47
|
includeEmptyCells = x_axis_include_empty;
|
|
56
48
|
}
|
|
57
|
-
return /*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
50
|
className: "mt-1"
|
|
59
|
-
}, /*#__PURE__*/
|
|
51
|
+
}, /*#__PURE__*/React.createElement(ToggleSetting, {
|
|
60
52
|
isChecked: includeEmptyCells || false,
|
|
61
53
|
handleToggleChange: this.onToggleIncludeEmpty,
|
|
62
|
-
label:
|
|
54
|
+
label: intl.get('Including_empty_cell')
|
|
63
55
|
}));
|
|
64
56
|
};
|
|
65
57
|
this.getAvailableColumns = columns => {
|
|
66
58
|
if (!columns || !Array.isArray(columns)) return [];
|
|
67
|
-
return columns.filter(column =>
|
|
59
|
+
return columns.filter(column => BASIC_CHART_COLUMN_LIST.includes(column.type));
|
|
68
60
|
};
|
|
69
61
|
this.getPivotTableSummaryColumnOptions = columns => {
|
|
70
62
|
const summaryColumns = columns.filter(column => {
|
|
71
|
-
return column && (
|
|
63
|
+
return column && (isNumericColumn(column) || TIME_COLUMN_LIST.includes(column.type));
|
|
72
64
|
});
|
|
73
65
|
return this.getColumnsOptions(summaryColumns);
|
|
74
66
|
};
|
|
75
67
|
this.getColumnsOptions = columns => {
|
|
76
68
|
if (!Array.isArray(columns)) return [];
|
|
77
69
|
return columns.map(column => {
|
|
78
|
-
let option =
|
|
70
|
+
let option = COLUMN_OPTIONS.find(o => o.type === column.type) || {};
|
|
79
71
|
const {
|
|
80
72
|
name,
|
|
81
73
|
key,
|
|
82
74
|
type
|
|
83
75
|
} = column;
|
|
84
76
|
return {
|
|
85
|
-
label: /*#__PURE__*/
|
|
77
|
+
label: /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
86
78
|
className: "header-icon"
|
|
87
|
-
}, /*#__PURE__*/
|
|
79
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
88
80
|
className: option.iconClass
|
|
89
|
-
})), /*#__PURE__*/
|
|
81
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
90
82
|
className: "select-option-name"
|
|
91
83
|
}, name)),
|
|
92
84
|
value: {
|
|
@@ -102,16 +94,16 @@ class BasicChartSettings extends _react.Component {
|
|
|
102
94
|
statItem
|
|
103
95
|
} = this.props;
|
|
104
96
|
const list = [...columnsOptions];
|
|
105
|
-
if (statItem.type ===
|
|
97
|
+
if (statItem.type === STAT_TYPE.PIVOT_TABLE) {
|
|
106
98
|
list.unshift({
|
|
107
|
-
label: /*#__PURE__*/
|
|
99
|
+
label: /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
108
100
|
className: "header-icon"
|
|
109
|
-
}), /*#__PURE__*/
|
|
101
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
110
102
|
style: {
|
|
111
103
|
color: '#999999'
|
|
112
104
|
},
|
|
113
105
|
className: "select-option-name"
|
|
114
|
-
},
|
|
106
|
+
}, intl.get('Not_used'))),
|
|
115
107
|
value: {
|
|
116
108
|
key: null
|
|
117
109
|
}
|
|
@@ -126,7 +118,7 @@ class BasicChartSettings extends _react.Component {
|
|
|
126
118
|
};
|
|
127
119
|
this.getNumericColumns = columns => {
|
|
128
120
|
if (!columns) return [];
|
|
129
|
-
return columns.filter(column => column &&
|
|
121
|
+
return columns.filter(column => column && isNumericColumn(column));
|
|
130
122
|
};
|
|
131
123
|
this.getSelectedColumnOption = (key, columnsOptions) => {
|
|
132
124
|
if (!key || !Array.isArray(columnsOptions) || columnsOptions.length === 0) {
|
|
@@ -138,9 +130,9 @@ class BasicChartSettings extends _react.Component {
|
|
|
138
130
|
return options.map(g => {
|
|
139
131
|
return {
|
|
140
132
|
value: g,
|
|
141
|
-
label: /*#__PURE__*/
|
|
133
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
142
134
|
className: 'select-module select-module-name'
|
|
143
|
-
},
|
|
135
|
+
}, intl.get(STATISTICS_COUNT_SHOW[g]))
|
|
144
136
|
};
|
|
145
137
|
});
|
|
146
138
|
};
|
|
@@ -159,11 +151,11 @@ class BasicChartSettings extends _react.Component {
|
|
|
159
151
|
} = this.state;
|
|
160
152
|
const type = statItem.type;
|
|
161
153
|
switch (statItem.type) {
|
|
162
|
-
case
|
|
163
|
-
case
|
|
164
|
-
case
|
|
154
|
+
case STAT_TYPE.BAR:
|
|
155
|
+
case STAT_TYPE.LINE:
|
|
156
|
+
case STAT_TYPE.AREA_CHART:
|
|
165
157
|
{
|
|
166
|
-
return /*#__PURE__*/
|
|
158
|
+
return /*#__PURE__*/React.createElement(BarSettings, {
|
|
167
159
|
settingType: settingType,
|
|
168
160
|
statItem: statItem,
|
|
169
161
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -183,9 +175,9 @@ class BasicChartSettings extends _react.Component {
|
|
|
183
175
|
renderIncludeEmpty: this.renderIncludeEmpty
|
|
184
176
|
});
|
|
185
177
|
}
|
|
186
|
-
case
|
|
178
|
+
case STAT_TYPE.COMPARE_BAR:
|
|
187
179
|
{
|
|
188
|
-
return /*#__PURE__*/
|
|
180
|
+
return /*#__PURE__*/React.createElement(TimeComparisonSettings, {
|
|
189
181
|
settingType: settingType,
|
|
190
182
|
statItem: statItem,
|
|
191
183
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -202,12 +194,12 @@ class BasicChartSettings extends _react.Component {
|
|
|
202
194
|
updateStatItem: this.props.updateStatItem
|
|
203
195
|
});
|
|
204
196
|
}
|
|
205
|
-
case
|
|
206
|
-
case
|
|
207
|
-
case
|
|
208
|
-
case
|
|
197
|
+
case STAT_TYPE.BAR_GROUP:
|
|
198
|
+
case STAT_TYPE.BAR_STACK:
|
|
199
|
+
case STAT_TYPE.GROUP_LINE:
|
|
200
|
+
case STAT_TYPE.AREA_GROUP_CHART:
|
|
209
201
|
{
|
|
210
|
-
return /*#__PURE__*/
|
|
202
|
+
return /*#__PURE__*/React.createElement(AdvanceBarChartSettings, {
|
|
211
203
|
chartType: type,
|
|
212
204
|
settingType: settingType,
|
|
213
205
|
statItem: statItem,
|
|
@@ -228,9 +220,9 @@ class BasicChartSettings extends _react.Component {
|
|
|
228
220
|
renderIncludeEmpty: this.renderIncludeEmpty
|
|
229
221
|
});
|
|
230
222
|
}
|
|
231
|
-
case
|
|
223
|
+
case STAT_TYPE.CUSTOM_BAR:
|
|
232
224
|
{
|
|
233
|
-
return /*#__PURE__*/
|
|
225
|
+
return /*#__PURE__*/React.createElement(CustomBarSettings, {
|
|
234
226
|
chartType: type,
|
|
235
227
|
settingType: settingType,
|
|
236
228
|
statItem: statItem,
|
|
@@ -250,11 +242,11 @@ class BasicChartSettings extends _react.Component {
|
|
|
250
242
|
renderIncludeEmpty: this.renderIncludeEmpty
|
|
251
243
|
});
|
|
252
244
|
}
|
|
253
|
-
case
|
|
254
|
-
case
|
|
255
|
-
case
|
|
245
|
+
case STAT_TYPE.PIE:
|
|
246
|
+
case STAT_TYPE.RING:
|
|
247
|
+
case STAT_TYPE.TREEMAP:
|
|
256
248
|
{
|
|
257
|
-
return /*#__PURE__*/
|
|
249
|
+
return /*#__PURE__*/React.createElement(PieSettings, {
|
|
258
250
|
settingType: settingType,
|
|
259
251
|
statItem: statItem,
|
|
260
252
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -273,9 +265,9 @@ class BasicChartSettings extends _react.Component {
|
|
|
273
265
|
renderIncludeEmpty: this.renderIncludeEmpty
|
|
274
266
|
});
|
|
275
267
|
}
|
|
276
|
-
case
|
|
268
|
+
case STAT_TYPE.SCATTER:
|
|
277
269
|
{
|
|
278
|
-
return /*#__PURE__*/
|
|
270
|
+
return /*#__PURE__*/React.createElement(ScatterSettings, {
|
|
279
271
|
settingType: settingType,
|
|
280
272
|
statItem: statItem,
|
|
281
273
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -291,9 +283,9 @@ class BasicChartSettings extends _react.Component {
|
|
|
291
283
|
updateStatItem: this.props.updateStatItem
|
|
292
284
|
});
|
|
293
285
|
}
|
|
294
|
-
case
|
|
286
|
+
case STAT_TYPE.HORIZONTAL_BAR:
|
|
295
287
|
{
|
|
296
|
-
return /*#__PURE__*/
|
|
288
|
+
return /*#__PURE__*/React.createElement(HorizontalBar, {
|
|
297
289
|
settingType: settingType,
|
|
298
290
|
statItem: statItem,
|
|
299
291
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -313,10 +305,10 @@ class BasicChartSettings extends _react.Component {
|
|
|
313
305
|
renderIncludeEmpty: this.renderIncludeEmpty
|
|
314
306
|
});
|
|
315
307
|
}
|
|
316
|
-
case
|
|
317
|
-
case
|
|
308
|
+
case STAT_TYPE.HORIZONTAL_GROUP_BAR:
|
|
309
|
+
case STAT_TYPE.STACKED_HORIZONTAL_BAR:
|
|
318
310
|
{
|
|
319
|
-
return /*#__PURE__*/
|
|
311
|
+
return /*#__PURE__*/React.createElement(HorizontalGroupBarChartSettings, {
|
|
320
312
|
settingType: settingType,
|
|
321
313
|
statItem: statItem,
|
|
322
314
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -336,10 +328,10 @@ class BasicChartSettings extends _react.Component {
|
|
|
336
328
|
renderIncludeEmpty: this.renderIncludeEmpty
|
|
337
329
|
});
|
|
338
330
|
}
|
|
339
|
-
case
|
|
340
|
-
case
|
|
331
|
+
case STAT_TYPE.COMPLETENESS_CHART:
|
|
332
|
+
case STAT_TYPE.GROUP_COMPLETENESS_CHART:
|
|
341
333
|
{
|
|
342
|
-
return /*#__PURE__*/
|
|
334
|
+
return /*#__PURE__*/React.createElement(CompletenessSetting, {
|
|
343
335
|
settingType: settingType,
|
|
344
336
|
statItem: statItem,
|
|
345
337
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -358,9 +350,9 @@ class BasicChartSettings extends _react.Component {
|
|
|
358
350
|
dateGranularityOptions: this.dateGranularityOptions
|
|
359
351
|
});
|
|
360
352
|
}
|
|
361
|
-
case
|
|
353
|
+
case STAT_TYPE.PIVOT_TABLE:
|
|
362
354
|
{
|
|
363
|
-
return /*#__PURE__*/
|
|
355
|
+
return /*#__PURE__*/React.createElement(PivotTableSettings, {
|
|
364
356
|
settingType: settingType,
|
|
365
357
|
statItem: statItem,
|
|
366
358
|
labelColorConfigs: labelColorConfigs,
|
|
@@ -397,11 +389,11 @@ class BasicChartSettings extends _react.Component {
|
|
|
397
389
|
vertical_axis_include_empty
|
|
398
390
|
} = statItem || {};
|
|
399
391
|
let updated;
|
|
400
|
-
if (type ===
|
|
392
|
+
if (type === STAT_TYPE.PIE || type === STAT_TYPE.RING || type === STAT_TYPE.TREEMAP || type === STAT_TYPE.PIVOT_TABLE) {
|
|
401
393
|
updated = {
|
|
402
394
|
groupby_include_empty_cells: !groupby_include_empty_cells
|
|
403
395
|
};
|
|
404
|
-
} else if (type ===
|
|
396
|
+
} else if (type === STAT_TYPE.HORIZONTAL_BAR || type === STAT_TYPE.HORIZONTAL_GROUP_BAR || type === STAT_TYPE.STACKED_HORIZONTAL_BAR) {
|
|
405
397
|
updated = {
|
|
406
398
|
vertical_axis_include_empty: !vertical_axis_include_empty
|
|
407
399
|
};
|
|
@@ -449,25 +441,25 @@ class BasicChartSettings extends _react.Component {
|
|
|
449
441
|
const {
|
|
450
442
|
settingType
|
|
451
443
|
} = this.state;
|
|
452
|
-
return /*#__PURE__*/
|
|
444
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
453
445
|
className: "statistic-chart-settings"
|
|
454
|
-
}, /*#__PURE__*/
|
|
446
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
455
447
|
className: "statistic-chart-settings-type"
|
|
456
|
-
}, /*#__PURE__*/
|
|
448
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
457
449
|
onClick: () => this.selectEditType('data'),
|
|
458
|
-
className: (
|
|
450
|
+
className: classnames('statistic-type-item', {
|
|
459
451
|
'selected-statistic-type-item': settingType === 'data'
|
|
460
452
|
})
|
|
461
|
-
},
|
|
453
|
+
}, intl.get('Data_settings')), /*#__PURE__*/React.createElement("div", {
|
|
462
454
|
onClick: () => this.selectEditType('style'),
|
|
463
|
-
className: (
|
|
455
|
+
className: classnames('statistic-type-item', {
|
|
464
456
|
'selected-statistic-type-item': settingType === 'style'
|
|
465
457
|
})
|
|
466
|
-
},
|
|
458
|
+
}, intl.get('Style_settings'))), /*#__PURE__*/React.createElement("div", {
|
|
467
459
|
className: "statistic-chart-settings-container"
|
|
468
|
-
}, /*#__PURE__*/
|
|
460
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
469
461
|
className: "statistic-chart-settings-parameter-list pt-4"
|
|
470
462
|
}, this.getSettingsByType())));
|
|
471
463
|
}
|
|
472
464
|
}
|
|
473
|
-
|
|
465
|
+
export default BasicChartSettings;
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
|
|
11
|
-
var _baseSettings = _interopRequireDefault(require("../public-setting/base-settings"));
|
|
12
|
-
var _groupbySettings = _interopRequireDefault(require("./groupby-settings"));
|
|
13
|
-
var _summarySettings = _interopRequireDefault(require("./summary-settings"));
|
|
14
|
-
var _pieChartStyleSettings = _interopRequireDefault(require("./style-setting/pie-chart-style-settings"));
|
|
15
|
-
var _dataSortSetting = _interopRequireDefault(require("../public-setting/data-sort-setting"));
|
|
16
|
-
var _constants = require("../../../constants");
|
|
1
|
+
import React, { Component, Fragment } from 'react';
|
|
2
|
+
import intl from 'react-intl-universal';
|
|
3
|
+
import BaseSettings from '../public-setting/base-settings';
|
|
4
|
+
import GroupbySettings from './groupby-settings';
|
|
5
|
+
import SummarySettings from './summary-settings';
|
|
6
|
+
import StyleSettings from './style-setting/pie-chart-style-settings';
|
|
7
|
+
import DataSort from '../public-setting/data-sort-setting';
|
|
8
|
+
import { STAT_TYPE } from '../../../constants';
|
|
17
9
|
const GROUPBY_TYPE = {
|
|
18
10
|
ROW: 'row',
|
|
19
11
|
COLUMN: 'column'
|
|
20
12
|
};
|
|
21
|
-
class PieSettings extends
|
|
13
|
+
class PieSettings extends Component {
|
|
22
14
|
constructor() {
|
|
23
15
|
super(...arguments);
|
|
24
16
|
this.onSelectGroupbyColumn = (type, groupbyColumnKey, groupbyDateGranularity, groupbyGeolocationGranularity) => {
|
|
@@ -124,16 +116,16 @@ class PieSettings extends _react.Component {
|
|
|
124
116
|
summary_method
|
|
125
117
|
} = statItem || {};
|
|
126
118
|
if (settingType === 'style') {
|
|
127
|
-
if (statItem.type ===
|
|
119
|
+
if (statItem.type === STAT_TYPE.TREEMAP) {
|
|
128
120
|
return null;
|
|
129
121
|
}
|
|
130
|
-
return /*#__PURE__*/
|
|
122
|
+
return /*#__PURE__*/React.createElement(StyleSettings, {
|
|
131
123
|
statItem: statItem,
|
|
132
124
|
getTableById: getTableById,
|
|
133
125
|
updateStatisticsSettings: this.props.updateStatisticsSettings
|
|
134
126
|
});
|
|
135
127
|
}
|
|
136
|
-
return /*#__PURE__*/
|
|
128
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(BaseSettings, {
|
|
137
129
|
selectedTableId: selectedTableId,
|
|
138
130
|
selectedViewId: selectedViewId,
|
|
139
131
|
statItem: statItem,
|
|
@@ -142,14 +134,14 @@ class PieSettings extends _react.Component {
|
|
|
142
134
|
getTableById: this.props.getTableById,
|
|
143
135
|
getConvertedChart: this.props.getConvertedChart,
|
|
144
136
|
updateStatItem: this.props.updateStatisticsSettings
|
|
145
|
-
}), /*#__PURE__*/
|
|
137
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
146
138
|
className: "statistic-chart-parameter-divider"
|
|
147
|
-
}), /*#__PURE__*/
|
|
139
|
+
}), /*#__PURE__*/React.createElement(GroupbySettings, {
|
|
148
140
|
selectedTable: selectedTable,
|
|
149
141
|
columnsOptions: columnsOptions,
|
|
150
142
|
dateGranularityOptions: dateGranularityOptions,
|
|
151
143
|
geolocationGranularityOptions: geolocationGranularityOptions,
|
|
152
|
-
label:
|
|
144
|
+
label: intl.get('Group_by'),
|
|
153
145
|
groupbyColumnKey: groupby_column_key,
|
|
154
146
|
groupbyDateGranularity: groupby_date_granularity,
|
|
155
147
|
groupbyGeolocationGranularity: groupby_geolocation_granularity,
|
|
@@ -158,11 +150,11 @@ class PieSettings extends _react.Component {
|
|
|
158
150
|
onSelectGroupbyDateGranularity: this.onSelectGroupbyDateGranularity.bind(this, GROUPBY_TYPE.ROW),
|
|
159
151
|
onSelectGroupbyGeolocationGranularity: this.onSelectGroupbyGeolocationGranularity.bind(this, GROUPBY_TYPE.ROW),
|
|
160
152
|
renderIncludeEmpty: renderIncludeEmpty
|
|
161
|
-
}), /*#__PURE__*/
|
|
153
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
162
154
|
className: "statistic-chart-parameter-divider"
|
|
163
|
-
}), /*#__PURE__*/
|
|
155
|
+
}), /*#__PURE__*/React.createElement(SummarySettings, {
|
|
164
156
|
statItem: statItem,
|
|
165
|
-
label:
|
|
157
|
+
label: intl.get('Summary_method'),
|
|
166
158
|
numericColumnsOptions: numericColumnsOptions,
|
|
167
159
|
summaryType: summary_type,
|
|
168
160
|
summaryColumnKey: summary_column_key,
|
|
@@ -171,12 +163,12 @@ class PieSettings extends _react.Component {
|
|
|
171
163
|
onChangeSummaryType: this.updatedSummaryType,
|
|
172
164
|
onSelectNumericColumn: this.onSelectNumericColumn,
|
|
173
165
|
onSelectSummaryMethod: this.updateSummaryMethod
|
|
174
|
-
}), /*#__PURE__*/
|
|
166
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
175
167
|
className: "statistic-chart-parameter-divider"
|
|
176
|
-
}), /*#__PURE__*/
|
|
168
|
+
}), /*#__PURE__*/React.createElement(DataSort, {
|
|
177
169
|
statItem: statItem,
|
|
178
170
|
updateStatItem: this.props.updateStatisticsSettings
|
|
179
171
|
}));
|
|
180
172
|
}
|
|
181
173
|
}
|
|
182
|
-
|
|
174
|
+
export default PieSettings;
|