sea-chart 0.0.72 → 0.0.73

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.
@@ -379,10 +379,13 @@ function updateTwoDimensionRows(pivot_rows, pivot_columns, index, name, row, isC
379
379
  } = chart;
380
380
  const isCount = summary_type === CHART_SUMMARY_TYPE.COUNT;
381
381
  let summarySQLColumnName2ColumnKey = {};
382
- const numericColumns = [{
383
- column_key: summary_column_key,
384
- summary_method: summary_method
385
- }, ...summary_columns];
382
+ let numericColumns = [];
383
+ if (summary_column_key) {
384
+ numericColumns = [{
385
+ column_key: summary_column_key,
386
+ summary_method: summary_method
387
+ }, ...summary_columns];
388
+ }
386
389
  numericColumns.forEach(item => {
387
390
  const {
388
391
  column_key,
@@ -400,7 +403,6 @@ function updateTwoDimensionRows(pivot_rows, pivot_columns, index, name, row, isC
400
403
  summarySQLColumnName2ColumnKey[sqlNumericColumnKey] = summaryColumnKey;
401
404
  }
402
405
  });
403
- const summarySQLnames = Object.keys(summarySQLColumnName2ColumnKey);
404
406
  const summarySQLColumnKeys = Object.values(summarySQLColumnName2ColumnKey);
405
407
  const summaryColumn = getTableColumnByKey(table, summary_column_key) || {};
406
408
  const singleNumeriColumnWithMethod = {
@@ -577,11 +579,19 @@ function getTwoDimensionTotal(summaryColumn, summary_type, summary_method, formu
577
579
  // cells[key].total = subTotal.date;
578
580
  }
579
581
  } else {
580
- cells[key].total = subTotal;
581
- total += subTotal[0][1] ? subTotal[0][1] - 0 : 0;
582
- let columnTotal = pivot_columns_total[key] ? pivot_columns_total[key] : 0;
583
- columnTotal += subTotal[0][1] ? subTotal[0][1] - 0 : 0;
584
- pivot_columns_total[key] = columnTotal;
582
+ if (Array.isArray(subTotal)) {
583
+ cells[key].total = subTotal;
584
+ total += subTotal[0][1] ? subTotal[0][1] - 0 : 0;
585
+ let columnTotal = pivot_columns_total[key] ? pivot_columns_total[key] : 0;
586
+ columnTotal += subTotal[0][1] ? subTotal[0][1] - 0 : 0;
587
+ pivot_columns_total[key] = columnTotal;
588
+ } else {
589
+ cells[key].total = subTotal;
590
+ total += subTotal ? subTotal - 0 : 0;
591
+ let columnTotal = pivot_columns_total[key] ? pivot_columns_total[key] : 0;
592
+ columnTotal += subTotal ? subTotal - 0 : 0;
593
+ pivot_columns_total[key] = columnTotal;
594
+ }
585
595
  }
586
596
  }
587
597
  });
@@ -151,8 +151,7 @@ class TwoDimensionTable extends PureComponent {
151
151
  selectedCell,
152
152
  summaryColumn,
153
153
  summaryMethod,
154
- chart,
155
- isCalculateByView
154
+ chart
156
155
  } = this.props;
157
156
  const {
158
157
  display_total = true,
@@ -270,7 +269,7 @@ class TwoDimensionTable extends PureComponent {
270
269
  'selected-pivot-cell-border': isSelectedCell
271
270
  })
272
271
  }));
273
- }), !total && this.renderEmpty(summaryColumns, cellIdx)));
272
+ }), !total && !(typeof total === 'number') && this.renderEmpty(summaryColumns, cellIdx)));
274
273
  }), display_total && /*#__PURE__*/React.createElement("td", {
275
274
  className: classnames('pivot-cell', {
276
275
  'pivot-empty-cell': !isValidSummaryDisplayValue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sea-chart",
3
- "version": "0.0.72",
3
+ "version": "0.0.73",
4
4
  "main": "./dist/index.js",
5
5
  "dependencies": {
6
6
  "@antv/data-set": "0.11.8",