@visactor/vtable 0.18.0-alpha.3 → 0.18.1

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 (127) hide show
  1. package/cjs/ListTable.d.ts +1 -0
  2. package/cjs/ListTable.js +50 -2
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.js +102 -83
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/core/BaseTable.js +4 -4
  7. package/cjs/core/BaseTable.js.map +1 -1
  8. package/cjs/data/DataSource.d.ts +3 -1
  9. package/cjs/data/DataSource.js +27 -7
  10. package/cjs/data/DataSource.js.map +1 -1
  11. package/cjs/event/pivot-chart/axis-click.js +2 -2
  12. package/cjs/event/pivot-chart/axis-click.js.map +1 -1
  13. package/cjs/index.d.ts +1 -1
  14. package/cjs/index.js +1 -1
  15. package/cjs/index.js.map +1 -1
  16. package/cjs/layout/chart-helper/get-axis-config.js +5 -5
  17. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  18. package/cjs/layout/chart-helper/get-chart-spec.d.ts +3 -0
  19. package/cjs/layout/chart-helper/get-chart-spec.js +43 -7
  20. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  21. package/cjs/layout/pivot-header-layout.d.ts +4 -3
  22. package/cjs/layout/pivot-header-layout.js +41 -21
  23. package/cjs/layout/pivot-header-layout.js.map +1 -1
  24. package/cjs/scenegraph/component/custom.d.ts +5 -0
  25. package/cjs/scenegraph/component/custom.js +20 -3
  26. package/cjs/scenegraph/component/custom.js.map +1 -1
  27. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +1 -1
  28. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  29. package/cjs/scenegraph/group-creater/cell-helper.d.ts +6 -3
  30. package/cjs/scenegraph/group-creater/cell-helper.js +38 -36
  31. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  32. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -1
  33. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -2
  34. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  35. package/cjs/scenegraph/group-creater/column-helper.js +11 -7
  36. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js +12 -5
  38. package/cjs/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
  39. package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js +19 -14
  40. package/cjs/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
  41. package/cjs/scenegraph/layout/move-cell.d.ts +2 -1
  42. package/cjs/scenegraph/layout/move-cell.js +15 -27
  43. package/cjs/scenegraph/layout/move-cell.js.map +1 -1
  44. package/cjs/scenegraph/layout/update-height.js +21 -17
  45. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  46. package/cjs/scenegraph/layout/update-width.js +40 -17
  47. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  48. package/cjs/scenegraph/scenegraph.d.ts +2 -2
  49. package/cjs/scenegraph/scenegraph.js +10 -7
  50. package/cjs/scenegraph/scenegraph.js.map +1 -1
  51. package/cjs/scenegraph/utils/get-cell-merge.js +4 -0
  52. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  53. package/cjs/scenegraph/utils/text-icon-layout.d.ts +3 -3
  54. package/cjs/scenegraph/utils/text-icon-layout.js +12 -10
  55. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  56. package/cjs/state/cell-move/index.js +4 -2
  57. package/cjs/state/cell-move/index.js.map +1 -1
  58. package/cjs/themes/ARCO.js +2 -1
  59. package/cjs/themes/BRIGHT.js +1 -2
  60. package/cjs/ts-types/table-engine.d.ts +5 -1
  61. package/cjs/ts-types/table-engine.js.map +1 -1
  62. package/cjs/vrender.js.map +1 -1
  63. package/dist/vtable.js +1562 -1204
  64. package/dist/vtable.min.js +2 -2
  65. package/es/ListTable.d.ts +1 -0
  66. package/es/ListTable.js +49 -2
  67. package/es/ListTable.js.map +1 -1
  68. package/es/PivotChart.js +102 -83
  69. package/es/PivotChart.js.map +1 -1
  70. package/es/core/BaseTable.js +4 -4
  71. package/es/core/BaseTable.js.map +1 -1
  72. package/es/data/DataSource.d.ts +3 -1
  73. package/es/data/DataSource.js +27 -7
  74. package/es/data/DataSource.js.map +1 -1
  75. package/es/event/pivot-chart/axis-click.js +2 -2
  76. package/es/event/pivot-chart/axis-click.js.map +1 -1
  77. package/es/index.d.ts +1 -1
  78. package/es/index.js +1 -1
  79. package/es/index.js.map +1 -1
  80. package/es/layout/chart-helper/get-axis-config.js +5 -5
  81. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  82. package/es/layout/chart-helper/get-chart-spec.d.ts +3 -0
  83. package/es/layout/chart-helper/get-chart-spec.js +38 -4
  84. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  85. package/es/layout/pivot-header-layout.d.ts +4 -3
  86. package/es/layout/pivot-header-layout.js +36 -21
  87. package/es/layout/pivot-header-layout.js.map +1 -1
  88. package/es/scenegraph/component/custom.d.ts +5 -0
  89. package/es/scenegraph/component/custom.js +18 -0
  90. package/es/scenegraph/component/custom.js.map +1 -1
  91. package/es/scenegraph/graphic/contributions/chart-render-helper.js +1 -1
  92. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  93. package/es/scenegraph/group-creater/cell-helper.d.ts +6 -3
  94. package/es/scenegraph/group-creater/cell-helper.js +36 -35
  95. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  96. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +2 -1
  97. package/es/scenegraph/group-creater/cell-type/text-cell.js +6 -2
  98. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  99. package/es/scenegraph/group-creater/column-helper.js +11 -6
  100. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  101. package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js +12 -5
  102. package/es/scenegraph/group-creater/progress/update-position/sort-horizontal.js.map +1 -1
  103. package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js +19 -14
  104. package/es/scenegraph/group-creater/progress/update-position/sort-vertical.js.map +1 -1
  105. package/es/scenegraph/layout/move-cell.d.ts +2 -1
  106. package/es/scenegraph/layout/move-cell.js +12 -20
  107. package/es/scenegraph/layout/move-cell.js.map +1 -1
  108. package/es/scenegraph/layout/update-height.js +20 -16
  109. package/es/scenegraph/layout/update-height.js.map +1 -1
  110. package/es/scenegraph/layout/update-width.js +39 -16
  111. package/es/scenegraph/layout/update-width.js.map +1 -1
  112. package/es/scenegraph/scenegraph.d.ts +2 -2
  113. package/es/scenegraph/scenegraph.js +9 -6
  114. package/es/scenegraph/scenegraph.js.map +1 -1
  115. package/es/scenegraph/utils/get-cell-merge.js +4 -0
  116. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  117. package/es/scenegraph/utils/text-icon-layout.d.ts +3 -3
  118. package/es/scenegraph/utils/text-icon-layout.js +10 -10
  119. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  120. package/es/state/cell-move/index.js +4 -1
  121. package/es/state/cell-move/index.js.map +1 -1
  122. package/es/themes/ARCO.js +2 -1
  123. package/es/themes/BRIGHT.js +1 -2
  124. package/es/ts-types/table-engine.d.ts +5 -1
  125. package/es/ts-types/table-engine.js.map +1 -1
  126. package/es/vrender.js.map +1 -1
  127. package/package.json +5 -5
package/cjs/PivotChart.js CHANGED
@@ -131,10 +131,18 @@ class PivotChart extends BaseTable_1.BaseTable {
131
131
  return layoutMap.getBodyIndexByCol(col);
132
132
  }
133
133
  getCellValue(col, row) {
134
- var _a;
134
+ var _a, _b, _c;
135
135
  const customMergeText = this.getCustomMergeValue(col, row);
136
136
  if (customMergeText) return customMergeText;
137
137
  if (this.internalProps.layoutMap.isHeader(col, row)) {
138
+ if (this.internalProps.layoutMap.isBottomFrozenRow(col, row) || this.internalProps.layoutMap.isRightFrozenColumn(col, row)) {
139
+ const indicatorKeys = this.internalProps.layoutMap.getIndicatorKeyInChartSpec(col, row);
140
+ let indicatorInfo;
141
+ return null == indicatorKeys || indicatorKeys.forEach((key => {
142
+ const info = this.internalProps.layoutMap.getIndicatorInfo(key);
143
+ info && (indicatorInfo = info);
144
+ })), null !== (_b = null !== (_a = null == indicatorInfo ? void 0 : indicatorInfo.title) && void 0 !== _a ? _a : null == indicatorInfo ? void 0 : indicatorInfo.indicatorKey) && void 0 !== _b ? _b : "";
145
+ }
138
146
  const {title: title, fieldFormat: fieldFormat} = this.internalProps.layoutMap.getHeader(col, row);
139
147
  return "function" == typeof fieldFormat ? fieldFormat(title, col, row, this) : title;
140
148
  }
@@ -148,16 +156,24 @@ class PivotChart extends BaseTable_1.BaseTable {
148
156
  })), aggregator = this.dataset.getAggregator(this.internalProps.layoutMap.indicatorsAsCol ? rowKeys : rowKeys.slice(0, -1), this.internalProps.layoutMap.indicatorsAsCol ? colKeys.slice(0, -1) : colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row));
149
157
  return aggregator.value ? aggregator.value() : void 0;
150
158
  }
151
- const {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row), rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col), dataValue = null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
159
+ const {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row), rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col), dataValue = null === (_c = this.records[rowIndex]) || void 0 === _c ? void 0 : _c[colIndex];
152
160
  if ("function" == typeof fieldFormat) {
153
161
  return fieldFormat(dataValue, col, row, this);
154
162
  }
155
163
  return dataValue;
156
164
  }
157
165
  getCellOriginValue(col, row) {
158
- var _a;
166
+ var _a, _b, _c;
159
167
  const table = this;
160
168
  if (table.internalProps.layoutMap.isHeader(col, row)) {
169
+ if (this.internalProps.layoutMap.isBottomFrozenRow(col, row) || this.internalProps.layoutMap.isRightFrozenColumn(col, row)) {
170
+ const indicatorKeys = this.internalProps.layoutMap.getIndicatorKeyInChartSpec(col, row);
171
+ let indicatorInfo;
172
+ return null == indicatorKeys || indicatorKeys.forEach((key => {
173
+ const info = this.internalProps.layoutMap.getIndicatorInfo(key);
174
+ info && (indicatorInfo = info);
175
+ })), null !== (_b = null !== (_a = null == indicatorInfo ? void 0 : indicatorInfo.title) && void 0 !== _a ? _a : null == indicatorInfo ? void 0 : indicatorInfo.indicatorKey) && void 0 !== _b ? _b : "";
176
+ }
161
177
  const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
162
178
  return "function" == typeof title ? title() : title;
163
179
  }
@@ -172,7 +188,7 @@ class PivotChart extends BaseTable_1.BaseTable {
172
188
  return aggregator.value ? aggregator.value() : void 0;
173
189
  }
174
190
  const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
175
- return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
191
+ return null === (_c = this.records[rowIndex]) || void 0 === _c ? void 0 : _c[colIndex];
176
192
  }
177
193
  getCellRawValue(col, row) {
178
194
  return this.getCellOriginValue(col, row);
@@ -284,87 +300,90 @@ class PivotChart extends BaseTable_1.BaseTable {
284
300
  };
285
301
  }
286
302
  _generateCollectValuesConfig(columnKeys, rowKeys) {
287
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
303
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
288
304
  const indicators = this.internalProps.indicators, collectValuesBy = {};
289
- for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec) if (!1 === this.options.indicatorsAsCol) {
290
- const indicatorDefine = indicators[i];
291
- if (!1 !== (null === (_a = indicatorDefine.chartSpec) || void 0 === _a ? void 0 : _a.stack) && ("bar" === (null === (_b = indicatorDefine.chartSpec) || void 0 === _b ? void 0 : _b.type) || "area" === (null === (_c = indicatorDefine.chartSpec) || void 0 === _c ? void 0 : _c.type)) && (indicatorDefine.chartSpec.stack = !0),
292
- collectValuesBy[indicatorDefine.indicatorKey] = {
293
- by: rowKeys,
294
- range: !0,
295
- sumBy: (null === (_d = indicatorDefine.chartSpec) || void 0 === _d ? void 0 : _d.stack) && columnKeys.concat(null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.xField)
296
- }, indicatorDefine.chartSpec.series) indicatorDefine.chartSpec.series.forEach((chartSeries => {
297
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
298
- const xField = "string" == typeof chartSeries.xField ? chartSeries.xField : chartSeries.xField[0];
299
- collectValuesBy[xField] = {
300
- by: columnKeys,
301
- type: "horizontal" !== chartSeries.direction ? "xField" : void 0,
302
- range: "horizontal" === chartSeries.direction,
303
- sortBy: "horizontal" !== chartSeries.direction ? null !== (_d = null === (_c = null === (_b = null === (_a = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _a ? void 0 : _a.fields) || void 0 === _b ? void 0 : _b[xField]) || void 0 === _c ? void 0 : _c.domain) && void 0 !== _d ? _d : null === (_h = null === (_g = null === (_f = null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[xField]) || void 0 === _h ? void 0 : _h.domain : void 0
304
- };
305
- const yField = chartSeries.yField;
306
- !1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
307
- collectValuesBy[yField] = {
308
- by: rowKeys,
309
- range: "horizontal" !== chartSeries.direction,
310
- sumBy: chartSeries.stack && columnKeys.concat(null == chartSeries ? void 0 : chartSeries.xField),
311
- sortBy: "horizontal" === chartSeries.direction ? null !== (_m = null === (_l = null === (_k = null === (_j = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[yField]) || void 0 === _l ? void 0 : _l.domain) && void 0 !== _m ? _m : null === (_r = null === (_q = null === (_p = null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[yField]) || void 0 === _r ? void 0 : _r.domain : void 0
312
- };
313
- })); else {
314
- const xField = "string" == typeof indicatorDefine.chartSpec.xField ? indicatorDefine.chartSpec.xField : indicatorDefine.chartSpec.xField[0];
315
- collectValuesBy[xField] = {
316
- by: columnKeys,
317
- type: "horizontal" !== indicatorDefine.chartSpec.direction ? "xField" : void 0,
318
- range: "horizontal" === indicatorDefine.chartSpec.direction,
319
- sortBy: "horizontal" !== indicatorDefine.chartSpec.direction ? null === (_j = null === (_h = null === (_g = null === (_f = indicatorDefine.chartSpec) || void 0 === _f ? void 0 : _f.data) || void 0 === _g ? void 0 : _g.fields) || void 0 === _h ? void 0 : _h[xField]) || void 0 === _j ? void 0 : _j.domain : void 0
320
- }, !1 !== (null === (_k = indicatorDefine.chartSpec) || void 0 === _k ? void 0 : _k.stack) && ("bar" === (null === (_l = indicatorDefine.chartSpec) || void 0 === _l ? void 0 : _l.type) || "area" === (null === (_m = indicatorDefine.chartSpec) || void 0 === _m ? void 0 : _m.type)) && (indicatorDefine.chartSpec.stack = !0);
321
- const yField = indicatorDefine.chartSpec.yField;
322
- collectValuesBy[yField] = {
305
+ for (let i = 0, len = null == indicators ? void 0 : indicators.length; i < len; i++) if ("string" != typeof indicators[i] && indicators[i].chartSpec) {
306
+ if ("pie" === (null === (_a = indicators[i].chartSpec) || void 0 === _a ? void 0 : _a.type)) continue;
307
+ if (!1 === this.options.indicatorsAsCol) {
308
+ const indicatorDefine = indicators[i];
309
+ if (!1 !== (null === (_b = indicatorDefine.chartSpec) || void 0 === _b ? void 0 : _b.stack) && ("bar" === (null === (_c = indicatorDefine.chartSpec) || void 0 === _c ? void 0 : _c.type) || "area" === (null === (_d = indicatorDefine.chartSpec) || void 0 === _d ? void 0 : _d.type)) && (indicatorDefine.chartSpec.stack = !0),
310
+ collectValuesBy[indicatorDefine.indicatorKey] = {
323
311
  by: rowKeys,
324
- range: "horizontal" !== indicators[i].chartSpec.direction,
325
- sumBy: indicatorDefine.chartSpec.stack && columnKeys.concat(null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.xField),
326
- sortBy: "horizontal" === indicatorDefine.chartSpec.direction ? null === (_s = null === (_r = null === (_q = null === (_p = indicatorDefine.chartSpec) || void 0 === _p ? void 0 : _p.data) || void 0 === _q ? void 0 : _q.fields) || void 0 === _r ? void 0 : _r[yField]) || void 0 === _s ? void 0 : _s.domain : void 0
327
- };
328
- }
329
- } else {
330
- const indicatorDefine = indicators[i];
331
- if (!1 !== (null === (_t = indicatorDefine.chartSpec) || void 0 === _t ? void 0 : _t.stack) && ("bar" === (null === (_u = indicatorDefine.chartSpec) || void 0 === _u ? void 0 : _u.type) || "area" === (null === (_v = indicatorDefine.chartSpec) || void 0 === _v ? void 0 : _v.type)) && (indicatorDefine.chartSpec.stack = !0),
332
- collectValuesBy[indicatorDefine.indicatorKey] = {
333
- by: columnKeys,
334
- range: !0,
335
- sumBy: (null === (_w = indicatorDefine.chartSpec) || void 0 === _w ? void 0 : _w.stack) && rowKeys.concat(null === (_x = indicatorDefine.chartSpec) || void 0 === _x ? void 0 : _x.yField)
336
- }, indicatorDefine.chartSpec.series) indicatorDefine.chartSpec.series.forEach((chartSeries => {
337
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
338
- const yField = "string" == typeof chartSeries.yField ? chartSeries.yField : chartSeries.yField[0];
339
- collectValuesBy[yField] = {
340
- by: rowKeys,
341
- type: "horizontal" === chartSeries.direction ? "yField" : void 0,
342
- range: "horizontal" !== chartSeries.direction,
343
- sortBy: "horizontal" === chartSeries.direction ? null !== (_d = null === (_c = null === (_b = null === (_a = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _a ? void 0 : _a.fields) || void 0 === _b ? void 0 : _b[yField]) || void 0 === _c ? void 0 : _c.domain) && void 0 !== _d ? _d : null === (_h = null === (_g = null === (_f = null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[yField]) || void 0 === _h ? void 0 : _h.domain : void 0
344
- };
345
- const xField = chartSeries.xField;
346
- !1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
347
- collectValuesBy[xField] = {
348
- by: columnKeys,
349
- range: "horizontal" === chartSeries.direction,
350
- sumBy: chartSeries.stack && rowKeys.concat(null == chartSeries ? void 0 : chartSeries.yField),
351
- sortBy: "horizontal" !== chartSeries.direction ? null !== (_m = null === (_l = null === (_k = null === (_j = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[xField]) || void 0 === _l ? void 0 : _l.domain) && void 0 !== _m ? _m : null === (_r = null === (_q = null === (_p = null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[xField]) || void 0 === _r ? void 0 : _r.domain : void 0
352
- };
353
- })); else {
354
- const yField = "string" == typeof indicatorDefine.chartSpec.yField ? indicatorDefine.chartSpec.yField : indicatorDefine.chartSpec.yField[0];
355
- collectValuesBy[yField] = {
356
- by: rowKeys,
357
- type: "horizontal" === indicatorDefine.chartSpec.direction ? "yField" : void 0,
358
- range: "horizontal" !== indicatorDefine.chartSpec.direction,
359
- sortBy: "horizontal" === indicatorDefine.chartSpec.direction ? null === (_1 = null === (_0 = null === (_z = null === (_y = indicatorDefine.chartSpec) || void 0 === _y ? void 0 : _y.data) || void 0 === _z ? void 0 : _z.fields) || void 0 === _0 ? void 0 : _0[yField]) || void 0 === _1 ? void 0 : _1.domain : void 0
360
- }, !1 !== (null === (_2 = indicatorDefine.chartSpec) || void 0 === _2 ? void 0 : _2.stack) && ("bar" === (null === (_3 = indicatorDefine.chartSpec) || void 0 === _3 ? void 0 : _3.type) || "area" === (null === (_4 = indicatorDefine.chartSpec) || void 0 === _4 ? void 0 : _4.type)) && (indicatorDefine.chartSpec.stack = !0);
361
- const xField = indicatorDefine.chartSpec.xField;
362
- collectValuesBy[xField] = {
312
+ range: !0,
313
+ sumBy: (null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.stack) && columnKeys.concat(null === (_f = indicatorDefine.chartSpec) || void 0 === _f ? void 0 : _f.xField)
314
+ }, indicatorDefine.chartSpec.series) indicatorDefine.chartSpec.series.forEach((chartSeries => {
315
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
316
+ const xField = "string" == typeof chartSeries.xField ? chartSeries.xField : chartSeries.xField[0];
317
+ collectValuesBy[xField] = {
318
+ by: columnKeys,
319
+ type: "horizontal" !== chartSeries.direction ? "xField" : void 0,
320
+ range: "horizontal" === chartSeries.direction,
321
+ sortBy: "horizontal" !== chartSeries.direction ? null !== (_d = null === (_c = null === (_b = null === (_a = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _a ? void 0 : _a.fields) || void 0 === _b ? void 0 : _b[xField]) || void 0 === _c ? void 0 : _c.domain) && void 0 !== _d ? _d : null === (_h = null === (_g = null === (_f = null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[xField]) || void 0 === _h ? void 0 : _h.domain : void 0
322
+ };
323
+ const yField = chartSeries.yField;
324
+ !1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
325
+ collectValuesBy[yField] = {
326
+ by: rowKeys,
327
+ range: "horizontal" !== chartSeries.direction,
328
+ sumBy: chartSeries.stack && columnKeys.concat(null == chartSeries ? void 0 : chartSeries.xField),
329
+ sortBy: "horizontal" === chartSeries.direction ? null !== (_m = null === (_l = null === (_k = null === (_j = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[yField]) || void 0 === _l ? void 0 : _l.domain) && void 0 !== _m ? _m : null === (_r = null === (_q = null === (_p = null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[yField]) || void 0 === _r ? void 0 : _r.domain : void 0
330
+ };
331
+ })); else {
332
+ const xField = "string" == typeof indicatorDefine.chartSpec.xField ? indicatorDefine.chartSpec.xField : indicatorDefine.chartSpec.xField[0];
333
+ collectValuesBy[xField] = {
334
+ by: columnKeys,
335
+ type: "horizontal" !== indicatorDefine.chartSpec.direction ? "xField" : void 0,
336
+ range: "horizontal" === indicatorDefine.chartSpec.direction,
337
+ sortBy: "horizontal" !== indicatorDefine.chartSpec.direction ? null === (_k = null === (_j = null === (_h = null === (_g = indicatorDefine.chartSpec) || void 0 === _g ? void 0 : _g.data) || void 0 === _h ? void 0 : _h.fields) || void 0 === _j ? void 0 : _j[xField]) || void 0 === _k ? void 0 : _k.domain : void 0
338
+ }, !1 !== (null === (_l = indicatorDefine.chartSpec) || void 0 === _l ? void 0 : _l.stack) && ("bar" === (null === (_m = indicatorDefine.chartSpec) || void 0 === _m ? void 0 : _m.type) || "area" === (null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.type)) && (indicatorDefine.chartSpec.stack = !0);
339
+ const yField = indicatorDefine.chartSpec.yField;
340
+ collectValuesBy[yField] = {
341
+ by: rowKeys,
342
+ range: "horizontal" !== indicators[i].chartSpec.direction,
343
+ sumBy: indicatorDefine.chartSpec.stack && columnKeys.concat(null === (_p = indicatorDefine.chartSpec) || void 0 === _p ? void 0 : _p.xField),
344
+ sortBy: "horizontal" === indicatorDefine.chartSpec.direction ? null === (_t = null === (_s = null === (_r = null === (_q = indicatorDefine.chartSpec) || void 0 === _q ? void 0 : _q.data) || void 0 === _r ? void 0 : _r.fields) || void 0 === _s ? void 0 : _s[yField]) || void 0 === _t ? void 0 : _t.domain : void 0
345
+ };
346
+ }
347
+ } else {
348
+ const indicatorDefine = indicators[i];
349
+ if (!1 !== (null === (_u = indicatorDefine.chartSpec) || void 0 === _u ? void 0 : _u.stack) && ("bar" === (null === (_v = indicatorDefine.chartSpec) || void 0 === _v ? void 0 : _v.type) || "area" === (null === (_w = indicatorDefine.chartSpec) || void 0 === _w ? void 0 : _w.type)) && (indicatorDefine.chartSpec.stack = !0),
350
+ collectValuesBy[indicatorDefine.indicatorKey] = {
363
351
  by: columnKeys,
364
- range: "horizontal" === indicators[i].chartSpec.direction,
365
- sumBy: indicatorDefine.chartSpec.stack && rowKeys.concat(null === (_5 = indicatorDefine.chartSpec) || void 0 === _5 ? void 0 : _5.yField),
366
- sortBy: "horizontal" !== indicatorDefine.chartSpec.direction ? null === (_9 = null === (_8 = null === (_7 = null === (_6 = indicatorDefine.chartSpec) || void 0 === _6 ? void 0 : _6.data) || void 0 === _7 ? void 0 : _7.fields) || void 0 === _8 ? void 0 : _8[xField]) || void 0 === _9 ? void 0 : _9.domain : void 0
367
- };
352
+ range: !0,
353
+ sumBy: (null === (_x = indicatorDefine.chartSpec) || void 0 === _x ? void 0 : _x.stack) && rowKeys.concat(null === (_y = indicatorDefine.chartSpec) || void 0 === _y ? void 0 : _y.yField)
354
+ }, indicatorDefine.chartSpec.series) indicatorDefine.chartSpec.series.forEach((chartSeries => {
355
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
356
+ const yField = "string" == typeof chartSeries.yField ? chartSeries.yField : chartSeries.yField[0];
357
+ collectValuesBy[yField] = {
358
+ by: rowKeys,
359
+ type: "horizontal" === chartSeries.direction ? "yField" : void 0,
360
+ range: "horizontal" !== chartSeries.direction,
361
+ sortBy: "horizontal" === chartSeries.direction ? null !== (_d = null === (_c = null === (_b = null === (_a = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _a ? void 0 : _a.fields) || void 0 === _b ? void 0 : _b[yField]) || void 0 === _c ? void 0 : _c.domain) && void 0 !== _d ? _d : null === (_h = null === (_g = null === (_f = null === (_e = indicatorDefine.chartSpec) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f.fields) || void 0 === _g ? void 0 : _g[yField]) || void 0 === _h ? void 0 : _h.domain : void 0
362
+ };
363
+ const xField = chartSeries.xField;
364
+ !1 !== chartSeries.stack && ("bar" === chartSeries.type || "area" === chartSeries.type) && (chartSeries.stack = !0),
365
+ collectValuesBy[xField] = {
366
+ by: columnKeys,
367
+ range: "horizontal" === chartSeries.direction,
368
+ sumBy: chartSeries.stack && rowKeys.concat(null == chartSeries ? void 0 : chartSeries.yField),
369
+ sortBy: "horizontal" !== chartSeries.direction ? null !== (_m = null === (_l = null === (_k = null === (_j = null == chartSeries ? void 0 : chartSeries.data) || void 0 === _j ? void 0 : _j.fields) || void 0 === _k ? void 0 : _k[xField]) || void 0 === _l ? void 0 : _l.domain) && void 0 !== _m ? _m : null === (_r = null === (_q = null === (_p = null === (_o = indicatorDefine.chartSpec) || void 0 === _o ? void 0 : _o.data) || void 0 === _p ? void 0 : _p.fields) || void 0 === _q ? void 0 : _q[xField]) || void 0 === _r ? void 0 : _r.domain : void 0
370
+ };
371
+ })); else {
372
+ const yField = "string" == typeof indicatorDefine.chartSpec.yField ? indicatorDefine.chartSpec.yField : indicatorDefine.chartSpec.yField[0];
373
+ collectValuesBy[yField] = {
374
+ by: rowKeys,
375
+ type: "horizontal" === indicatorDefine.chartSpec.direction ? "yField" : void 0,
376
+ range: "horizontal" !== indicatorDefine.chartSpec.direction,
377
+ sortBy: "horizontal" === indicatorDefine.chartSpec.direction ? null === (_2 = null === (_1 = null === (_0 = null === (_z = indicatorDefine.chartSpec) || void 0 === _z ? void 0 : _z.data) || void 0 === _0 ? void 0 : _0.fields) || void 0 === _1 ? void 0 : _1[yField]) || void 0 === _2 ? void 0 : _2.domain : void 0
378
+ }, !1 !== (null === (_3 = indicatorDefine.chartSpec) || void 0 === _3 ? void 0 : _3.stack) && ("bar" === (null === (_4 = indicatorDefine.chartSpec) || void 0 === _4 ? void 0 : _4.type) || "area" === (null === (_5 = indicatorDefine.chartSpec) || void 0 === _5 ? void 0 : _5.type)) && (indicatorDefine.chartSpec.stack = !0);
379
+ const xField = indicatorDefine.chartSpec.xField;
380
+ collectValuesBy[xField] = {
381
+ by: columnKeys,
382
+ range: "horizontal" === indicators[i].chartSpec.direction,
383
+ sumBy: indicatorDefine.chartSpec.stack && rowKeys.concat(null === (_6 = indicatorDefine.chartSpec) || void 0 === _6 ? void 0 : _6.yField),
384
+ sortBy: "horizontal" !== indicatorDefine.chartSpec.direction ? null === (_10 = null === (_9 = null === (_8 = null === (_7 = indicatorDefine.chartSpec) || void 0 === _7 ? void 0 : _7.data) || void 0 === _8 ? void 0 : _8.fields) || void 0 === _9 ? void 0 : _9[xField]) || void 0 === _10 ? void 0 : _10.domain : void 0
385
+ };
386
+ }
368
387
  }
369
388
  }
370
389
  return collectValuesBy;
@@ -477,7 +496,7 @@ class PivotChart extends BaseTable_1.BaseTable {
477
496
  if (chartNode.attribute.chartInstance) {
478
497
  chartInstance = chartNode.attribute.chartInstance;
479
498
  const {dataId: dataId, data: data, axes: axes, spec: spec} = chartNode.attribute, viewBox = chartNode.getViewBox();
480
- if (axes.forEach(((axis, index) => {
499
+ if (null == axes || axes.forEach(((axis, index) => {
481
500
  var _a, _b, _c, _d;
482
501
  "linear" === axis.type ? chartInstance.updateModelSpecSync({
483
502
  type: "axes",