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,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _dtableStore = require("dtable-store");
|
|
10
|
-
var _baseCalculator = _interopRequireDefault(require("./base-calculator"));
|
|
11
|
-
var _sqlUtils = require("../utils/sql-utils");
|
|
12
|
-
var _statUtils = _interopRequireDefault(require("../utils/stat-utils"));
|
|
13
|
-
var _commonUtils = require("../utils/common-utils");
|
|
14
|
-
var _constants = require("../constants");
|
|
15
|
-
class CompareBarCalculator extends _baseCalculator.default {
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { filter2SqlCondition, TableUtils } from 'dtable-store';
|
|
3
|
+
import BaseCalculator from './base-calculator';
|
|
4
|
+
import { getSqlGroup, getSqlOrder } from '../utils/sql-utils';
|
|
5
|
+
import StatUtils from '../utils/stat-utils';
|
|
6
|
+
import { getSummaryColumnMethod, getSummaryResult } from '../utils/common-utils';
|
|
7
|
+
import { DTABLE_DB_SUMMARY_METHOD, SUMMARY_TYPE } from '../constants';
|
|
8
|
+
class CompareBarCalculator extends BaseCalculator {
|
|
16
9
|
constructor(_ref) {
|
|
17
10
|
let {
|
|
18
11
|
value,
|
|
@@ -42,9 +35,9 @@ class CompareBarCalculator extends _baseCalculator.default {
|
|
|
42
35
|
x_axis_compared_date_range_end
|
|
43
36
|
} = chart;
|
|
44
37
|
const table = this.getTableById(table_id);
|
|
45
|
-
if (!
|
|
38
|
+
if (!TableUtils.getTableColumnByKey(table, x_axis_column_key)) return false;
|
|
46
39
|
const summaryColumnKey = summary_column_key || y_axis_column_key;
|
|
47
|
-
if (summaryColumnKey && !
|
|
40
|
+
if (summaryColumnKey && !TableUtils.getTableColumnByKey(table, summaryColumnKey)) return false;
|
|
48
41
|
if (!x_axis_date_range_start || !x_axis_date_range_end || !x_axis_compared_date_range_start || !x_axis_compared_date_range_end) {
|
|
49
42
|
return false;
|
|
50
43
|
}
|
|
@@ -77,21 +70,21 @@ class CompareBarCalculator extends _baseCalculator.default {
|
|
|
77
70
|
} = chart;
|
|
78
71
|
const selectedTable = this.getTableById(table_id);
|
|
79
72
|
const selectedView = this.getViewById(view_id, selectedTable);
|
|
80
|
-
const selectedColumn =
|
|
81
|
-
const isAdvanced = y_axis_summary_type ===
|
|
82
|
-
const method = isAdvanced ?
|
|
73
|
+
const selectedColumn = TableUtils.getTableColumnByKey(selectedTable, x_axis_column_key);
|
|
74
|
+
const isAdvanced = y_axis_summary_type === SUMMARY_TYPE.ADVANCED;
|
|
75
|
+
const method = isAdvanced ? DTABLE_DB_SUMMARY_METHOD[y_axis_summary_method] : DTABLE_DB_SUMMARY_METHOD.Count;
|
|
83
76
|
let sqlString = '';
|
|
84
|
-
let groupName =
|
|
85
|
-
const sqlOrder =
|
|
77
|
+
let groupName = getSqlGroup('day', selectedColumn);
|
|
78
|
+
const sqlOrder = getSqlOrder(null, groupName);
|
|
86
79
|
let summaryColumnName = "".concat(selectedColumn.name);
|
|
87
80
|
let selectedSummaryColumn = {};
|
|
88
81
|
if (isAdvanced) {
|
|
89
|
-
selectedSummaryColumn =
|
|
82
|
+
selectedSummaryColumn = TableUtils.getTableColumnByKey(selectedTable, y_axis_column_key);
|
|
90
83
|
if (!selectedSummaryColumn) return [];
|
|
91
84
|
summaryColumnName = "".concat(selectedSummaryColumn.name);
|
|
92
85
|
}
|
|
93
|
-
const summaryColumnMethod =
|
|
94
|
-
let sqlCondition =
|
|
86
|
+
const summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
|
|
87
|
+
let sqlCondition = filter2SqlCondition(selectedTable, selectedView);
|
|
95
88
|
sqlCondition = this.getStatItemSqlCondition(chart, sqlCondition, "`".concat(selectedColumn.name, "`"));
|
|
96
89
|
sqlString = "select ".concat(groupName, ", ").concat(summaryColumnMethod, " from `").concat(selectedTable.name, "` ").concat(sqlCondition, " group by ").concat(groupName, " ").concat(sqlOrder, " limit 5000");
|
|
97
90
|
const result = await this.sqlQuery(sqlString);
|
|
@@ -103,7 +96,7 @@ class CompareBarCalculator extends _baseCalculator.default {
|
|
|
103
96
|
const valueKey = isAdvanced ? "".concat(method, "(").concat(summaryColumnName, ")") : "".concat(method, "(").concat(selectedColumn.name, ")");
|
|
104
97
|
result.data.results.forEach(item => {
|
|
105
98
|
const name = item[groupName];
|
|
106
|
-
const label =
|
|
99
|
+
const label = StatUtils.getGroupLabel(name, item, selectedColumn, x_axis_date_granularity, '', this.value);
|
|
107
100
|
const value = item[valueKey];
|
|
108
101
|
if (name >= x_axis_date_range_start && name <= x_axis_date_range_end) {
|
|
109
102
|
const currentValue = dateRangeResult.get(label);
|
|
@@ -144,8 +137,8 @@ class CompareBarCalculator extends _baseCalculator.default {
|
|
|
144
137
|
let value = item[1];
|
|
145
138
|
let formatted_value = value;
|
|
146
139
|
if (isAdvanced) {
|
|
147
|
-
value =
|
|
148
|
-
formatted_value =
|
|
140
|
+
value = getSummaryResult(item[1], y_axis_summary_method, data.precision);
|
|
141
|
+
formatted_value = StatUtils.getFormattedValue(value, selectedSummaryColumn, y_axis_summary_method);
|
|
149
142
|
}
|
|
150
143
|
rangeResult.push({
|
|
151
144
|
name: item[0],
|
|
@@ -164,8 +157,8 @@ class CompareBarCalculator extends _baseCalculator.default {
|
|
|
164
157
|
let value = item[1];
|
|
165
158
|
let formatted_value = value;
|
|
166
159
|
if (isAdvanced) {
|
|
167
|
-
value =
|
|
168
|
-
formatted_value =
|
|
160
|
+
value = getSummaryResult(item[1], y_axis_summary_method, data.precision);
|
|
161
|
+
formatted_value = StatUtils.getFormattedValue(value, selectedSummaryColumn, y_axis_summary_method);
|
|
169
162
|
}
|
|
170
163
|
const newItem = {
|
|
171
164
|
name: dateRangeItem.name,
|
|
@@ -200,9 +193,9 @@ class CompareBarCalculator extends _baseCalculator.default {
|
|
|
200
193
|
x_axis_compared_date_range_end
|
|
201
194
|
} = chart;
|
|
202
195
|
const newSqlCondition = sqlCondition.length === 0 ? 'where ' : sqlCondition + ' AND';
|
|
203
|
-
const formattedXAxisDateRangeEnd = (
|
|
204
|
-
const formattedXAxisComparedDateRangeEnd = (
|
|
196
|
+
const formattedXAxisDateRangeEnd = dayjs(x_axis_date_range_end).add(1, 'days').format('YYYY-MM-DD');
|
|
197
|
+
const formattedXAxisComparedDateRangeEnd = dayjs(x_axis_compared_date_range_end).add(1, 'days').format('YYYY-MM-DD');
|
|
205
198
|
return newSqlCondition + " ((".concat(name, " >= '").concat(x_axis_date_range_start, "' AND ").concat(name, " < '").concat(formattedXAxisDateRangeEnd, "') Or (").concat(name, " >= '").concat(x_axis_compared_date_range_start, "' AND ").concat(name, " < '").concat(formattedXAxisComparedDateRangeEnd, "'))");
|
|
206
199
|
}
|
|
207
200
|
}
|
|
208
|
-
|
|
201
|
+
export default CompareBarCalculator;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _baseCalculator = _interopRequireDefault(require("./base-calculator"));
|
|
10
|
-
var _sqlUtils = require("../utils/sql-utils");
|
|
11
|
-
var _constants = require("../constants");
|
|
12
|
-
var _commonUtils = require("../utils/common-utils");
|
|
13
|
-
var _statUtils = _interopRequireDefault(require("../utils/stat-utils"));
|
|
14
|
-
var _rowUtils = require("../utils/row-utils");
|
|
15
|
-
class CompletenessCalculator extends _baseCalculator.default {
|
|
1
|
+
import { filter2SqlCondition, TableUtils } from 'dtable-store';
|
|
2
|
+
import BaseCalculator from './base-calculator';
|
|
3
|
+
import { getSqlGroup, getSqlOrder } from '../utils/sql-utils';
|
|
4
|
+
import { PIE_CHART_COLORS, STAT_TYPE, TIME_COLUMN_LIST } from '../constants';
|
|
5
|
+
import { isArrayCellValue } from '../utils/common-utils';
|
|
6
|
+
import StatUtils from '../utils/stat-utils';
|
|
7
|
+
import { getFormattedLabel } from '../utils/row-utils';
|
|
8
|
+
class CompletenessCalculator extends BaseCalculator {
|
|
16
9
|
constructor(_ref) {
|
|
17
10
|
let {
|
|
18
11
|
value,
|
|
@@ -40,16 +33,16 @@ class CompletenessCalculator extends _baseCalculator.default {
|
|
|
40
33
|
group_column
|
|
41
34
|
} = chart;
|
|
42
35
|
const table = this.getTableById(table_id);
|
|
43
|
-
if (!
|
|
36
|
+
if (!TableUtils.getTableColumnByKey(table, name_column)) {
|
|
44
37
|
return false;
|
|
45
38
|
}
|
|
46
|
-
if (!
|
|
39
|
+
if (!TableUtils.getTableColumnByKey(table, completed_column)) {
|
|
47
40
|
return false;
|
|
48
41
|
}
|
|
49
|
-
if (!
|
|
42
|
+
if (!TableUtils.getTableColumnByKey(table, target_column)) {
|
|
50
43
|
return false;
|
|
51
44
|
}
|
|
52
|
-
if (type ===
|
|
45
|
+
if (type === STAT_TYPE.GROUP_COMPLETENESS_CHART && (!group_column || !TableUtils.getTableColumnByKey(table, group_column))) {
|
|
53
46
|
return false;
|
|
54
47
|
}
|
|
55
48
|
return true;
|
|
@@ -76,14 +69,14 @@ class CompletenessCalculator extends _baseCalculator.default {
|
|
|
76
69
|
if (!selectedView) {
|
|
77
70
|
return [];
|
|
78
71
|
}
|
|
79
|
-
const selectedColumn =
|
|
72
|
+
const selectedColumn = TableUtils.getTableColumnByKey(selectedTable, name_column);
|
|
80
73
|
const groupName = "`".concat(selectedColumn.name, "`");
|
|
81
|
-
const sqlCondition =
|
|
82
|
-
const completedColumn =
|
|
83
|
-
const targetColumn =
|
|
84
|
-
const groupColumn =
|
|
85
|
-
const sqlOrder =
|
|
86
|
-
const isColumnDataAsAnArray =
|
|
74
|
+
const sqlCondition = filter2SqlCondition(selectedTable, selectedView);
|
|
75
|
+
const completedColumn = TableUtils.getTableColumnByKey(selectedTable, completed_column);
|
|
76
|
+
const targetColumn = TableUtils.getTableColumnByKey(selectedTable, target_column);
|
|
77
|
+
const groupColumn = TableUtils.getTableColumnByKey(selectedTable, group_column);
|
|
78
|
+
const sqlOrder = getSqlOrder(null, groupName);
|
|
79
|
+
const isColumnDataAsAnArray = isArrayCellValue(selectedColumn);
|
|
87
80
|
const memo = new Map();
|
|
88
81
|
const resultList = [];
|
|
89
82
|
if (!groupColumn) {
|
|
@@ -98,11 +91,11 @@ class CompletenessCalculator extends _baseCalculator.default {
|
|
|
98
91
|
const name = item[selectedColumn.key];
|
|
99
92
|
let label;
|
|
100
93
|
if (name || Number.isFinite(name)) {
|
|
101
|
-
label =
|
|
94
|
+
label = StatUtils.getGroupLabel(name, item, selectedColumn, '', '', this.value);
|
|
102
95
|
if (isColumnDataAsAnArray) {
|
|
103
96
|
label = label[0];
|
|
104
97
|
}
|
|
105
|
-
label =
|
|
98
|
+
label = getFormattedLabel(selectedColumn, label, this.value.collaborators);
|
|
106
99
|
if (!memo.get(label)) {
|
|
107
100
|
const completedValue = item[completedColumn.key] || 0;
|
|
108
101
|
const targetValue = item[targetColumn.key] || 0;
|
|
@@ -137,13 +130,13 @@ class CompletenessCalculator extends _baseCalculator.default {
|
|
|
137
130
|
}
|
|
138
131
|
});
|
|
139
132
|
} else {
|
|
140
|
-
const isTimeGroupColumn =
|
|
141
|
-
const isGroupColumnDataAsAnArray =
|
|
133
|
+
const isTimeGroupColumn = TIME_COLUMN_LIST.includes(groupColumn.type);
|
|
134
|
+
const isGroupColumnDataAsAnArray = isArrayCellValue(groupColumn);
|
|
142
135
|
const completedColumnName = "`".concat(completedColumn.name, "`");
|
|
143
136
|
const targetColumnName = "`".concat(targetColumn.name, "`");
|
|
144
137
|
let groupColumnName = "`".concat(groupColumn.name, "`");
|
|
145
138
|
if (isTimeGroupColumn) {
|
|
146
|
-
groupColumnName =
|
|
139
|
+
groupColumnName = getSqlGroup(date_granularity, groupColumn);
|
|
147
140
|
}
|
|
148
141
|
const sqlString = "select ".concat(groupName, ", ").concat(completedColumnName, ", ").concat(targetColumnName, ", ").concat(groupColumnName, " from `").concat(selectedTable.name, "` ").concat(sqlCondition, " group by ").concat(groupName, ", ").concat(completedColumnName, ", ").concat(targetColumnName, ", ").concat(groupColumnName, " ").concat(sqlOrder, " desc limit 5000");
|
|
149
142
|
const result = await this.sqlQuery(sqlString);
|
|
@@ -159,21 +152,21 @@ class CompletenessCalculator extends _baseCalculator.default {
|
|
|
159
152
|
|
|
160
153
|
// get and format name
|
|
161
154
|
if (name || Number.isFinite(name)) {
|
|
162
|
-
label =
|
|
155
|
+
label = StatUtils.getGroupLabel(name, item, selectedColumn, '', '', this.value);
|
|
163
156
|
if (isColumnDataAsAnArray) {
|
|
164
157
|
label = label[0];
|
|
165
158
|
}
|
|
166
|
-
label =
|
|
159
|
+
label = getFormattedLabel(selectedColumn, label, this.value.collaborators);
|
|
167
160
|
}
|
|
168
161
|
|
|
169
162
|
// get and format group name
|
|
170
163
|
if (!isTimeGroupColumn) {
|
|
171
164
|
groupLabel = item[groupColumn.key];
|
|
172
|
-
groupLabel =
|
|
165
|
+
groupLabel = StatUtils.getGroupLabel(groupLabel, item, groupColumn, '', '', this.value);
|
|
173
166
|
if (groupLabel && isGroupColumnDataAsAnArray) {
|
|
174
167
|
groupLabel = groupLabel[0];
|
|
175
168
|
}
|
|
176
|
-
groupLabel =
|
|
169
|
+
groupLabel = getFormattedLabel(groupColumn, groupLabel, this.value.collaborators);
|
|
177
170
|
} else {
|
|
178
171
|
groupLabel = item[groupColumnName] + '';
|
|
179
172
|
}
|
|
@@ -181,7 +174,7 @@ class CompletenessCalculator extends _baseCalculator.default {
|
|
|
181
174
|
// get group color
|
|
182
175
|
let color = colorMap[groupLabel];
|
|
183
176
|
if (!color) {
|
|
184
|
-
color =
|
|
177
|
+
color = PIE_CHART_COLORS[colorIndex % 12];
|
|
185
178
|
colorMap[groupLabel] = color;
|
|
186
179
|
colorIndex++;
|
|
187
180
|
}
|
|
@@ -226,4 +219,4 @@ class CompletenessCalculator extends _baseCalculator.default {
|
|
|
226
219
|
return resultList;
|
|
227
220
|
}
|
|
228
221
|
}
|
|
229
|
-
|
|
222
|
+
export default CompletenessCalculator;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
const IGNORE_KEYS = ['description', 'format_version', 'plugin_settings', 'plugins', 'statistics', 'version', 'scripts', 'settings'];
|
|
8
2
|
const TABLE_IGNORE_KEYS = ['summary_configs', 'is_header_locked'];
|
|
9
3
|
const copyValue = value => {
|
|
@@ -50,4 +44,4 @@ const copyValue = value => {
|
|
|
50
44
|
newValue.tables = newTables;
|
|
51
45
|
return newValue;
|
|
52
46
|
};
|
|
53
|
-
|
|
47
|
+
export default copyValue;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableStore = require("dtable-store");
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _commonUtils = require("../utils/common-utils");
|
|
11
|
-
var _baseCalculator = _interopRequireDefault(require("./base-calculator"));
|
|
12
|
-
class DashboardCalculator extends _baseCalculator.default {
|
|
1
|
+
import { filter2SqlCondition, TableUtils } from 'dtable-store';
|
|
2
|
+
import { DTABLE_DB_SUMMARY_METHOD } from '../constants';
|
|
3
|
+
import { getSummaryColumnMethod } from '../utils/common-utils';
|
|
4
|
+
import BaseCalculator from './base-calculator';
|
|
5
|
+
class DashboardCalculator extends BaseCalculator {
|
|
13
6
|
constructor(_ref) {
|
|
14
7
|
let {
|
|
15
8
|
value,
|
|
@@ -34,8 +27,8 @@ class DashboardCalculator extends _baseCalculator.default {
|
|
|
34
27
|
total_value_column
|
|
35
28
|
} = chart;
|
|
36
29
|
const table = this.getTableById(table_id);
|
|
37
|
-
const selectedColumn1 =
|
|
38
|
-
const selectedColumn2 =
|
|
30
|
+
const selectedColumn1 = TableUtils.getTableColumnByKey(table, target_value_column);
|
|
31
|
+
const selectedColumn2 = TableUtils.getTableColumnByKey(table, total_value_column);
|
|
39
32
|
if (!selectedColumn1 || !selectedColumn2) {
|
|
40
33
|
return false;
|
|
41
34
|
}
|
|
@@ -59,11 +52,11 @@ class DashboardCalculator extends _baseCalculator.default {
|
|
|
59
52
|
} = chart;
|
|
60
53
|
const selectedTable = this.getTableById(table_id);
|
|
61
54
|
const selectedView = this.getViewById(view_id, selectedTable);
|
|
62
|
-
const selectedColumn1 =
|
|
63
|
-
const selectedColumn2 =
|
|
64
|
-
const sqlCondition =
|
|
65
|
-
const key1 =
|
|
66
|
-
const key2 =
|
|
55
|
+
const selectedColumn1 = TableUtils.getTableColumnByKey(selectedTable, target_value_column);
|
|
56
|
+
const selectedColumn2 = TableUtils.getTableColumnByKey(selectedTable, total_value_column);
|
|
57
|
+
const sqlCondition = filter2SqlCondition(selectedTable, selectedView);
|
|
58
|
+
const key1 = getSummaryColumnMethod(DTABLE_DB_SUMMARY_METHOD[target_value_column_summary_method], selectedColumn1.name);
|
|
59
|
+
const key2 = getSummaryColumnMethod(DTABLE_DB_SUMMARY_METHOD[total_value_column_summary_method], selectedColumn2.name);
|
|
67
60
|
const sqlString = "select ".concat(key1, ", ").concat(key2, " from `").concat(selectedTable.name, "` ").concat(sqlCondition, " limit 5000");
|
|
68
61
|
const result = await this.sqlQuery(sqlString);
|
|
69
62
|
if (result.status === 200 && result.data.success) {
|
|
@@ -81,4 +74,4 @@ class DashboardCalculator extends _baseCalculator.default {
|
|
|
81
74
|
return 0;
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
|
-
|
|
77
|
+
export default DashboardCalculator;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
-
var _dtableStore = require("dtable-store");
|
|
10
|
-
var _baseCalculator = _interopRequireDefault(require("./base-calculator"));
|
|
11
|
-
var _commonUtils = require("../utils/common-utils");
|
|
12
|
-
var _constants = require("../constants");
|
|
13
|
-
class HeatMapCalculator extends _baseCalculator.default {
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import { filter2SqlCondition, TableUtils } from 'dtable-store';
|
|
3
|
+
import BaseCalculator from './base-calculator';
|
|
4
|
+
import { formatNumericValue, getSummaryColumnMethod } from '../utils/common-utils';
|
|
5
|
+
import { DTABLE_DB_SUMMARY_METHOD } from '../constants';
|
|
6
|
+
class HeatMapCalculator extends BaseCalculator {
|
|
14
7
|
constructor(_ref) {
|
|
15
8
|
let {
|
|
16
9
|
value,
|
|
@@ -35,10 +28,10 @@ class HeatMapCalculator extends _baseCalculator.default {
|
|
|
35
28
|
summary_column
|
|
36
29
|
} = chart;
|
|
37
30
|
const table = this.getTableById(table_id);
|
|
38
|
-
if (!
|
|
31
|
+
if (!TableUtils.getTableColumnByKey(table, time_column)) {
|
|
39
32
|
return false;
|
|
40
33
|
}
|
|
41
|
-
if (summary_column && !
|
|
34
|
+
if (summary_column && !TableUtils.getTableColumnByKey(table, summary_column)) {
|
|
42
35
|
return false;
|
|
43
36
|
}
|
|
44
37
|
return true;
|
|
@@ -56,7 +49,7 @@ class HeatMapCalculator extends _baseCalculator.default {
|
|
|
56
49
|
data.push(item);
|
|
57
50
|
return;
|
|
58
51
|
}
|
|
59
|
-
const year = (
|
|
52
|
+
const year = dayjs(item.name).year();
|
|
60
53
|
data.push({
|
|
61
54
|
...item,
|
|
62
55
|
year
|
|
@@ -82,21 +75,21 @@ class HeatMapCalculator extends _baseCalculator.default {
|
|
|
82
75
|
} = chart;
|
|
83
76
|
const selectedTable = this.getTableById(table_id);
|
|
84
77
|
const selectedView = this.getViewById(view_id, selectedTable);
|
|
85
|
-
const selectedColumn =
|
|
78
|
+
const selectedColumn = TableUtils.getTableColumnByKey(selectedTable, time_column);
|
|
86
79
|
const columnName = selectedColumn.name;
|
|
87
80
|
const isAdvanced = summary_type === 'advanced';
|
|
88
|
-
const method = isAdvanced ?
|
|
89
|
-
const sqlCondition =
|
|
81
|
+
const method = isAdvanced ? DTABLE_DB_SUMMARY_METHOD[summary_method] : 'COUNT';
|
|
82
|
+
const sqlCondition = filter2SqlCondition(selectedTable, selectedView);
|
|
90
83
|
let summaryColumnName = '';
|
|
91
84
|
let summaryColumn;
|
|
92
85
|
let sqlString = '';
|
|
93
86
|
if (isAdvanced) {
|
|
94
|
-
summaryColumn =
|
|
87
|
+
summaryColumn = TableUtils.getTableColumnByKey(selectedTable, summary_column);
|
|
95
88
|
if (!summaryColumn) {
|
|
96
89
|
return [];
|
|
97
90
|
}
|
|
98
91
|
summaryColumnName = summaryColumn.name;
|
|
99
|
-
const summaryColumnMethod =
|
|
92
|
+
const summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
|
|
100
93
|
sqlString = "select `".concat(columnName, "`, ").concat(summaryColumnMethod, " from `").concat(selectedTable.name, "` ").concat(sqlCondition, " group by `").concat(columnName, "` limit 5000");
|
|
101
94
|
} else {
|
|
102
95
|
sqlString = "select `".concat(columnName, "`, ").concat(method, "(").concat(columnName, ") from `").concat(selectedTable.name, "` ").concat(sqlCondition, " group by `").concat(columnName, "` limit 5000");
|
|
@@ -106,18 +99,18 @@ class HeatMapCalculator extends _baseCalculator.default {
|
|
|
106
99
|
const data = result.data;
|
|
107
100
|
if (!data.results) return [];
|
|
108
101
|
const newResult = [];
|
|
109
|
-
const summaryColumnMethod =
|
|
102
|
+
const summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
|
|
110
103
|
const valueKey = isAdvanced ? "".concat(summaryColumnMethod) : "".concat(method, "(").concat(columnName, ")");
|
|
111
104
|
data.results.forEach(item => {
|
|
112
105
|
const currentValue = item[time_column];
|
|
113
106
|
if (currentValue) {
|
|
114
107
|
let value = item[valueKey];
|
|
115
108
|
if (isAdvanced) {
|
|
116
|
-
value =
|
|
109
|
+
value = formatNumericValue(value, summaryColumn);
|
|
117
110
|
}
|
|
118
111
|
const name = typeof currentValue === 'string' ? currentValue : currentValue.country_region;
|
|
119
112
|
newResult.push({
|
|
120
|
-
name: (
|
|
113
|
+
name: dayjs(name).format('YYYY-MM-DD'),
|
|
121
114
|
value
|
|
122
115
|
});
|
|
123
116
|
}
|
|
@@ -159,4 +152,4 @@ class HeatMapCalculator extends _baseCalculator.default {
|
|
|
159
152
|
});
|
|
160
153
|
}
|
|
161
154
|
}
|
|
162
|
-
|
|
155
|
+
export default HeatMapCalculator;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _basicChartCalculator = _interopRequireDefault(require("./basic-chart-calculator"));
|
|
9
|
-
var _constants = require("../constants");
|
|
1
|
+
import BasicChartCalculator from './basic-chart-calculator';
|
|
2
|
+
import { DATA_SORT_TYPE } from '../constants';
|
|
10
3
|
class HorizontalBarCalculator {
|
|
11
4
|
constructor(_ref) {
|
|
12
5
|
let {
|
|
@@ -15,7 +8,7 @@ class HorizontalBarCalculator {
|
|
|
15
8
|
username,
|
|
16
9
|
userId
|
|
17
10
|
} = _ref;
|
|
18
|
-
this.basicChartCalculator = new
|
|
11
|
+
this.basicChartCalculator = new BasicChartCalculator({
|
|
19
12
|
value,
|
|
20
13
|
username,
|
|
21
14
|
userId,
|
|
@@ -49,10 +42,10 @@ class HorizontalBarCalculator {
|
|
|
49
42
|
column_groupby_numeric_columns
|
|
50
43
|
} = chart;
|
|
51
44
|
let sortType = chart.sort_type;
|
|
52
|
-
if (sortType ===
|
|
53
|
-
sortType =
|
|
54
|
-
} else if (sortType ===
|
|
55
|
-
sortType =
|
|
45
|
+
if (sortType === DATA_SORT_TYPE.ASCENDING) {
|
|
46
|
+
sortType = DATA_SORT_TYPE.DESCENDING;
|
|
47
|
+
} else if (sortType === DATA_SORT_TYPE.DESCENDING) {
|
|
48
|
+
sortType = DATA_SORT_TYPE.ASCENDING;
|
|
56
49
|
}
|
|
57
50
|
return {
|
|
58
51
|
type: 'bar',
|
|
@@ -75,4 +68,4 @@ class HorizontalBarCalculator {
|
|
|
75
68
|
};
|
|
76
69
|
}
|
|
77
70
|
}
|
|
78
|
-
|
|
71
|
+
export default HorizontalBarCalculator;
|
package/es/calculator/index.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _worldMapCalculator = _interopRequireDefault(require("./world-map-calculator"));
|
|
17
|
-
var _heatMapCalculator = _interopRequireDefault(require("./heat-map-calculator"));
|
|
18
|
-
var _mirrorCalculator = _interopRequireDefault(require("./mirror-calculator"));
|
|
19
|
-
var _numberCardCalculator = _interopRequireDefault(require("./number-card-calculator"));
|
|
20
|
-
var _trendCalculator = _interopRequireDefault(require("./trend-calculator"));
|
|
21
|
-
var _dashboardCalculator = _interopRequireDefault(require("./dashboard-calculator"));
|
|
22
|
-
var _constants = require("../constants");
|
|
1
|
+
import PivotTableCalculator from './pivot-table-calculator';
|
|
2
|
+
import BasicChartCalculator from './basic-chart-calculator';
|
|
3
|
+
import CompareBarCalculator from './compare-bar-calculator';
|
|
4
|
+
import HorizontalBarCalculator from './horizontal-bar-calculator';
|
|
5
|
+
import CompletenessCalculator from './completeness-calculator';
|
|
6
|
+
import ScatterCalculator from './scatter-calculator';
|
|
7
|
+
import CombinationCalculator from './combination-calculator';
|
|
8
|
+
import MapCalculator from './map-calculator';
|
|
9
|
+
import WorldMapCalculator from './world-map-calculator';
|
|
10
|
+
import HeatMapCalculator from './heat-map-calculator';
|
|
11
|
+
import MirrorCalculator from './mirror-calculator';
|
|
12
|
+
import NumberCardCalculator from './number-card-calculator';
|
|
13
|
+
import TrendCalculator from './trend-calculator';
|
|
14
|
+
import DashboardCalculator from './dashboard-calculator';
|
|
15
|
+
import { STAT_TYPE } from '../constants';
|
|
23
16
|
const BASIC_CHART = 'basic_chart';
|
|
24
17
|
class ChartCalculator {
|
|
25
18
|
constructor(_ref) {
|
|
@@ -36,25 +29,25 @@ class ChartCalculator {
|
|
|
36
29
|
statisticThreadManager
|
|
37
30
|
};
|
|
38
31
|
this.chartCalculationMap = {
|
|
39
|
-
[
|
|
40
|
-
[BASIC_CHART]: new
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
32
|
+
[STAT_TYPE.PIVOT_TABLE]: new PivotTableCalculator(configs),
|
|
33
|
+
[BASIC_CHART]: new BasicChartCalculator(configs),
|
|
34
|
+
[STAT_TYPE.COMPARE_BAR]: new CompareBarCalculator(configs),
|
|
35
|
+
[STAT_TYPE.HORIZONTAL_BAR]: new HorizontalBarCalculator(configs),
|
|
36
|
+
[STAT_TYPE.HORIZONTAL_GROUP_BAR]: new HorizontalBarCalculator(configs),
|
|
37
|
+
[STAT_TYPE.STACKED_HORIZONTAL_BAR]: new HorizontalBarCalculator(configs),
|
|
38
|
+
[STAT_TYPE.COMPLETENESS_CHART]: new CompletenessCalculator(configs),
|
|
39
|
+
[STAT_TYPE.GROUP_COMPLETENESS_CHART]: new CompletenessCalculator(configs),
|
|
40
|
+
[STAT_TYPE.SCATTER]: new ScatterCalculator(configs),
|
|
41
|
+
[STAT_TYPE.COMBINATION_CHART]: new CombinationCalculator(configs),
|
|
42
|
+
[STAT_TYPE.MAP]: new MapCalculator(configs),
|
|
43
|
+
[STAT_TYPE.MAP_BUBBLE]: new MapCalculator(configs),
|
|
44
|
+
[STAT_TYPE.WORLD_MAP]: new WorldMapCalculator(configs),
|
|
45
|
+
[STAT_TYPE.WORLD_MAP_BUBBLE]: new WorldMapCalculator(configs),
|
|
46
|
+
[STAT_TYPE.HEAT_MAP]: new HeatMapCalculator(configs),
|
|
47
|
+
[STAT_TYPE.MIRROR]: new MirrorCalculator(configs),
|
|
48
|
+
[STAT_TYPE.BASIC_NUMBER_CARD]: new NumberCardCalculator(configs),
|
|
49
|
+
[STAT_TYPE.TREND_CHART]: new TrendCalculator(configs),
|
|
50
|
+
[STAT_TYPE.DASHBOARD]: new DashboardCalculator(configs)
|
|
58
51
|
};
|
|
59
52
|
}
|
|
60
53
|
isValidChart(chart) {
|
|
@@ -76,4 +69,4 @@ class ChartCalculator {
|
|
|
76
69
|
return chartCalculation.calculate(chart);
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
|
-
|
|
72
|
+
export default ChartCalculator;
|