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.
Files changed (222) hide show
  1. package/es/api/dtable-db-api.js +3 -10
  2. package/es/calculator/base-calculator.js +12 -20
  3. package/es/calculator/basic-chart-calculator.js +65 -72
  4. package/es/calculator/combination-calculator.js +57 -64
  5. package/es/calculator/compare-bar-calculator.js +26 -33
  6. package/es/calculator/completeness-calculator.js +30 -37
  7. package/es/calculator/copy-value.js +1 -7
  8. package/es/calculator/dashboard-calculator.js +13 -20
  9. package/es/calculator/heat-map-calculator.js +18 -25
  10. package/es/calculator/horizontal-bar-calculator.js +8 -15
  11. package/es/calculator/index.js +35 -42
  12. package/es/calculator/map-calculator.js +22 -29
  13. package/es/calculator/mirror-calculator.js +20 -27
  14. package/es/calculator/number-card-calculator.js +10 -17
  15. package/es/calculator/pivot-table-calculator.js +58 -65
  16. package/es/calculator/scatter-calculator.js +14 -21
  17. package/es/calculator/thread-manager.js +1 -7
  18. package/es/calculator/trend-calculator.js +22 -29
  19. package/es/calculator/workers/basic-chart-calculator-worker.js +76 -83
  20. package/es/calculator/workers/calculator.worker.js +30 -33
  21. package/es/calculator/workers/card-calculator-worker.js +13 -19
  22. package/es/calculator/workers/combination-calculator-worker.js +46 -53
  23. package/es/calculator/workers/compare-bar-chart-calculator-worker.js +22 -29
  24. package/es/calculator/workers/completeness-calculator-worker.js +34 -41
  25. package/es/calculator/workers/dashboard-calculator-worker.js +18 -24
  26. package/es/calculator/workers/mirror-calculator-worker.js +22 -29
  27. package/es/calculator/workers/pivot-table-calculator-worker.js +77 -84
  28. package/es/calculator/workers/scatter-calculator-worker.js +20 -27
  29. package/es/calculator/workers/trend-calculator-worker.js +27 -34
  30. package/es/calculator/world-map-calculator.js +17 -24
  31. package/es/components/common-add-tool.js +5 -12
  32. package/es/components/dialog/chart-addition-edit-dialog.js +12 -20
  33. package/es/components/dialog/chart-addition-widgets/chart-selector.js +101 -108
  34. package/es/components/dialog/color-theme-dialog.js +15 -22
  35. package/es/components/dialog/delete-confirmation-dialog.js +11 -18
  36. package/es/components/dialog/enlarged-chart-dialog.js +20 -28
  37. package/es/components/dialog/new-table-dialog.js +16 -23
  38. package/es/components/dialog/new-view-dialog.js +14 -21
  39. package/es/components/dialog/rename-view-dialog.js +14 -22
  40. package/es/components/dialog/statistic-record-dialog/index.js +37 -45
  41. package/es/components/dialog/statistic-types-dialog/index.js +14 -22
  42. package/es/components/dialog/table-select-dialog.js +15 -23
  43. package/es/components/dropdown-menu/statistic-dropdown-menu.js +41 -49
  44. package/es/components/dtable-popover.js +12 -19
  45. package/es/components/dtable-search-input.js +13 -21
  46. package/es/components/dtable-select.js +15 -21
  47. package/es/components/icon.js +4 -11
  48. package/es/components/index.js +11 -76
  49. package/es/components/loading.js +3 -10
  50. package/es/components/modal-portal.js +5 -12
  51. package/es/components/popover/color-rules/color-rule.js +25 -33
  52. package/es/components/popover/color-rules/index.js +6 -14
  53. package/es/components/popover/color-rules/rule-filters/filter.js +27 -34
  54. package/es/components/popover/color-rules/rule-filters/index.js +17 -25
  55. package/es/components/popover/color-rules/rule-filters/number-input.js +9 -17
  56. package/es/components/popover/color-rules-popover.js +24 -32
  57. package/es/components/popover/color-selector-popover.js +10 -17
  58. package/es/components/seatable-radio/index.js +9 -16
  59. package/es/components/select/index.js +2 -9
  60. package/es/components/select/option-group.js +19 -27
  61. package/es/components/select/option.js +6 -14
  62. package/es/components/select/select.js +17 -25
  63. package/es/components/toast/alert.js +24 -31
  64. package/es/components/toast/index.js +3 -10
  65. package/es/components/toast/toast.js +12 -20
  66. package/es/components/toast/toastManager.js +9 -17
  67. package/es/components/toast/toaster.js +6 -14
  68. package/es/constants/color-rules.js +6 -12
  69. package/es/constants/dtable-select-style.js +4 -9
  70. package/es/constants/event-types.js +4 -10
  71. package/es/constants/index.js +67 -96
  72. package/es/constants/key-codes.js +0 -2
  73. package/es/constants/map.js +2 -8
  74. package/es/constants/model.js +20 -26
  75. package/es/constants/regions.js +3 -8
  76. package/es/constants/zIndexes.js +1 -7
  77. package/es/custom-g2.js +208 -236
  78. package/es/dashboard.js +50 -58
  79. package/es/desktop-dashboard.js +47 -55
  80. package/es/index.js +3 -6
  81. package/es/locale/index.js +10 -13
  82. package/es/locale/lang/de.js +1 -7
  83. package/es/locale/lang/en.js +1 -7
  84. package/es/locale/lang/fr.js +1 -7
  85. package/es/locale/lang/zh_CN.js +1 -7
  86. package/es/mobile-dashboard.js +38 -46
  87. package/es/model/bar-group.js +11 -19
  88. package/es/model/bar.js +10 -18
  89. package/es/model/base-model.js +2 -9
  90. package/es/model/basic-number-card.js +8 -16
  91. package/es/model/collaborators.js +2 -9
  92. package/es/model/combination.js +12 -20
  93. package/es/model/compare-bar.js +16 -24
  94. package/es/model/completeness-group.js +8 -16
  95. package/es/model/completeness.js +5 -13
  96. package/es/model/custom-bar.js +6 -14
  97. package/es/model/dashboard.js +6 -14
  98. package/es/model/generic-model.js +133 -141
  99. package/es/model/heat-map.js +11 -19
  100. package/es/model/horizontal-bar-group.js +10 -18
  101. package/es/model/horizontal-bar.js +10 -18
  102. package/es/model/index.js +53 -185
  103. package/es/model/map.js +15 -23
  104. package/es/model/mirror.js +13 -21
  105. package/es/model/pie.js +10 -18
  106. package/es/model/ring.js +11 -19
  107. package/es/model/scatter.js +6 -14
  108. package/es/model/statistic-dashboard.js +2 -9
  109. package/es/model/table.js +10 -18
  110. package/es/model/trend.js +12 -20
  111. package/es/model/world-map.js +13 -21
  112. package/es/service/chart-service.js +7 -14
  113. package/es/service/dashboard-service.js +34 -41
  114. package/es/service/map-json.js +8 -14
  115. package/es/stat-editor/chart-name-editor.js +8 -15
  116. package/es/stat-editor/index.js +16 -24
  117. package/es/stat-editor/stat-settings/advance-chart-settings/basic-number-card-settings.js +21 -29
  118. package/es/stat-editor/stat-settings/advance-chart-settings/combination-settings.js +49 -57
  119. package/es/stat-editor/stat-settings/advance-chart-settings/dashboard-chart-settings.js +23 -31
  120. package/es/stat-editor/stat-settings/advance-chart-settings/geo-granularity-settings.js +4 -11
  121. package/es/stat-editor/stat-settings/advance-chart-settings/heat-map-settings.js +19 -27
  122. package/es/stat-editor/stat-settings/advance-chart-settings/index.js +43 -51
  123. package/es/stat-editor/stat-settings/advance-chart-settings/map-settings.js +23 -31
  124. package/es/stat-editor/stat-settings/advance-chart-settings/mirror-settings.js +23 -31
  125. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/combination-style-setting.js +37 -45
  126. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/heat-map-settings.js +19 -27
  127. package/es/stat-editor/stat-settings/advance-chart-settings/style-setting/map-setting.js +26 -34
  128. package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +47 -55
  129. package/es/stat-editor/stat-settings/advance-chart-settings/trend-chart-settings.js +22 -30
  130. package/es/stat-editor/stat-settings/advance-chart-settings/world-map-settings.js +18 -26
  131. package/es/stat-editor/stat-settings/basic-chart-settings/advance-bar-chart-settings.js +27 -35
  132. package/es/stat-editor/stat-settings/basic-chart-settings/bar-settings.js +24 -32
  133. package/es/stat-editor/stat-settings/basic-chart-settings/completeness-chart-settings.js +33 -41
  134. package/es/stat-editor/stat-settings/basic-chart-settings/custom-bar-settings.js +22 -30
  135. package/es/stat-editor/stat-settings/basic-chart-settings/groupby-settings.js +27 -26
  136. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-axis-group-settings.js +46 -54
  137. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-bar-settings.js +23 -31
  138. package/es/stat-editor/stat-settings/basic-chart-settings/horizontal-group-chart-settings.js +26 -34
  139. package/es/stat-editor/stat-settings/basic-chart-settings/index.js +77 -85
  140. package/es/stat-editor/stat-settings/basic-chart-settings/pie-settings.js +21 -29
  141. package/es/stat-editor/stat-settings/basic-chart-settings/pivot-table-settings.js +73 -81
  142. package/es/stat-editor/stat-settings/basic-chart-settings/scatter-settings.js +16 -24
  143. package/es/stat-editor/stat-settings/basic-chart-settings/stack-item-settings.js +19 -27
  144. package/es/stat-editor/stat-settings/basic-chart-settings/stacks-settings.js +18 -26
  145. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/bar-chart-style-setting.js +49 -57
  146. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/completeness-style.js +17 -25
  147. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +47 -55
  148. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/label-font-size-editor.js +11 -19
  149. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/pie-chart-style-settings.js +45 -53
  150. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/time-compare-style.js +9 -17
  151. package/es/stat-editor/stat-settings/basic-chart-settings/summary-method-setting.js +20 -28
  152. package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +30 -38
  153. package/es/stat-editor/stat-settings/basic-chart-settings/time-comparison-settings.js +50 -58
  154. package/es/stat-editor/stat-settings/basic-chart-settings/timer-picker.js +17 -25
  155. package/es/stat-editor/stat-settings/basic-chart-settings/y-axis-group-settings.js +47 -55
  156. package/es/stat-editor/stat-settings/color-setting/color-group-selector.js +11 -19
  157. package/es/stat-editor/stat-settings/color-setting/color-picker.js +12 -19
  158. package/es/stat-editor/stat-settings/color-setting/color-use-type-selector.js +62 -70
  159. package/es/stat-editor/stat-settings/map/map-level.js +13 -20
  160. package/es/stat-editor/stat-settings/map/map-province-city.js +20 -27
  161. package/es/stat-editor/stat-settings/public-setting/axis-label-position-setting.js +11 -19
  162. package/es/stat-editor/stat-settings/public-setting/base-settings.js +20 -28
  163. package/es/stat-editor/stat-settings/public-setting/calender.js +22 -29
  164. package/es/stat-editor/stat-settings/public-setting/column-settings.js +6 -13
  165. package/es/stat-editor/stat-settings/public-setting/custom-title-setting.js +9 -16
  166. package/es/stat-editor/stat-settings/public-setting/data-sort-setting.js +13 -21
  167. package/es/stat-editor/stat-settings/public-setting/ind-toggle-setting.js +8 -15
  168. package/es/stat-editor/stat-settings/public-setting/min-max-setting.js +11 -19
  169. package/es/stat-editor/stat-settings/public-setting/numeric-summary-item.js +27 -35
  170. package/es/stat-editor/stat-settings/public-setting/toggle-setting.js +8 -15
  171. package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +18 -26
  172. package/es/stat-list/chart-preview.js +20 -28
  173. package/es/stat-list/index.js +27 -35
  174. package/es/stat-view/area-chart.js +43 -50
  175. package/es/stat-view/bar-chart.js +47 -54
  176. package/es/stat-view/base-chart.js +24 -32
  177. package/es/stat-view/basic-number-card.js +19 -26
  178. package/es/stat-view/combination-chart.js +49 -56
  179. package/es/stat-view/compare-chart.js +39 -46
  180. package/es/stat-view/completeness-chart.js +28 -35
  181. package/es/stat-view/custom-bar.js +31 -38
  182. package/es/stat-view/dashboard-chart.js +15 -22
  183. package/es/stat-view/heat-map.js +43 -50
  184. package/es/stat-view/horizontal-bar-chart.js +51 -58
  185. package/es/stat-view/index.js +73 -80
  186. package/es/stat-view/line-chart.js +39 -46
  187. package/es/stat-view/map.js +33 -40
  188. package/es/stat-view/mirror.js +21 -28
  189. package/es/stat-view/pie-chart.js +29 -36
  190. package/es/stat-view/pivot-table/index.js +32 -39
  191. package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +31 -39
  192. package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +29 -37
  193. package/es/stat-view/pivot-table/pivot-table-display-name.js +46 -54
  194. package/es/stat-view/pivot-table/two-dimension-table.js +62 -70
  195. package/es/stat-view/ring-chart.js +38 -45
  196. package/es/stat-view/scatter-chart.js +30 -37
  197. package/es/stat-view/treemap-chart.js +37 -44
  198. package/es/stat-view/trend-chart.js +32 -39
  199. package/es/stat-view/world-map.js +33 -40
  200. package/es/tabs/index.js +32 -40
  201. package/es/tabs/tab.js +26 -34
  202. package/es/utils/basic-chart-utils.js +2 -9
  203. package/es/utils/cell-format.js +14 -22
  204. package/es/utils/cell-value.js +7 -14
  205. package/es/utils/collaborator.js +4 -13
  206. package/es/utils/color-utils.js +18 -29
  207. package/es/utils/column-utils.js +18 -29
  208. package/es/utils/column.js +4 -11
  209. package/es/utils/common-utils.js +41 -65
  210. package/es/utils/date-format.js +2 -8
  211. package/es/utils/export-table-utils.js +82 -91
  212. package/es/utils/index.js +11 -100
  213. package/es/utils/map.js +26 -36
  214. package/es/utils/model.js +6 -14
  215. package/es/utils/object.js +6 -15
  216. package/es/utils/pivot-table.js +16 -23
  217. package/es/utils/row-utils.js +23 -33
  218. package/es/utils/search.js +21 -29
  219. package/es/utils/sql-utils.js +65 -75
  220. package/es/utils/stat-utils.js +60 -66
  221. package/es/utils/trend-utils.js +32 -40
  222. package/package.json +1 -1
@@ -1,16 +1,9 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
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 = _dtableStore.TableUtils.getTableById(value.tables, table_id);
31
- const view = table && _dtableStore.Views.getViewById(table.views, view_id);
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 = _dtableStore.TableUtils.getTableColumnByKey(table, x_axis_column_key);
28
+ const xAxisColumn = TableUtils.getTableColumnByKey(table, x_axis_column_key);
36
29
  if (!xAxisColumn) return [];
37
- const statRows = _dtableStore.Views.getViewRows(view, table, value, username, userId);
38
- const formulaRows = _dtableStore.Views.getTableFormulaResults(table, statRows, value);
39
- const column1 = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_left_summary_column);
40
- const column2 = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_right_summary_column);
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 = (0, _commonUtils.isArrayCellValue)(xAxisColumn);
36
+ let isColumnDataAsAnArray = isArrayCellValue(xAxisColumn);
44
37
  let leftSummaryColumn = {};
45
38
  let leftSummaryColumnKeys = [];
46
- if (y_axis_left_summary_type === _constants.SUMMARY_TYPE.ADVANCED) {
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: _constants.LABEL_COLORS[0]
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 = _dtableStore.TableUtils.getTableColumnByKey(table, item.column_key);
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: _constants.LABEL_COLORS[(index + 1) % 12]
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 = _statUtils.default.getGroupLabel(currentValue, formulaRow, xAxisColumn, groupby_date_granularity, groupby_geolocation_granularity, value);
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 === _constants.SUMMARY_TYPE.COUNT) {
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 === _constants.SUMMARY_TYPE.ADVANCED) {
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 = (0, _rowUtils.getCellValue)(row, formulaRow, {
102
+ const cellValue = getCellValue(row, formulaRow, {
110
103
  ...leftSummaryColumn[key],
111
104
  key
112
105
  });
113
106
  const currentLabelList = currentLabelMap[key] || [];
114
- if ((0, _dtableStore.isNumber)(cellValue)) {
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 = (0, _rowUtils.getCellValue)(row, formulaRow, {
118
+ const cellValue = getCellValue(row, formulaRow, {
126
119
  ...leftSummaryColumn[key],
127
120
  key
128
121
  });
129
122
  const currentLabelList = currentValue[key] || [];
130
- if ((0, _dtableStore.isNumber)(cellValue)) {
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 = (0, _rowUtils.getCellValue)(row, formulaRow, {
134
+ const cellValue = getCellValue(row, formulaRow, {
142
135
  ...leftSummaryColumn[key],
143
136
  key
144
137
  });
145
138
  const currentList = currentValue[key] || [];
146
- if ((0, _dtableStore.isNumber)(cellValue)) {
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 === _constants.SUMMARY_TYPE.COUNT) {
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 === _constants.SUMMARY_TYPE.ADVANCED) {
180
- const cellValue = (0, _rowUtils.getCellValue)(row, formulaRow, column2);
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 ((0, _dtableStore.isNumber)(cellValue)) {
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 ((0, _dtableStore.isNumber)(cellValue)) {
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 ((0, _dtableStore.isNumber)(cellValue)) {
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 === _constants.SUMMARY_TYPE.ADVANCED) {
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 === _constants.SUMMARY_TYPE.COUNT) {
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 === _constants.SUMMARY_TYPE.ADVANCED) {
229
- value2 = (0, _commonUtils.getSummaryResult)(rightValue, y_axis_right_summary_method);
230
- formattedValueRight = _statUtils.default.getFormattedValue(value2, column2, y_axis_right_summary_method);
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 === _constants.SUMMARY_TYPE.COUNT) {
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 === _constants.SUMMARY_TYPE.ADVANCED) {
230
+ if (y_axis_left_summary_type === SUMMARY_TYPE.ADVANCED) {
238
231
  const list = leftValue[column1.key];
239
- value1 = (0, _commonUtils.getSummaryResult)(list, y_axis_left_summary_method);
240
- formattedValueLeft = _statUtils.default.getFormattedValue(value1, column1, y_axis_left_summary_method);
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 = (0, _commonUtils.getSummaryResult)(list, summaryMethod);
255
- formattedValueLeft = _statUtils.default.getFormattedValue(value, summaryColumn, summaryMethod);
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
- _statUtils.default.sortStatistics(results, xAxisColumn, 'name');
260
+ StatUtils.sortStatistics(results, xAxisColumn, 'name');
268
261
  results.forEach(item => {
269
- item.name = (0, _rowUtils.getFormattedLabel)(xAxisColumn, item.name, value.collaborators);
262
+ item.name = getFormattedLabel(xAxisColumn, item.name, value.collaborators);
270
263
  });
271
264
  return results;
272
265
  }
@@ -1,15 +1,8 @@
1
- "use strict";
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 _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 = _dtableStore.TableUtils.getTableById(value.tables, table_id);
31
- const view = table && _dtableStore.Views.getViewById(table.views, view_id);
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 = _dtableStore.TableUtils.getTableColumnByKey(table, x_axis_column_key);
28
+ const groupbyColumn = TableUtils.getTableColumnByKey(table, x_axis_column_key);
36
29
  if (!groupbyColumn) {
37
30
  return [];
38
31
  }
39
- const summaryColumn = _dtableStore.TableUtils.getTableColumnByKey(table, y_axis_column_key) || {};
40
- const statRows = _dtableStore.Views.getViewRows(view, table, value, username, userId);
41
- const formulaRows = _dtableStore.Views.getTableFormulaResults(table, statRows, value);
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 === _constants.SUMMARY_TYPE.ADVANCED;
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 = _statUtils.default.getGroupLabel(cellValue, formulaRow, groupbyColumn, x_axis_date_granularity, '', value);
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 = (0, _rowUtils.getCellValue)(row, formulaRow, summaryColumn);
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 = (0, _rowUtils.getCellValue)(row, formulaRow, summaryColumn);
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 = (0, _commonUtils.getSummaryResult)(value, y_axis_summary_method, data.precision);
100
- formatted_value = _statUtils.default.getFormattedValue(value, summaryColumn, y_axis_summary_method);
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
- _statUtils.default.sortStatistics(dateRangeResult, groupbyColumn, 'name');
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 = (0, _commonUtils.getSummaryResult)(value, y_axis_summary_method, data.precision);
117
- formatted_value = _statUtils.default.getFormattedValue(value, summaryColumn, y_axis_summary_method);
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
- _statUtils.default.sortStatistics(comparedDateRangeResult, groupbyColumn, 'name');
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
- var _default = exports.default = calculateChart;
139
+ export default calculateChart;
@@ -1,15 +1,8 @@
1
- "use strict";
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 _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 = _dtableStore.TableUtils.getTableById(value.tables, table_id);
25
- const view = table && _dtableStore.Views.getViewById(table.views, view_id);
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 = _dtableStore.TableUtils.getTableColumnByKey(table, name_column);
22
+ const nameColumn = TableUtils.getTableColumnByKey(table, name_column);
30
23
  if (!nameColumn) return [];
31
- const statRows = _dtableStore.Views.getViewRows(view, table, value, username, userId);
32
- const formulaRows = _dtableStore.Views.getTableFormulaResults(table, statRows, value);
33
- const groupColumn = _dtableStore.TableUtils.getTableColumnByKey(table, group_column);
34
- const isColumnDataAsAnArray = (0, _commonUtils.isArrayCellValue)(nameColumn);
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 = _statUtils.default.getGroupLabel(name, formulaRow, nameColumn, '', '', value);
39
+ let label = StatUtils.getGroupLabel(name, formulaRow, nameColumn, '', '', value);
47
40
  if (isColumnDataAsAnArray) {
48
41
  label = label[0];
49
42
  }
50
- label = (0, _rowUtils.getFormattedLabel)(nameColumn, label, value.collaborators);
43
+ label = getFormattedLabel(nameColumn, label, value.collaborators);
51
44
  if (!memo.get(label)) {
52
- const completedColumn = _dtableStore.TableUtils.getTableColumnByKey(table, completed_column);
53
- const targetColumn = _dtableStore.TableUtils.getTableColumnByKey(table, target_column);
54
- let currentValue = (0, _rowUtils.getCellValue)(row, formulaRow, completedColumn);
55
- let targetValue = (0, _rowUtils.getCellValue)(row, formulaRow, targetColumn);
56
- currentValue = (0, _dtableStore.isNumber)(currentValue) ? currentValue : 0;
57
- targetValue = (0, _dtableStore.isNumber)(targetValue) ? targetValue : 0;
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 = _dtableStore.FORMULA_COLUMN_TYPES_MAP[groupColumn.type];
90
- const isGroupColumnDataAsAnArray = (0, _commonUtils.isArrayCellValue)(groupColumn);
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 = _statUtils.default.getGroupLabel(name, formulaRow, nameColumn, '', '', value),
100
- groupLabel = _statUtils.default.getGroupLabel(groupLabelName, formulaRow, groupColumn, date_granularity, geolocation_granularity, value);
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 = (0, _rowUtils.getFormattedLabel)(nameColumn, label, value.collaborators);
108
- groupLabel = (0, _rowUtils.getFormattedLabel)(groupColumn, groupLabel, value.collaborators);
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 = _constants.PIE_CHART_COLORS[colorIndex % 12];
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 = _dtableStore.TableUtils.getTableColumnByKey(table, completed_column);
118
- const targetColumn = _dtableStore.TableUtils.getTableColumnByKey(table, target_column);
119
- let currentValue = (0, _rowUtils.getCellValue)(row, formulaRow, completedColumn);
120
- let targetValue = (0, _rowUtils.getCellValue)(row, formulaRow, targetColumn);
121
- currentValue = (0, _dtableStore.isNumber)(currentValue) ? currentValue : 0;
122
- targetValue = (0, _dtableStore.isNumber)(targetValue) ? targetValue : 0;
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
- var _default = exports.default = calculateResult;
160
+ export default calculateResult;
@@ -1,12 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
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 = _dtableStore.TableUtils.getTableById(value.tables, table_id);
20
- const selectedView = selectedTable && _dtableStore.Views.getViewById(selectedTable.views, view_id);
21
- const selectedColumn1 = _dtableStore.TableUtils.getTableColumnByKey(selectedTable, target_value_column);
22
- const selectedColumn2 = _dtableStore.TableUtils.getTableColumnByKey(selectedTable, total_value_column);
23
- const statRows = _dtableStore.Views.getViewRows(selectedView, selectedTable, value, username, userId);
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 && (0, _dtableStore.isNumericColumn)(selectedColumn1);
28
- const isNumericColumn2 = selectedColumn2 && (0, _dtableStore.isNumericColumn)(selectedColumn2);
29
- const formulaRows = isNumericColumn1 || isNumericColumn2 ? _dtableStore.Views.getTableFormulaResults(selectedTable, statRows, value) : {};
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 = (0, _rowUtils.getCellValue)(row, formulaRow, selectedColumn1);
38
- if ((0, _dtableStore.isNumber)(cellValue1)) {
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 = (0, _rowUtils.getCellValue)(row, formulaRow, selectedColumn2);
44
- if ((0, _dtableStore.isNumber)(cellValue2)) {
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 = (0, _commonUtils.getSummaryResult)(numberList1, target_value_column_summary_method);
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 = (0, _commonUtils.getSummaryResult)(numberList2, total_value_column_summary_method);
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
- var _default = exports.default = calculateResult;
58
+ export default calculateResult;