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,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = calculateResult;
|
|
8
|
-
var _dtableStore = require("dtable-store");
|
|
9
|
-
var _statUtils = _interopRequireDefault(require("../../utils/stat-utils"));
|
|
10
|
-
var _commonUtils = require("../../utils/common-utils");
|
|
11
|
-
var _constants = require("../../constants");
|
|
12
|
-
var _rowUtils = require("../../utils/row-utils");
|
|
13
|
-
function calculateResult(chart, value, username, userId) {
|
|
1
|
+
import { isNumber, TableUtils, Views } from 'dtable-store';
|
|
2
|
+
import StatUtils from '../../utils/stat-utils';
|
|
3
|
+
import { getSummaryResult, isArrayCellValue } from '../../utils/common-utils';
|
|
4
|
+
import { LABEL_COLORS, SUMMARY_TYPE } from '../../constants';
|
|
5
|
+
import { getCellValue, getFormattedLabel } from '../../utils/row-utils';
|
|
6
|
+
export default function calculateResult(chart, value, username, userId) {
|
|
14
7
|
const {
|
|
15
8
|
table_id,
|
|
16
9
|
view_id,
|
|
@@ -27,42 +20,42 @@ function calculateResult(chart, value, username, userId) {
|
|
|
27
20
|
y_axis_left_group_by_multiple_numeric_column,
|
|
28
21
|
y_axis_left_group_by_numeric_columns
|
|
29
22
|
} = chart;
|
|
30
|
-
const table =
|
|
31
|
-
const view = table &&
|
|
23
|
+
const table = TableUtils.getTableById(value.tables, table_id);
|
|
24
|
+
const view = table && Views.getViewById(table.views, view_id);
|
|
32
25
|
if (!view) {
|
|
33
26
|
return [];
|
|
34
27
|
}
|
|
35
|
-
const xAxisColumn =
|
|
28
|
+
const xAxisColumn = TableUtils.getTableColumnByKey(table, x_axis_column_key);
|
|
36
29
|
if (!xAxisColumn) return [];
|
|
37
|
-
const statRows =
|
|
38
|
-
const formulaRows =
|
|
39
|
-
const column1 =
|
|
40
|
-
const column2 =
|
|
30
|
+
const statRows = Views.getViewRows(view, table, value, username, userId);
|
|
31
|
+
const formulaRows = Views.getTableFormulaResults(table, statRows, value);
|
|
32
|
+
const column1 = TableUtils.getTableColumnByKey(table, y_axis_left_summary_column);
|
|
33
|
+
const column2 = TableUtils.getTableColumnByKey(table, y_axis_right_summary_column);
|
|
41
34
|
const leftResultMap = new Map();
|
|
42
35
|
const rightResultMap = new Map();
|
|
43
|
-
let isColumnDataAsAnArray =
|
|
36
|
+
let isColumnDataAsAnArray = isArrayCellValue(xAxisColumn);
|
|
44
37
|
let leftSummaryColumn = {};
|
|
45
38
|
let leftSummaryColumnKeys = [];
|
|
46
|
-
if (y_axis_left_summary_type ===
|
|
39
|
+
if (y_axis_left_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
47
40
|
if (column1) {
|
|
48
41
|
leftSummaryColumn[y_axis_left_summary_column] = {
|
|
49
42
|
method: y_axis_left_summary_method,
|
|
50
43
|
column_name: column1.name,
|
|
51
44
|
type: column1.type,
|
|
52
45
|
data: column1.data,
|
|
53
|
-
color:
|
|
46
|
+
color: LABEL_COLORS[0]
|
|
54
47
|
};
|
|
55
48
|
}
|
|
56
49
|
if (y_axis_left_group_by_multiple_numeric_column) {
|
|
57
50
|
y_axis_left_group_by_numeric_columns.forEach((item, index) => {
|
|
58
|
-
const summaryColumn =
|
|
51
|
+
const summaryColumn = TableUtils.getTableColumnByKey(table, item.column_key);
|
|
59
52
|
if (summaryColumn) {
|
|
60
53
|
leftSummaryColumn[item.column_key] = {
|
|
61
54
|
method: item.summary_method,
|
|
62
55
|
column_name: summaryColumn.name,
|
|
63
56
|
type: summaryColumn.type,
|
|
64
57
|
data: summaryColumn.data,
|
|
65
|
-
color:
|
|
58
|
+
color: LABEL_COLORS[(index + 1) % 12]
|
|
66
59
|
};
|
|
67
60
|
}
|
|
68
61
|
});
|
|
@@ -75,10 +68,10 @@ function calculateResult(chart, value, username, userId) {
|
|
|
75
68
|
} = row;
|
|
76
69
|
let formulaRow = formulaRows[rowId];
|
|
77
70
|
const currentValue = row[xAxisColumn.key];
|
|
78
|
-
let label =
|
|
71
|
+
let label = StatUtils.getGroupLabel(currentValue, formulaRow, xAxisColumn, groupby_date_granularity, groupby_geolocation_granularity, value);
|
|
79
72
|
|
|
80
73
|
// collect left y axis data
|
|
81
|
-
if (y_axis_left_summary_type ===
|
|
74
|
+
if (y_axis_left_summary_type === SUMMARY_TYPE.COUNT) {
|
|
82
75
|
if (isColumnDataAsAnArray) {
|
|
83
76
|
if (label.length > 0) {
|
|
84
77
|
label.forEach(name => {
|
|
@@ -100,18 +93,18 @@ function calculateResult(chart, value, username, userId) {
|
|
|
100
93
|
}
|
|
101
94
|
}
|
|
102
95
|
}
|
|
103
|
-
if (y_axis_left_summary_type ===
|
|
96
|
+
if (y_axis_left_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
104
97
|
if (isColumnDataAsAnArray) {
|
|
105
98
|
if (label.length > 0) {
|
|
106
99
|
label.forEach(name => {
|
|
107
100
|
const currentLabelMap = leftResultMap.get(name) || {};
|
|
108
101
|
leftSummaryColumnKeys.forEach(key => {
|
|
109
|
-
const cellValue =
|
|
102
|
+
const cellValue = getCellValue(row, formulaRow, {
|
|
110
103
|
...leftSummaryColumn[key],
|
|
111
104
|
key
|
|
112
105
|
});
|
|
113
106
|
const currentLabelList = currentLabelMap[key] || [];
|
|
114
|
-
if (
|
|
107
|
+
if (isNumber(cellValue)) {
|
|
115
108
|
currentLabelList.push(cellValue);
|
|
116
109
|
}
|
|
117
110
|
currentLabelMap[key] = currentLabelList;
|
|
@@ -122,12 +115,12 @@ function calculateResult(chart, value, username, userId) {
|
|
|
122
115
|
if (label.length === 0 && x_axis_include_empty) {
|
|
123
116
|
let currentValue = leftResultMap.get(null) || {};
|
|
124
117
|
leftSummaryColumnKeys.forEach(key => {
|
|
125
|
-
const cellValue =
|
|
118
|
+
const cellValue = getCellValue(row, formulaRow, {
|
|
126
119
|
...leftSummaryColumn[key],
|
|
127
120
|
key
|
|
128
121
|
});
|
|
129
122
|
const currentLabelList = currentValue[key] || [];
|
|
130
|
-
if (
|
|
123
|
+
if (isNumber(cellValue)) {
|
|
131
124
|
currentLabelList.push(cellValue);
|
|
132
125
|
}
|
|
133
126
|
currentValue[key] = currentLabelList;
|
|
@@ -138,12 +131,12 @@ function calculateResult(chart, value, username, userId) {
|
|
|
138
131
|
if (x_axis_include_empty || label) {
|
|
139
132
|
const currentValue = leftResultMap.get(label) || {};
|
|
140
133
|
leftSummaryColumnKeys.forEach(key => {
|
|
141
|
-
const cellValue =
|
|
134
|
+
const cellValue = getCellValue(row, formulaRow, {
|
|
142
135
|
...leftSummaryColumn[key],
|
|
143
136
|
key
|
|
144
137
|
});
|
|
145
138
|
const currentList = currentValue[key] || [];
|
|
146
|
-
if (
|
|
139
|
+
if (isNumber(cellValue)) {
|
|
147
140
|
currentList.push(cellValue);
|
|
148
141
|
}
|
|
149
142
|
currentValue[key] = currentList;
|
|
@@ -154,7 +147,7 @@ function calculateResult(chart, value, username, userId) {
|
|
|
154
147
|
}
|
|
155
148
|
|
|
156
149
|
// collect right y axis data
|
|
157
|
-
if (y_axis_right_summary_type ===
|
|
150
|
+
if (y_axis_right_summary_type === SUMMARY_TYPE.COUNT) {
|
|
158
151
|
if (isColumnDataAsAnArray) {
|
|
159
152
|
if (label.length > 0) {
|
|
160
153
|
label.forEach(name => {
|
|
@@ -176,13 +169,13 @@ function calculateResult(chart, value, username, userId) {
|
|
|
176
169
|
}
|
|
177
170
|
}
|
|
178
171
|
}
|
|
179
|
-
if (y_axis_right_summary_column && y_axis_right_summary_type ===
|
|
180
|
-
const cellValue =
|
|
172
|
+
if (y_axis_right_summary_column && y_axis_right_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
173
|
+
const cellValue = getCellValue(row, formulaRow, column2);
|
|
181
174
|
if (isColumnDataAsAnArray) {
|
|
182
175
|
if (label.length > 0) {
|
|
183
176
|
label.forEach(name => {
|
|
184
177
|
const currentLabelList = rightResultMap.get(name) || [];
|
|
185
|
-
if (
|
|
178
|
+
if (isNumber(cellValue)) {
|
|
186
179
|
currentLabelList.push(cellValue);
|
|
187
180
|
}
|
|
188
181
|
rightResultMap.set(name, currentLabelList);
|
|
@@ -190,7 +183,7 @@ function calculateResult(chart, value, username, userId) {
|
|
|
190
183
|
}
|
|
191
184
|
if (label.length === 0 && x_axis_include_empty) {
|
|
192
185
|
let currentValue = rightResultMap.get(null) || [];
|
|
193
|
-
if (
|
|
186
|
+
if (isNumber(cellValue)) {
|
|
194
187
|
currentValue.push(cellValue);
|
|
195
188
|
}
|
|
196
189
|
rightResultMap.set(null, currentValue);
|
|
@@ -198,7 +191,7 @@ function calculateResult(chart, value, username, userId) {
|
|
|
198
191
|
} else {
|
|
199
192
|
if (x_axis_include_empty || label) {
|
|
200
193
|
const currentLabelList = rightResultMap.get(label) || [];
|
|
201
|
-
if (
|
|
194
|
+
if (isNumber(cellValue)) {
|
|
202
195
|
currentLabelList.push(cellValue);
|
|
203
196
|
}
|
|
204
197
|
rightResultMap.set(label, currentLabelList);
|
|
@@ -210,7 +203,7 @@ function calculateResult(chart, value, username, userId) {
|
|
|
210
203
|
// Summary collect data
|
|
211
204
|
let results = [];
|
|
212
205
|
let targetMap = leftResultMap;
|
|
213
|
-
if (leftSummaryColumnKeys.length === 0 && y_axis_left_summary_type ===
|
|
206
|
+
if (leftSummaryColumnKeys.length === 0 && y_axis_left_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
214
207
|
targetMap = rightResultMap;
|
|
215
208
|
}
|
|
216
209
|
for (let item of targetMap) {
|
|
@@ -221,23 +214,23 @@ function calculateResult(chart, value, username, userId) {
|
|
|
221
214
|
let formattedValueLeft = value1;
|
|
222
215
|
let formattedValueRight = value2;
|
|
223
216
|
const rightValue = rightResultMap.get(key);
|
|
224
|
-
if (y_axis_right_summary_type ===
|
|
217
|
+
if (y_axis_right_summary_type === SUMMARY_TYPE.COUNT) {
|
|
225
218
|
value2 = rightValue;
|
|
226
219
|
formattedValueRight = value2;
|
|
227
220
|
}
|
|
228
|
-
if (y_axis_right_summary_type ===
|
|
229
|
-
value2 =
|
|
230
|
-
formattedValueRight =
|
|
221
|
+
if (y_axis_right_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
222
|
+
value2 = getSummaryResult(rightValue, y_axis_right_summary_method);
|
|
223
|
+
formattedValueRight = StatUtils.getFormattedValue(value2, column2, y_axis_right_summary_method);
|
|
231
224
|
}
|
|
232
225
|
if (!y_axis_left_group_by_multiple_numeric_column) {
|
|
233
|
-
if (y_axis_left_summary_type ===
|
|
226
|
+
if (y_axis_left_summary_type === SUMMARY_TYPE.COUNT) {
|
|
234
227
|
value1 = leftValue;
|
|
235
228
|
formattedValueLeft = value1;
|
|
236
229
|
}
|
|
237
|
-
if (y_axis_left_summary_type ===
|
|
230
|
+
if (y_axis_left_summary_type === SUMMARY_TYPE.ADVANCED) {
|
|
238
231
|
const list = leftValue[column1.key];
|
|
239
|
-
value1 =
|
|
240
|
-
formattedValueLeft =
|
|
232
|
+
value1 = getSummaryResult(list, y_axis_left_summary_method);
|
|
233
|
+
formattedValueLeft = StatUtils.getFormattedValue(value1, column1, y_axis_left_summary_method);
|
|
241
234
|
}
|
|
242
235
|
results.push({
|
|
243
236
|
name: key,
|
|
@@ -251,8 +244,8 @@ function calculateResult(chart, value, username, userId) {
|
|
|
251
244
|
const summaryColumn = leftSummaryColumn[columnKey];
|
|
252
245
|
const summaryMethod = summaryColumn.method;
|
|
253
246
|
const list = leftValue[columnKey];
|
|
254
|
-
const value =
|
|
255
|
-
formattedValueLeft =
|
|
247
|
+
const value = getSummaryResult(list, summaryMethod);
|
|
248
|
+
formattedValueLeft = StatUtils.getFormattedValue(value, summaryColumn, summaryMethod);
|
|
256
249
|
results.push({
|
|
257
250
|
name: key,
|
|
258
251
|
value_left: value,
|
|
@@ -264,9 +257,9 @@ function calculateResult(chart, value, username, userId) {
|
|
|
264
257
|
});
|
|
265
258
|
}
|
|
266
259
|
}
|
|
267
|
-
|
|
260
|
+
StatUtils.sortStatistics(results, xAxisColumn, 'name');
|
|
268
261
|
results.forEach(item => {
|
|
269
|
-
item.name =
|
|
262
|
+
item.name = getFormattedLabel(xAxisColumn, item.name, value.collaborators);
|
|
270
263
|
});
|
|
271
264
|
return results;
|
|
272
265
|
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableStore = require("dtable-store");
|
|
9
|
-
var _statUtils = _interopRequireDefault(require("../../utils/stat-utils"));
|
|
10
|
-
var _commonUtils = require("../../utils/common-utils");
|
|
11
|
-
var _rowUtils = require("../../utils/row-utils");
|
|
12
|
-
var _constants = require("../../constants");
|
|
1
|
+
import { TableUtils, Views } from 'dtable-store';
|
|
2
|
+
import StatUtils from '../../utils/stat-utils';
|
|
3
|
+
import { getSummaryResult } from '../../utils/common-utils';
|
|
4
|
+
import { getCellValue } from '../../utils/row-utils';
|
|
5
|
+
import { SUMMARY_TYPE } from '../../constants';
|
|
13
6
|
function calculateChart(chart, value, username, userId) {
|
|
14
7
|
const {
|
|
15
8
|
table_id,
|
|
@@ -27,21 +20,21 @@ function calculateChart(chart, value, username, userId) {
|
|
|
27
20
|
} = chart;
|
|
28
21
|
const groupName1 = "".concat(x_axis_date_range_start, " - ").concat(x_axis_date_range_end);
|
|
29
22
|
const groupName2 = "".concat(x_axis_compared_date_range_start, " - ").concat(x_axis_compared_date_range_end);
|
|
30
|
-
const table =
|
|
31
|
-
const view = table &&
|
|
23
|
+
const table = TableUtils.getTableById(value.tables, table_id);
|
|
24
|
+
const view = table && Views.getViewById(table.views, view_id);
|
|
32
25
|
if (!view || !x_axis_column_key) {
|
|
33
26
|
return [];
|
|
34
27
|
}
|
|
35
|
-
const groupbyColumn =
|
|
28
|
+
const groupbyColumn = TableUtils.getTableColumnByKey(table, x_axis_column_key);
|
|
36
29
|
if (!groupbyColumn) {
|
|
37
30
|
return [];
|
|
38
31
|
}
|
|
39
|
-
const summaryColumn =
|
|
40
|
-
const statRows =
|
|
41
|
-
const formulaRows =
|
|
32
|
+
const summaryColumn = TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
|
|
33
|
+
const statRows = Views.getViewRows(view, table, value, username, userId);
|
|
34
|
+
const formulaRows = Views.getTableFormulaResults(table, statRows, value);
|
|
42
35
|
const dateRangeResultMap = new Map();
|
|
43
36
|
const comparedDateRangeResultMap = new Map();
|
|
44
|
-
const isAdvance = y_axis_summary_type ===
|
|
37
|
+
const isAdvance = y_axis_summary_type === SUMMARY_TYPE.ADVANCED;
|
|
45
38
|
statRows.forEach(row => {
|
|
46
39
|
const {
|
|
47
40
|
_id: rowId
|
|
@@ -50,11 +43,11 @@ function calculateChart(chart, value, username, userId) {
|
|
|
50
43
|
const formulaRow = formulaRows[rowId];
|
|
51
44
|
if (!cellValue) return;
|
|
52
45
|
if (cellValue >= x_axis_date_range_start && cellValue <= x_axis_date_range_end || cellValue >= x_axis_compared_date_range_start && cellValue <= x_axis_compared_date_range_end) {
|
|
53
|
-
const name =
|
|
46
|
+
const name = StatUtils.getGroupLabel(cellValue, formulaRow, groupbyColumn, x_axis_date_granularity, '', value);
|
|
54
47
|
if (cellValue >= x_axis_date_range_start && cellValue <= x_axis_date_range_end) {
|
|
55
48
|
if (isAdvance) {
|
|
56
49
|
const currentValue = dateRangeResultMap.get(name);
|
|
57
|
-
const _cellValue =
|
|
50
|
+
const _cellValue = getCellValue(row, formulaRow, summaryColumn);
|
|
58
51
|
if (!currentValue) {
|
|
59
52
|
dateRangeResultMap.set(name, [_cellValue]);
|
|
60
53
|
} else {
|
|
@@ -71,7 +64,7 @@ function calculateChart(chart, value, username, userId) {
|
|
|
71
64
|
} else {
|
|
72
65
|
if (isAdvance) {
|
|
73
66
|
const currentValue = comparedDateRangeResultMap.get(name);
|
|
74
|
-
const _cellValue =
|
|
67
|
+
const _cellValue = getCellValue(row, formulaRow, summaryColumn);
|
|
75
68
|
if (!currentValue && summaryColumn) {
|
|
76
69
|
comparedDateRangeResultMap.set(name, [_cellValue]);
|
|
77
70
|
} else {
|
|
@@ -96,8 +89,8 @@ function calculateChart(chart, value, username, userId) {
|
|
|
96
89
|
let value = item[1];
|
|
97
90
|
let formatted_value = value;
|
|
98
91
|
if (isAdvance) {
|
|
99
|
-
value =
|
|
100
|
-
formatted_value =
|
|
92
|
+
value = getSummaryResult(value, y_axis_summary_method, data.precision);
|
|
93
|
+
formatted_value = StatUtils.getFormattedValue(value, summaryColumn, y_axis_summary_method);
|
|
101
94
|
}
|
|
102
95
|
dateRangeResult.push({
|
|
103
96
|
name: key,
|
|
@@ -107,14 +100,14 @@ function calculateChart(chart, value, username, userId) {
|
|
|
107
100
|
formatted_value
|
|
108
101
|
});
|
|
109
102
|
}
|
|
110
|
-
|
|
103
|
+
StatUtils.sortStatistics(dateRangeResult, groupbyColumn, 'name');
|
|
111
104
|
for (let item of comparedDateRangeResultMap) {
|
|
112
105
|
const key = item[0];
|
|
113
106
|
let value = item[1];
|
|
114
107
|
let formatted_value = value;
|
|
115
108
|
if (isAdvance) {
|
|
116
|
-
value =
|
|
117
|
-
formatted_value =
|
|
109
|
+
value = getSummaryResult(value, y_axis_summary_method, data.precision);
|
|
110
|
+
formatted_value = StatUtils.getFormattedValue(value, summaryColumn, y_axis_summary_method);
|
|
118
111
|
}
|
|
119
112
|
comparedDateRangeResult.push({
|
|
120
113
|
name: key,
|
|
@@ -124,7 +117,7 @@ function calculateChart(chart, value, username, userId) {
|
|
|
124
117
|
formatted_value
|
|
125
118
|
});
|
|
126
119
|
}
|
|
127
|
-
|
|
120
|
+
StatUtils.sortStatistics(comparedDateRangeResult, groupbyColumn, 'name');
|
|
128
121
|
for (let i = 0; i < dateRangeResult.length; i++) {
|
|
129
122
|
if (!comparedDateRangeResult[i]) break;
|
|
130
123
|
comparedDateRangeResult[i].name = dateRangeResult[i].name;
|
|
@@ -143,4 +136,4 @@ function calculateChart(chart, value, username, userId) {
|
|
|
143
136
|
}
|
|
144
137
|
return [...comparedDateRangeResult, ...dateRangeResult];
|
|
145
138
|
}
|
|
146
|
-
|
|
139
|
+
export default calculateChart;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _dtableStore = require("dtable-store");
|
|
9
|
-
var _commonUtils = require("../../utils/common-utils");
|
|
10
|
-
var _rowUtils = require("../../utils/row-utils");
|
|
11
|
-
var _statUtils = _interopRequireDefault(require("../../utils/stat-utils"));
|
|
12
|
-
var _constants = require("../../constants");
|
|
1
|
+
import { FORMULA_COLUMN_TYPES_MAP, isNumber, TableUtils, Views } from 'dtable-store';
|
|
2
|
+
import { isArrayCellValue } from '../../utils/common-utils';
|
|
3
|
+
import { getCellValue, getFormattedLabel } from '../../utils/row-utils';
|
|
4
|
+
import StatUtils from '../../utils/stat-utils';
|
|
5
|
+
import { PIE_CHART_COLORS } from '../../constants';
|
|
13
6
|
function calculateResult(chart, value, username, userId) {
|
|
14
7
|
const {
|
|
15
8
|
table_id,
|
|
@@ -21,17 +14,17 @@ function calculateResult(chart, value, username, userId) {
|
|
|
21
14
|
date_granularity,
|
|
22
15
|
geolocation_granularity
|
|
23
16
|
} = chart;
|
|
24
|
-
const table =
|
|
25
|
-
const view = table &&
|
|
17
|
+
const table = TableUtils.getTableById(value.tables, table_id);
|
|
18
|
+
const view = table && Views.getViewById(table.views, view_id);
|
|
26
19
|
if (!view) {
|
|
27
20
|
return [];
|
|
28
21
|
}
|
|
29
|
-
const nameColumn =
|
|
22
|
+
const nameColumn = TableUtils.getTableColumnByKey(table, name_column);
|
|
30
23
|
if (!nameColumn) return [];
|
|
31
|
-
const statRows =
|
|
32
|
-
const formulaRows =
|
|
33
|
-
const groupColumn =
|
|
34
|
-
const isColumnDataAsAnArray =
|
|
24
|
+
const statRows = Views.getViewRows(view, table, value, username, userId);
|
|
25
|
+
const formulaRows = Views.getTableFormulaResults(table, statRows, value);
|
|
26
|
+
const groupColumn = TableUtils.getTableColumnByKey(table, group_column);
|
|
27
|
+
const isColumnDataAsAnArray = isArrayCellValue(nameColumn);
|
|
35
28
|
const isGroupChart = !!groupColumn;
|
|
36
29
|
let result = [];
|
|
37
30
|
if (!isGroupChart) {
|
|
@@ -43,18 +36,18 @@ function calculateResult(chart, value, username, userId) {
|
|
|
43
36
|
let formulaRow = formulaRows[rowId] || {};
|
|
44
37
|
const name = row[nameColumn.key];
|
|
45
38
|
if (name || Number.isFinite(name)) {
|
|
46
|
-
let label =
|
|
39
|
+
let label = StatUtils.getGroupLabel(name, formulaRow, nameColumn, '', '', value);
|
|
47
40
|
if (isColumnDataAsAnArray) {
|
|
48
41
|
label = label[0];
|
|
49
42
|
}
|
|
50
|
-
label =
|
|
43
|
+
label = getFormattedLabel(nameColumn, label, value.collaborators);
|
|
51
44
|
if (!memo.get(label)) {
|
|
52
|
-
const completedColumn =
|
|
53
|
-
const targetColumn =
|
|
54
|
-
let currentValue =
|
|
55
|
-
let targetValue =
|
|
56
|
-
currentValue =
|
|
57
|
-
targetValue =
|
|
45
|
+
const completedColumn = TableUtils.getTableColumnByKey(table, completed_column);
|
|
46
|
+
const targetColumn = TableUtils.getTableColumnByKey(table, target_column);
|
|
47
|
+
let currentValue = getCellValue(row, formulaRow, completedColumn);
|
|
48
|
+
let targetValue = getCellValue(row, formulaRow, targetColumn);
|
|
49
|
+
currentValue = isNumber(currentValue) ? currentValue : 0;
|
|
50
|
+
targetValue = isNumber(targetValue) ? targetValue : 0;
|
|
58
51
|
if (currentValue >= targetValue) {
|
|
59
52
|
result.unshift({
|
|
60
53
|
name: label,
|
|
@@ -86,8 +79,8 @@ function calculateResult(chart, value, username, userId) {
|
|
|
86
79
|
const memo = new Map();
|
|
87
80
|
const colorMap = {};
|
|
88
81
|
let colorIndex = 0;
|
|
89
|
-
let isFormulaType =
|
|
90
|
-
const isGroupColumnDataAsAnArray =
|
|
82
|
+
let isFormulaType = FORMULA_COLUMN_TYPES_MAP[groupColumn.type];
|
|
83
|
+
const isGroupColumnDataAsAnArray = isArrayCellValue(groupColumn);
|
|
91
84
|
statRows.forEach(row => {
|
|
92
85
|
let {
|
|
93
86
|
_id: rowId
|
|
@@ -96,30 +89,30 @@ function calculateResult(chart, value, username, userId) {
|
|
|
96
89
|
const name = row[nameColumn.key],
|
|
97
90
|
groupLabelName = !isFormulaType ? row[groupColumn.key] : formulaRow[rowId][groupColumn.key];
|
|
98
91
|
if ((name || Number.isFinite(name)) && (groupLabelName || Number.isFinite(groupLabelName))) {
|
|
99
|
-
let label =
|
|
100
|
-
groupLabel =
|
|
92
|
+
let label = StatUtils.getGroupLabel(name, formulaRow, nameColumn, '', '', value),
|
|
93
|
+
groupLabel = StatUtils.getGroupLabel(groupLabelName, formulaRow, groupColumn, date_granularity, geolocation_granularity, value);
|
|
101
94
|
if (isColumnDataAsAnArray) {
|
|
102
95
|
label = label[0];
|
|
103
96
|
}
|
|
104
97
|
if (isGroupColumnDataAsAnArray) {
|
|
105
98
|
groupLabel = groupLabel[0];
|
|
106
99
|
}
|
|
107
|
-
label =
|
|
108
|
-
groupLabel =
|
|
100
|
+
label = getFormattedLabel(nameColumn, label, value.collaborators);
|
|
101
|
+
groupLabel = getFormattedLabel(groupColumn, groupLabel, value.collaborators);
|
|
109
102
|
let color = colorMap[groupLabel];
|
|
110
103
|
if (!color) {
|
|
111
|
-
color =
|
|
104
|
+
color = PIE_CHART_COLORS[colorIndex % 12];
|
|
112
105
|
colorMap[groupLabel] = color;
|
|
113
106
|
colorIndex++;
|
|
114
107
|
}
|
|
115
108
|
let cache = memo.get(label);
|
|
116
109
|
if (groupLabel && (!cache || !cache[groupLabel])) {
|
|
117
|
-
const completedColumn =
|
|
118
|
-
const targetColumn =
|
|
119
|
-
let currentValue =
|
|
120
|
-
let targetValue =
|
|
121
|
-
currentValue =
|
|
122
|
-
targetValue =
|
|
110
|
+
const completedColumn = TableUtils.getTableColumnByKey(table, completed_column);
|
|
111
|
+
const targetColumn = TableUtils.getTableColumnByKey(table, target_column);
|
|
112
|
+
let currentValue = getCellValue(row, formulaRow, completedColumn);
|
|
113
|
+
let targetValue = getCellValue(row, formulaRow, targetColumn);
|
|
114
|
+
currentValue = isNumber(currentValue) ? currentValue : 0;
|
|
115
|
+
targetValue = isNumber(targetValue) ? targetValue : 0;
|
|
123
116
|
if (currentValue >= targetValue) {
|
|
124
117
|
result.unshift({
|
|
125
118
|
name: label,
|
|
@@ -164,4 +157,4 @@ function calculateResult(chart, value, username, userId) {
|
|
|
164
157
|
}
|
|
165
158
|
return result;
|
|
166
159
|
}
|
|
167
|
-
|
|
160
|
+
export default calculateResult;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _dtableStore = require("dtable-store");
|
|
8
|
-
var _commonUtils = require("../../utils/common-utils");
|
|
9
|
-
var _rowUtils = require("../../utils/row-utils");
|
|
1
|
+
import { isNumber, isNumericColumn, TableUtils, Views } from 'dtable-store';
|
|
2
|
+
import { getSummaryResult } from '../../utils/common-utils';
|
|
3
|
+
import { getCellValue } from '../../utils/row-utils';
|
|
10
4
|
function calculateResult(chart, value, username, userId) {
|
|
11
5
|
const {
|
|
12
6
|
table_id,
|
|
@@ -16,17 +10,17 @@ function calculateResult(chart, value, username, userId) {
|
|
|
16
10
|
total_value_column,
|
|
17
11
|
total_value_column_summary_method
|
|
18
12
|
} = chart;
|
|
19
|
-
const selectedTable =
|
|
20
|
-
const selectedView = selectedTable &&
|
|
21
|
-
const selectedColumn1 =
|
|
22
|
-
const selectedColumn2 =
|
|
23
|
-
const statRows =
|
|
13
|
+
const selectedTable = TableUtils.getTableById(value.tables, table_id);
|
|
14
|
+
const selectedView = selectedTable && Views.getViewById(selectedTable.views, view_id);
|
|
15
|
+
const selectedColumn1 = TableUtils.getTableColumnByKey(selectedTable, target_value_column);
|
|
16
|
+
const selectedColumn2 = TableUtils.getTableColumnByKey(selectedTable, total_value_column);
|
|
17
|
+
const statRows = Views.getViewRows(selectedView, selectedTable, value, username, userId);
|
|
24
18
|
if (statRows.length === 0) {
|
|
25
19
|
return 0;
|
|
26
20
|
}
|
|
27
|
-
const isNumericColumn1 = selectedColumn1 &&
|
|
28
|
-
const isNumericColumn2 = selectedColumn2 &&
|
|
29
|
-
const formulaRows = isNumericColumn1 || isNumericColumn2 ?
|
|
21
|
+
const isNumericColumn1 = selectedColumn1 && isNumericColumn(selectedColumn1);
|
|
22
|
+
const isNumericColumn2 = selectedColumn2 && isNumericColumn(selectedColumn2);
|
|
23
|
+
const formulaRows = isNumericColumn1 || isNumericColumn2 ? Views.getTableFormulaResults(selectedTable, statRows, value) : {};
|
|
30
24
|
let result1;
|
|
31
25
|
let result2;
|
|
32
26
|
let numberList1 = [];
|
|
@@ -34,14 +28,14 @@ function calculateResult(chart, value, username, userId) {
|
|
|
34
28
|
statRows.forEach(row => {
|
|
35
29
|
const formulaRow = formulaRows[row._id];
|
|
36
30
|
if (isNumericColumn1) {
|
|
37
|
-
const cellValue1 =
|
|
38
|
-
if (
|
|
31
|
+
const cellValue1 = getCellValue(row, formulaRow, selectedColumn1);
|
|
32
|
+
if (isNumber(cellValue1)) {
|
|
39
33
|
numberList1.push(cellValue1);
|
|
40
34
|
}
|
|
41
35
|
}
|
|
42
36
|
if (isNumericColumn2) {
|
|
43
|
-
const cellValue2 =
|
|
44
|
-
if (
|
|
37
|
+
const cellValue2 = getCellValue(row, formulaRow, selectedColumn2);
|
|
38
|
+
if (isNumber(cellValue2)) {
|
|
45
39
|
numberList2.push(cellValue2);
|
|
46
40
|
}
|
|
47
41
|
}
|
|
@@ -49,16 +43,16 @@ function calculateResult(chart, value, username, userId) {
|
|
|
49
43
|
if (target_value_column_summary_method === 'Row_count') {
|
|
50
44
|
result1 = statRows.length;
|
|
51
45
|
} else {
|
|
52
|
-
result1 =
|
|
46
|
+
result1 = getSummaryResult(numberList1, target_value_column_summary_method);
|
|
53
47
|
}
|
|
54
48
|
if (total_value_column_summary_method === 'Row_count') {
|
|
55
49
|
result2 = statRows.length;
|
|
56
50
|
} else {
|
|
57
|
-
result2 =
|
|
51
|
+
result2 = getSummaryResult(numberList2, total_value_column_summary_method);
|
|
58
52
|
}
|
|
59
53
|
if (result2 === 0) {
|
|
60
54
|
return 0;
|
|
61
55
|
}
|
|
62
56
|
return result1 / result2;
|
|
63
57
|
}
|
|
64
|
-
|
|
58
|
+
export default calculateResult;
|