dtable-statistic 4.0.6 → 4.0.8

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 (67) hide show
  1. package/es/assets/css/dashboard.css +22 -0
  2. package/es/calculator/basic-chart-calculator.js +27 -18
  3. package/es/calculator/combination-calculator.js +34 -9
  4. package/es/calculator/compare-bar-calculator.js +37 -30
  5. package/es/calculator/heat-map-calculator.js +25 -14
  6. package/es/calculator/map-calculator.js +25 -14
  7. package/es/calculator/mirror-calculator.js +29 -14
  8. package/es/calculator/pivot-table-calculator.js +132 -76
  9. package/es/calculator/workers/basic-chart-calculator-worker.js +21 -6
  10. package/es/calculator/workers/combination-calculator-worker.js +20 -5
  11. package/es/calculator/workers/compare-bar-chart-calculator-worker.js +12 -6
  12. package/es/calculator/workers/mirror-calculator-worker.js +15 -6
  13. package/es/calculator/workers/pivot-table-calculator-worker.js +97 -44
  14. package/es/calculator/world-map-calculator.js +25 -14
  15. package/es/components/dialog/enlarged-chart-dialog.js +2 -2
  16. package/es/components/dialog/statistic-record-dialog/index.css +2 -0
  17. package/es/components/dialog/statistic-record-dialog/index.js +80 -52
  18. package/es/constants/index.js +30 -29
  19. package/es/dashboard.js +57 -43
  20. package/es/desktop-dashboard.js +21 -56
  21. package/es/index.js +34 -2
  22. package/es/locale/lang/de.js +7 -3
  23. package/es/locale/lang/en.js +5 -1
  24. package/es/locale/lang/fr.js +7 -3
  25. package/es/locale/lang/zh_CN.js +5 -1
  26. package/es/mobile-dashboard.js +5 -5
  27. package/es/model/horizontal-bar-group.js +2 -0
  28. package/es/stat-editor/stat-settings/advance-chart-settings/index.js +1 -2
  29. package/es/stat-editor/stat-settings/advance-chart-settings/summary-settings.js +1 -1
  30. package/es/stat-editor/stat-settings/basic-chart-settings/style-setting/horizontal-bar-chart-style.js +20 -3
  31. package/es/stat-editor/stat-settings/basic-chart-settings/summary-settings.js +2 -8
  32. package/es/stat-editor/stat-settings/public-setting/type-settings/index.js +23 -2
  33. package/es/stat-list/chart-preview.js +3 -4
  34. package/es/stat-list/index.js +10 -4
  35. package/es/stat-view/area-chart.js +177 -162
  36. package/es/stat-view/bar-chart.js +221 -222
  37. package/es/stat-view/base-chart.js +79 -7
  38. package/es/stat-view/basic-number-card.js +11 -19
  39. package/es/stat-view/combination-chart.js +100 -83
  40. package/es/stat-view/compare-chart.js +133 -144
  41. package/es/stat-view/completeness-chart.js +108 -102
  42. package/es/stat-view/custom-bar.js +79 -99
  43. package/es/stat-view/dashboard-chart.js +57 -57
  44. package/es/stat-view/heat-map.js +13 -32
  45. package/es/stat-view/horizontal-bar-chart.js +200 -230
  46. package/es/stat-view/index.js +2 -2
  47. package/es/stat-view/line-chart.js +162 -158
  48. package/es/stat-view/map.js +26 -40
  49. package/es/stat-view/mirror.js +88 -94
  50. package/es/stat-view/pie-chart.js +11 -39
  51. package/es/stat-view/pivot-table/index.js +4 -16
  52. package/es/stat-view/pivot-table/one-dimension-table-no-numeric-columns.js +36 -23
  53. package/es/stat-view/pivot-table/one-dimension-table-with-numeric-columns.js +11 -5
  54. package/es/stat-view/pivot-table/pivot-table-display-name.js +206 -0
  55. package/es/stat-view/pivot-table/two-dimension-table.js +104 -60
  56. package/es/stat-view/ring-chart.js +24 -42
  57. package/es/stat-view/scatter-chart.js +4 -21
  58. package/es/stat-view/treemap-chart.js +3 -12
  59. package/es/stat-view/trend-chart.js +6 -17
  60. package/es/stat-view/world-map.js +39 -50
  61. package/es/tabs/tab.js +2 -1
  62. package/es/utils/collaborator.js +9 -0
  63. package/es/utils/common-utils.js +24 -6
  64. package/es/utils/index.js +1 -1
  65. package/es/utils/sql-utils.js +10 -9
  66. package/es/utils/stat-utils.js +8 -5
  67. package/package.json +1 -1
@@ -89,14 +89,17 @@ function calculateChart(chart, value, username, userId) {
89
89
  var item = _step.value;
90
90
  var key = item[0];
91
91
  var _value = item[1];
92
+ var formatted_value = _value;
92
93
  if (isAdvance) {
93
94
  _value = getSummaryResult(_value, y_axis_summary_method, data.precision);
95
+ formatted_value = StatUtils.getFormattedValue(_value, summaryColumn, y_axis_summary_method);
94
96
  }
95
97
  dateRangeResult.push({
96
98
  name: key,
97
- value: _value,
98
99
  group_name: groupName1,
99
- raw_name: key
100
+ raw_name: key,
101
+ value: _value,
102
+ formatted_value: formatted_value
100
103
  });
101
104
  }
102
105
  } catch (err) {
@@ -112,14 +115,17 @@ function calculateChart(chart, value, username, userId) {
112
115
  var _item = _step2.value;
113
116
  var _key = _item[0];
114
117
  var _value2 = _item[1];
118
+ var _formatted_value = _value2;
115
119
  if (isAdvance) {
116
120
  _value2 = getSummaryResult(_value2, y_axis_summary_method, data.precision);
121
+ _formatted_value = StatUtils.getFormattedValue(_value2, summaryColumn, y_axis_summary_method);
117
122
  }
118
123
  comparedDateRangeResult.push({
119
124
  name: _key,
120
- value: _value2,
121
125
  group_name: groupName2,
122
- raw_name: _key
126
+ raw_name: _key,
127
+ value: _value2,
128
+ formatted_value: _formatted_value
123
129
  });
124
130
  }
125
131
  } catch (err) {
@@ -132,8 +138,8 @@ function calculateChart(chart, value, username, userId) {
132
138
  if (!comparedDateRangeResult[i]) break;
133
139
  comparedDateRangeResult[i].name = dateRangeResult[i].name;
134
140
  if (display_increase) {
135
- var value1 = dateRangeResult[i].value,
136
- value2 = comparedDateRangeResult[i].value || 0.001;
141
+ var value1 = dateRangeResult[i].value;
142
+ var value2 = comparedDateRangeResult[i].value || 0.001;
137
143
  if (!value2) {
138
144
  comparedDateRangeResult[i].increase_value = 1;
139
145
  } else {
@@ -3,6 +3,7 @@ import { getClientCellValueDisplayString } from '../../utils';
3
3
  import { getSummaryResult } from '../../utils/common-utils';
4
4
  import { getCellValue } from '../../utils/row-utils';
5
5
  import { SUMMARY_TYPE } from '../../constants';
6
+ import StatUtils from '../../utils/stat-utils';
6
7
  function calculateStatItem(chart, dtableValue, username, userId) {
7
8
  var table_id = chart.table_id,
8
9
  view_id = chart.view_id,
@@ -17,6 +18,7 @@ function calculateStatItem(chart, dtableValue, username, userId) {
17
18
  var rows = Views.getViewRows(view, table, dtableValue, username, userId);
18
19
  var formulaRows = Views.getTableFormulaResults(table, rows, dtableValue);
19
20
  var groupColumn = TableUtils.getTableColumnByKey(table, group_column);
21
+ var numericColumn = summary_column && TableUtils.getTableColumnByKey(table, summary_column);
20
22
  var groupItems = getGroupItems(rows, groupColumn);
21
23
  if (groupColumn.length === 0) return;
22
24
  var result = {};
@@ -50,7 +52,6 @@ function calculateStatItem(chart, dtableValue, username, userId) {
50
52
  });
51
53
  });
52
54
  } else {
53
- var numericColumn = TableUtils.getTableColumnByKey(table, summary_column);
54
55
  groupItems.forEach(function (groupItem) {
55
56
  rows.forEach(function (row) {
56
57
  var value = getClientCellValueDisplayString(row, columnItem.type, columnItem.key, {
@@ -79,10 +80,12 @@ function calculateStatItem(chart, dtableValue, username, userId) {
79
80
  }
80
81
  });
81
82
  });
82
- var data = numericColumn.data || {};
83
- result = summaryResult(result, summary_method, data.precision);
83
+ if (numericColumn) {
84
+ var data = numericColumn.data || {};
85
+ result = summaryResult(result, summary_method, data.precision);
86
+ }
84
87
  }
85
- return normalizeResult(result, groupColumn);
88
+ return normalizeResult(result, groupColumn, numericColumn, summary_type, summary_method);
86
89
  }
87
90
  function summaryResult(result, summaryMethod, precision) {
88
91
  var newResult = {};
@@ -95,7 +98,7 @@ function summaryResult(result, summaryMethod, precision) {
95
98
  });
96
99
  return newResult;
97
100
  }
98
- function normalizeResult(result, groupColumn) {
101
+ function normalizeResult(result, groupColumn, summaryColumn, summaryType, summaryMethod) {
99
102
  var data = [];
100
103
  var colorSet = [];
101
104
  Object.keys(result).forEach(function (groupId, index) {
@@ -105,9 +108,15 @@ function normalizeResult(result, groupColumn) {
105
108
  if (!groupItem) return;
106
109
  colorSet[index] = groupItem.color;
107
110
  Object.keys(result[groupId]).forEach(function (name) {
111
+ var value = result[groupId][name];
112
+ var formattedValue = value;
113
+ if (summaryType === SUMMARY_TYPE.ADVANCED) {
114
+ formattedValue = StatUtils.getFormattedValue(value, summaryColumn, summaryMethod);
115
+ }
108
116
  data.push({
109
117
  name: name,
110
- value: result[groupId][name],
118
+ value: value,
119
+ formatted_value: formattedValue,
111
120
  group_name: groupItem.name,
112
121
  color: groupItem.color
113
122
  });
@@ -1,7 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import { FORMULA_COLUMN_TYPES_MAP, isNumber, TableUtils, Views, isDateColumn, isNumericColumn } from 'dtable-store';
4
- import { SUMMARY_TYPE } from '../../constants';
4
+ import { SUMMARY_METHOD_MAP, SUMMARY_TYPE } from '../../constants';
5
5
  import { isArrayCellValue } from '../../utils/common-utils';
6
6
  import { getFormattedLabel, isValidRow } from '../../utils/row-utils';
7
7
  import StatUtils from '../../utils/stat-utils';
@@ -73,15 +73,15 @@ function calculateOneDimensionTable(chart, value, username, userId) {
73
73
  var column = TableUtils.getTableColumnByKey(table, key);
74
74
  return column ? _objectSpread({}, column) : null;
75
75
  }).filter(Boolean);
76
- if (statisticColumns.length > 1) {
76
+ if (statisticColumns.length > 0) {
77
77
  statisticColumns[0].method = summary_method;
78
- Array.isArray(summary_columns_option) && summary_columns_option.forEach(function (option, index) {
79
- if (statisticColumns[index + 1]) {
80
- statisticColumns[index + 1].method = option.method;
81
- }
82
- });
83
78
  }
84
- var _getOneDimensionTotal = getOneDimensionTotal(statisticColumns, summary_type, summary_method, formulaRows, pivot_rows),
79
+ Array.isArray(summary_columns_option) && summary_columns_option.forEach(function (option, index) {
80
+ if (statisticColumns[index + 1]) {
81
+ statisticColumns[index + 1].method = option.method;
82
+ }
83
+ });
84
+ var _getOneDimensionTotal = getOneDimensionTotal(statisticColumns, summary_type, formulaRows, pivot_rows),
85
85
  pivot_columns_total = _getOneDimensionTotal.pivot_columns_total;
86
86
  StatUtils.sortStatistics(pivot_rows, column, 'name');
87
87
  var pivot_columns = summary_type === SUMMARY_TYPE.COUNT ? [] : statisticColumns.map(function (column) {
@@ -93,6 +93,7 @@ function calculateOneDimensionTable(chart, value, username, userId) {
93
93
  return TableUtils.getTableColumnByKey(table, item.key);
94
94
  });
95
95
  pivot_rows.forEach(function (row) {
96
+ row.original_name = row.name;
96
97
  row.name = getFormattedLabel(column, row.name, value.collaborators);
97
98
  });
98
99
  return {
@@ -109,13 +110,14 @@ function updateOneDimensionRows(pivot_rows, index, name, row) {
109
110
  } else {
110
111
  var _updatedPivotRow = {
111
112
  name: name,
113
+ original_name: name,
112
114
  rows: [row]
113
115
  };
114
116
  pivot_rows.push(_updatedPivotRow);
115
117
  }
116
118
  }
117
- function getOneDimensionTotal(columns, summary_type, summary_method, formula_rows) {
118
- var statResult = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
119
+ function getOneDimensionTotal(columns, summary_type, formula_rows) {
120
+ var statResult = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
119
121
  var pivot_columns_total = {};
120
122
  var dateColumnsTotalArr = {};
121
123
  if (Array.isArray(columns) && columns.length > 0) {
@@ -136,44 +138,60 @@ function getOneDimensionTotal(columns, summary_type, summary_method, formula_row
136
138
  if (Array.isArray(columns)) {
137
139
  if (columns.length === 1) {
138
140
  var summaryColumn = columns[0];
139
- var key = summaryColumn.key;
140
- var total = getTotal(summaryColumn, summary_type, summary_method, rows, formula_rows);
141
+ var key = summaryColumn.key,
142
+ method = summaryColumn.method;
143
+ var total = getTotal(summaryColumn, summary_type, method, rows, formula_rows);
141
144
  if (summaryColumn && isDateColumn(summaryColumn)) {
142
- totalMap['total'] = total === 0 ? 0 : total.date;
143
- if (total != 0) {
144
- dateColumnsTotalArr[key].push(total);
145
+ if (method === SUMMARY_METHOD_MAP.Distinct_values) {
146
+ totalMap['total'] = total;
147
+ } else {
148
+ totalMap['total'] = total === 0 ? 0 : total.date;
149
+ if (total !== 0) {
150
+ dateColumnsTotalArr[key].push(total);
151
+ }
145
152
  }
146
- if (summary_method === 'Max') {
147
- pivot_columns_total['total'] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], 'Max').date;
148
- } else if (summary_method === 'Min') {
149
- pivot_columns_total['total'] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], 'Min').date;
153
+ if (method === SUMMARY_METHOD_MAP.Max) {
154
+ pivot_columns_total['total'] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], SUMMARY_METHOD_MAP.Max).date;
155
+ } else if (method === SUMMARY_METHOD_MAP.Min) {
156
+ pivot_columns_total['total'] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], SUMMARY_METHOD_MAP.Min).date;
157
+ } else if (method === SUMMARY_METHOD_MAP.Distinct_values) {
158
+ var pivotColumnTotal = (pivot_columns_total['total'] ? pivot_columns_total['total'] - 0 : 0) + total;
159
+ pivot_columns_total['total'] = Number.parseFloat(pivotColumnTotal.toFixed(8));
150
160
  }
151
161
  } else {
152
162
  var validTotal = total ? total - 0 : 0;
153
163
  totalMap['total'] = validTotal;
154
- var pivotColumnTotal = (pivot_columns_total['total'] ? pivot_columns_total['total'] - 0 : 0) + validTotal;
155
- pivot_columns_total['total'] = Number.parseFloat(pivotColumnTotal.toFixed(8));
164
+ var _pivotColumnTotal = (pivot_columns_total['total'] ? pivot_columns_total['total'] - 0 : 0) + validTotal;
165
+ pivot_columns_total['total'] = Number.parseFloat(_pivotColumnTotal.toFixed(8));
156
166
  }
157
167
  } else {
158
168
  columns.forEach(function (column) {
159
169
  var key = column.key,
160
170
  method = column.method;
171
+ var totalKey = key + method;
161
172
  var total = getTotal(column, summary_type, method, rows, formula_rows);
162
173
  if (column && isDateColumn(column)) {
163
- totalMap[key + method] = total === 0 ? 0 : total.date;
164
- if (total != 0) {
165
- dateColumnsTotalArr[key].push(total);
174
+ if (method === SUMMARY_METHOD_MAP.Distinct_values) {
175
+ totalMap[totalKey] = total;
176
+ } else {
177
+ totalMap[totalKey] = total === 0 ? 0 : total.date;
178
+ if (total !== 0) {
179
+ dateColumnsTotalArr[key].push(total);
180
+ }
166
181
  }
167
- if (method === 'Max') {
168
- pivot_columns_total[key + method] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], 'Max').date;
169
- } else if (method === 'Min') {
170
- pivot_columns_total[key + method] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], 'Min').date;
182
+ if (method === SUMMARY_METHOD_MAP.Max) {
183
+ pivot_columns_total[totalKey] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], SUMMARY_METHOD_MAP.Max).date;
184
+ } else if (method === SUMMARY_METHOD_MAP.Min) {
185
+ pivot_columns_total[totalKey] = dateColumnsTotalArr[key].length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr[key], SUMMARY_METHOD_MAP.Min).date;
186
+ } else if (method === SUMMARY_METHOD_MAP.Distinct_values) {
187
+ var _pivotColumnTotal2 = (pivot_columns_total[totalKey] ? pivot_columns_total[totalKey] - 0 : 0) + total;
188
+ pivot_columns_total[totalKey] = Number.parseFloat(_pivotColumnTotal2.toFixed(8));
171
189
  }
172
190
  } else {
173
191
  var _validTotal = total ? total - 0 : 0;
174
- totalMap[key + method] = _validTotal;
175
- var _pivotColumnTotal = (pivot_columns_total[key + method] ? pivot_columns_total[key + method] - 0 : 0) + _validTotal;
176
- pivot_columns_total[key + method] = Number.parseFloat(_pivotColumnTotal.toFixed(8));
192
+ totalMap[totalKey] = _validTotal;
193
+ var _pivotColumnTotal3 = (pivot_columns_total[totalKey] ? pivot_columns_total[totalKey] - 0 : 0) + _validTotal;
194
+ pivot_columns_total[totalKey] = Number.parseFloat(_pivotColumnTotal3.toFixed(8));
177
195
  }
178
196
  });
179
197
  }
@@ -221,6 +239,7 @@ function calculateTwoDimensionTable(chart, value, username, userId) {
221
239
  pivot_summary_multiple_columns.push({
222
240
  key: item.key,
223
241
  type: column.type,
242
+ data: column.data,
224
243
  method: item.method,
225
244
  column_name: column.name
226
245
  });
@@ -319,7 +338,8 @@ function updateTwoDimensionColumns(value, pivot_columns, column, row, formulaRow
319
338
  });
320
339
  if (pivotColumnIndex < 0) {
321
340
  pivot_columns.unshift({
322
- key: null
341
+ key: null,
342
+ original_key: null
323
343
  });
324
344
  }
325
345
  } else {
@@ -329,7 +349,8 @@ function updateTwoDimensionColumns(value, pivot_columns, column, row, formulaRow
329
349
  });
330
350
  if (pivotColumnIndex < 0) {
331
351
  pivot_columns.push({
332
- key: k
352
+ key: k,
353
+ original_key: k
333
354
  });
334
355
  }
335
356
  });
@@ -341,7 +362,8 @@ function updateTwoDimensionColumns(value, pivot_columns, column, row, formulaRow
341
362
  });
342
363
  if (pivotColumnIndex < 0) {
343
364
  pivot_columns.push({
344
- key: key
365
+ key: key,
366
+ original_key: key
345
367
  });
346
368
  }
347
369
  }
@@ -376,6 +398,7 @@ function updateTwoDimensionRows(pivot_rows, pivot_columns, index, name, row, isC
376
398
  });
377
399
  pivot_rows.push({
378
400
  name: name,
401
+ original_name: name,
379
402
  cells: _cells
380
403
  });
381
404
  }
@@ -422,13 +445,17 @@ function getTwoDimensionTotal(summaryColumn, summary_type, summary_method, formu
422
445
  }
423
446
  }
424
447
  });
425
- if (summary_column_type != 'date') {
448
+ if (summary_column_type !== 'date') {
426
449
  pivotRow.total = Number.parseFloat(total.toFixed(8));
427
450
  pivot_table_total += total;
428
451
  }
429
452
  });
430
453
  if (summaryColumn && isDateColumn(summaryColumn)) {
431
- pivot_columns_total = showTwoDimensionDateColumnsAndRowsTotal(dateColumnsTotalArr, pivot_rows, date_summary_column_format, pivot_columns, summary_method);
454
+ if (summary_method === SUMMARY_METHOD_MAP.Distinct_values) {
455
+ pivot_columns_total = Number.parseFloat(pivot_table_total.toFixed(8));
456
+ } else {
457
+ pivot_columns_total = showTwoDimensionDateColumnsAndRowsTotal(dateColumnsTotalArr, pivot_rows, date_summary_column_format, pivot_columns, summary_method);
458
+ }
432
459
  if (summary_method === 'Max') {
433
460
  pivot_table_total = dateColumnsTotalArr.length === 0 ? 0 : getDateMaxOrMinTotal(dateColumnsTotalArr, 'Max').date;
434
461
  } else if (summary_method === 'Min') {
@@ -452,6 +479,32 @@ function getTotal(summary_column, summary_type, summary_method) {
452
479
  if (summary_type === SUMMARY_TYPE.COUNT) {
453
480
  total = rowsLength;
454
481
  } else if (summary_type === SUMMARY_TYPE.ADVANCED) {
482
+ if (summary_method === SUMMARY_METHOD_MAP.Distinct_values) {
483
+ total = 0;
484
+ var existMap = {};
485
+ rows.forEach(function (row) {
486
+ var num;
487
+ if (FORMULA_COLUMN_TYPES_MAP[summary_column_type]) {
488
+ var formulaRow = formula_rows[row._id] || {};
489
+ num = formulaRow[summary_column_key];
490
+ num = Array.isArray(num) ? num[0] : num;
491
+ } else {
492
+ num = row[summary_column_key];
493
+ }
494
+ if (!num) {
495
+ if (num === 0) {
496
+ num = '0';
497
+ } else {
498
+ num = !!num;
499
+ }
500
+ }
501
+ if (!existMap[num]) {
502
+ existMap[num] = true;
503
+ total++;
504
+ }
505
+ });
506
+ return total;
507
+ }
455
508
  if (summary_column && isDateColumn(summary_column)) {
456
509
  if (rowsLength === 0) return;
457
510
  var dateArr = [];
@@ -476,15 +529,15 @@ function getTotal(summary_column, summary_type, summary_method) {
476
529
  formatDate.value = Date.parse(formatDateData);
477
530
  dateArr.push(formatDate);
478
531
  });
479
- if (summary_method === 'Max') {
480
- total = getDateMaxOrMinTotal(dateArr, 'Max');
481
- } else if (summary_method === 'Min') {
482
- total = getDateMaxOrMinTotal(dateArr, 'Min');
532
+ if (summary_method === SUMMARY_METHOD_MAP.Max) {
533
+ total = getDateMaxOrMinTotal(dateArr, SUMMARY_METHOD_MAP.Max);
534
+ } else if (summary_method === SUMMARY_METHOD_MAP.Min) {
535
+ total = getDateMaxOrMinTotal(dateArr, SUMMARY_METHOD_MAP.Min);
483
536
  }
484
537
  } else {
485
538
  switch (summary_method) {
486
- case 'Sum':
487
- case 'Mean':
539
+ case SUMMARY_METHOD_MAP.Sum:
540
+ case SUMMARY_METHOD_MAP.Mean:
488
541
  {
489
542
  var sum = 0;
490
543
  var validNumbersCount = 0;
@@ -512,8 +565,8 @@ function getTotal(summary_column, summary_type, summary_method) {
512
565
  }
513
566
  break;
514
567
  }
515
- case 'Max':
516
- case 'Min':
568
+ case SUMMARY_METHOD_MAP.Max:
569
+ case SUMMARY_METHOD_MAP.Min:
517
570
  {
518
571
  if (rowsLength > 0) {
519
572
  var result = rows.reduce(function (current, next) {
@@ -109,29 +109,40 @@ var WorldMapCalculator = /*#__PURE__*/function (_BaseCalculator) {
109
109
  sqlCondition = filter2SqlCondition(selectedTable, selectedView);
110
110
  summaryColumnName = '';
111
111
  sqlString = '';
112
- if (isAdvanced) {
113
- summaryColumn = TableUtils.getTableColumnByKey(selectedTable, summary_column);
114
- summaryColumnName = summaryColumn.name;
115
- summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
116
- sqlString = "select `".concat(columnName, "`, ").concat(summaryColumnMethod, " from ").concat(selectedTable.name, " ").concat(sqlCondition, " group by ").concat(columnName, " limit 5000");
117
- } else {
118
- sqlString = "select `".concat(columnName, "`, ").concat(method, "(").concat(columnName, ") from ").concat(selectedTable.name, " ").concat(sqlCondition, " group by ").concat(columnName, " limit 5000");
112
+ if (!isAdvanced) {
113
+ _context2.next = 21;
114
+ break;
115
+ }
116
+ summaryColumn = TableUtils.getTableColumnByKey(selectedTable, summary_column);
117
+ if (summaryColumn) {
118
+ _context2.next = 16;
119
+ break;
119
120
  }
120
- _context2.next = 15;
121
+ return _context2.abrupt("return", []);
122
+ case 16:
123
+ summaryColumnName = summaryColumn.name;
124
+ summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
125
+ sqlString = "select `".concat(columnName, "`, ").concat(summaryColumnMethod, " from ").concat(selectedTable.name, " ").concat(sqlCondition, " group by ").concat(columnName, " limit 5000");
126
+ _context2.next = 22;
127
+ break;
128
+ case 21:
129
+ sqlString = "select `".concat(columnName, "`, ").concat(method, "(").concat(columnName, ") from ").concat(selectedTable.name, " ").concat(sqlCondition, " group by ").concat(columnName, " limit 5000");
130
+ case 22:
131
+ _context2.next = 24;
121
132
  return this.sqlQuery(sqlString);
122
- case 15:
133
+ case 24:
123
134
  result = _context2.sent;
124
135
  if (!(result.status === 200 && result.data.success)) {
125
- _context2.next = 25;
136
+ _context2.next = 34;
126
137
  break;
127
138
  }
128
139
  data = result.data;
129
140
  if (data.results) {
130
- _context2.next = 20;
141
+ _context2.next = 29;
131
142
  break;
132
143
  }
133
144
  return _context2.abrupt("return", []);
134
- case 20:
145
+ case 29:
135
146
  newResult = [];
136
147
  _summaryColumnMethod = getSummaryColumnMethod(method, summaryColumnName);
137
148
  valueKey = isAdvanced ? "".concat(_summaryColumnMethod) : "".concat(method, "(").concat(columnName, ")");
@@ -150,9 +161,9 @@ var WorldMapCalculator = /*#__PURE__*/function (_BaseCalculator) {
150
161
  }
151
162
  });
152
163
  return _context2.abrupt("return", newResult);
153
- case 25:
164
+ case 34:
154
165
  return _context2.abrupt("return", []);
155
- case 26:
166
+ case 35:
156
167
  case "end":
157
168
  return _context2.stop();
158
169
  }
@@ -26,7 +26,7 @@ var EnlargeChartDialog = /*#__PURE__*/function (_Component) {
26
26
  _this.renderStatisticView = function () {
27
27
  var _this$props = _this.props,
28
28
  colorThemeName = _this$props.colorThemeName,
29
- refresh = _this$props.refresh,
29
+ dtableChangedTime = _this$props.dtableChangedTime,
30
30
  statItem = _this$props.statItem,
31
31
  eventBus = _this$props.eventBus,
32
32
  chartCalculator = _this$props.chartCalculator,
@@ -35,7 +35,7 @@ var EnlargeChartDialog = /*#__PURE__*/function (_Component) {
35
35
  var viewProps = {
36
36
  isEnlarge: true,
37
37
  isPreview: true,
38
- refresh: refresh,
38
+ dtableChangedTime: dtableChangedTime,
39
39
  colorThemeName: colorThemeName,
40
40
  statItem: statItem,
41
41
  eventBus: eventBus,
@@ -98,6 +98,8 @@
98
98
  padding: 0;
99
99
  overflow-y: hidden;
100
100
  background-color: #f8f8f8;
101
+ border-bottom-left-radius: 3px;
102
+ border-bottom-right-radius: 3px;
101
103
  }
102
104
 
103
105
  .statistic-records-dialog.statistic-records-container .records-list {