@visactor/vtable 0.10.2 → 0.10.3-alpha.0

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 (59) hide show
  1. package/cjs/PivotChart.js +26 -25
  2. package/cjs/PivotChart.js.map +1 -1
  3. package/cjs/PivotTable.js +8 -8
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/core/BaseTable.js +1 -1
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/dataset/dataset-pivot-table.js.map +1 -1
  8. package/cjs/dataset/dataset.js +4 -5
  9. package/cjs/dataset/dataset.js.map +1 -1
  10. package/cjs/dataset/flatDataToObject.js +2 -1
  11. package/cjs/dataset/flatDataToObject.js.map +1 -1
  12. package/cjs/header-helper/header-helper.js +1 -0
  13. package/cjs/header-helper/header-helper.js.map +1 -1
  14. package/cjs/index.d.ts +1 -1
  15. package/cjs/index.js +1 -1
  16. package/cjs/index.js.map +1 -1
  17. package/cjs/layout/chart-helper/get-axis-config.js +7 -7
  18. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  19. package/cjs/layout/chart-helper/get-chart-spec.js +4 -4
  20. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  21. package/cjs/layout/pivot-header-layout.js +21 -19
  22. package/cjs/layout/pivot-header-layout.js.map +1 -1
  23. package/cjs/layout/pivot-layout.js +4 -3
  24. package/cjs/layout/pivot-layout.js.map +1 -1
  25. package/cjs/scenegraph/layout/frozen.js +18 -4
  26. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  27. package/cjs/state/spark-line/index.js +3 -2
  28. package/cjs/state/spark-line/index.js.map +1 -1
  29. package/dist/vtable.js +103 -71
  30. package/dist/vtable.min.js +1 -1
  31. package/es/PivotChart.js +26 -25
  32. package/es/PivotChart.js.map +1 -1
  33. package/es/PivotTable.js +8 -8
  34. package/es/PivotTable.js.map +1 -1
  35. package/es/core/BaseTable.js +1 -1
  36. package/es/core/BaseTable.js.map +1 -1
  37. package/es/dataset/dataset-pivot-table.js.map +1 -1
  38. package/es/dataset/dataset.js +4 -4
  39. package/es/dataset/dataset.js.map +1 -1
  40. package/es/dataset/flatDataToObject.js +2 -1
  41. package/es/dataset/flatDataToObject.js.map +1 -1
  42. package/es/header-helper/header-helper.js +1 -0
  43. package/es/header-helper/header-helper.js.map +1 -1
  44. package/es/index.d.ts +1 -1
  45. package/es/index.js +1 -1
  46. package/es/index.js.map +1 -1
  47. package/es/layout/chart-helper/get-axis-config.js +7 -7
  48. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  49. package/es/layout/chart-helper/get-chart-spec.js +4 -4
  50. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  51. package/es/layout/pivot-header-layout.js +21 -19
  52. package/es/layout/pivot-header-layout.js.map +1 -1
  53. package/es/layout/pivot-layout.js +4 -3
  54. package/es/layout/pivot-layout.js.map +1 -1
  55. package/es/scenegraph/layout/frozen.js +18 -4
  56. package/es/scenegraph/layout/frozen.js.map +1 -1
  57. package/es/state/spark-line/index.js +3 -2
  58. package/es/state/spark-line/index.js.map +1 -1
  59. package/package.json +1 -1
package/dist/vtable.js CHANGED
@@ -46948,7 +46948,7 @@
46948
46948
  else if (col === layout.rowHeaderLevelCount - 1 &&
46949
46949
  row >= layout.columnHeaderLevelCount &&
46950
46950
  row < layout.rowCount - layout.bottomFrozenRowCount) {
46951
- let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row)[0];
46951
+ let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row)?.[0];
46952
46952
  if (isArray(rowDimensionKey)) {
46953
46953
  rowDimensionKey = rowDimensionKey[0];
46954
46954
  }
@@ -46985,7 +46985,7 @@
46985
46985
  ? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
46986
46986
  : layout.dataset.collectedValues[defaultKey];
46987
46987
  const index = layout.getRecordIndexByRow(row);
46988
- const range = data?.[layout.getRowKeysPath()[index][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]] ?? { min: 0, max: 1 };
46988
+ const range = data?.[layout.getRowKeysPath()[index]?.[Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)] ?? ''] ?? { min: 0, max: 1 };
46989
46989
  let indicatorInfo = null;
46990
46990
  indicatorKeys.forEach(key => {
46991
46991
  const info = layout.getIndicatorInfo(key);
@@ -47034,7 +47034,7 @@
47034
47034
  ? layout.dataset.collectedValues[defaultKey + (isZeroAlign ? '_align' : '')]
47035
47035
  : layout.dataset.collectedValues[defaultKey];
47036
47036
  const index = layout.getRecordIndexByRow(row);
47037
- const range = data?.[layout.getRowKeysPath()[index][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]] ?? { min: 0, max: 1 };
47037
+ const range = data?.[layout.getRowKeysPath()[index]?.[Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)] ?? ''] ?? { min: 0, max: 1 };
47038
47038
  const axisOption = getAxisOption(col, row, 'right', layout);
47039
47039
  if (axisOption?.visible === false) {
47040
47040
  return;
@@ -47061,14 +47061,14 @@
47061
47061
  else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
47062
47062
  col >= layout.rowHeaderLevelCount &&
47063
47063
  col < layout.colCount - layout.rightFrozenColCount) {
47064
- let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
47064
+ let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)?.[0];
47065
47065
  if (isArray(columnDimensionKey)) {
47066
47066
  columnDimensionKey = columnDimensionKey[0];
47067
47067
  }
47068
47068
  const data = layout.dataset.collectedValues[columnDimensionKey] ?? [];
47069
47069
  const recordCol = layout.getRecordIndexByCol(col);
47070
47070
  const colPath = layout.getColKeysPath()[recordCol];
47071
- const domain = data?.[colPath[colPath.length - 1]] ?? [];
47071
+ const domain = data?.[colPath?.[colPath?.length - 1]] ?? [];
47072
47072
  const axisOption = getAxisOption(col, row, 'bottom', layout);
47073
47073
  if (axisOption?.visible === false) {
47074
47074
  return;
@@ -50018,12 +50018,14 @@
50018
50018
  for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
50019
50019
  moveColumnFromBodyToRowHeader(scene);
50020
50020
  moveColumnFromColHeaderToCornerHeader(scene);
50021
+ moveColumnFromBottomToLeftBottomCorner(scene);
50021
50022
  }
50022
50023
  }
50023
50024
  else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {
50024
50025
  for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {
50025
50026
  moveColumnFromRowHeaderToBody(scene);
50026
50027
  moveColumnFromCornerHeaderToColHeader(scene);
50028
+ moveColumnFromLeftBottomCornerToBottom(scene);
50027
50029
  }
50028
50030
  }
50029
50031
  scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
@@ -50042,6 +50044,7 @@
50042
50044
  for (let i = 0; i < scene.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
50043
50045
  moveColumnFromRowHeaderToBody(scene);
50044
50046
  moveColumnFromCornerHeaderToColHeader(scene);
50047
+ moveColumnFromLeftBottomCornerToBottom(scene);
50045
50048
  }
50046
50049
  }
50047
50050
  else if (scene.frozenColCount < scene.table.rowHeaderLevelCount) {
@@ -50051,6 +50054,7 @@
50051
50054
  for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.frozenColCount; i++) {
50052
50055
  moveColumnFromBodyToRowHeader(scene);
50053
50056
  moveColumnFromColHeaderToCornerHeader(scene);
50057
+ moveColumnFromBottomToLeftBottomCorner(scene);
50054
50058
  }
50055
50059
  }
50056
50060
  scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
@@ -50100,6 +50104,24 @@
50100
50104
  scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width);
50101
50105
  }
50102
50106
  }
50107
+ function moveColumnFromBottomToLeftBottomCorner(scene) {
50108
+ const column = scene.bottomFrozenGroup.firstChild instanceof Group ? scene.bottomFrozenGroup.firstChild : null;
50109
+ if (column) {
50110
+ scene.leftBottomCornerGroup.appendChild(column);
50111
+ scene.leftBottomCornerGroup.setAttribute('width', scene.leftBottomCornerGroup.attribute.width + column.attribute.width);
50112
+ scene.bottomFrozenGroup.setAttribute('width', scene.bottomFrozenGroup.attribute.width - column.attribute.width);
50113
+ }
50114
+ }
50115
+ function moveColumnFromLeftBottomCornerToBottom(scene) {
50116
+ const column = scene.leftBottomCornerGroup.lastChild instanceof Group
50117
+ ? scene.leftBottomCornerGroup.lastChild
50118
+ : scene.leftBottomCornerGroup.lastChild?._prev;
50119
+ if (column) {
50120
+ insertBefore(scene.bottomFrozenGroup, column, scene.bottomFrozenGroup.firstChild);
50121
+ scene.bottomFrozenGroup.setAttribute('width', scene.bottomFrozenGroup.attribute.width + column.attribute.width);
50122
+ scene.leftBottomCornerGroup.setAttribute('width', scene.leftBottomCornerGroup.attribute.width - column.attribute.width);
50123
+ }
50124
+ }
50103
50125
  function dealRightFrozen(distRightFrozenCol, scene) {
50104
50126
  const { table, proxy, rightTopCornerGroup, rightFrozenGroup, rightBottomCornerGroup, bottomFrozenGroup, bodyGroup, colHeaderGroup } = scene;
50105
50127
  const currentRightFrozenCol = scene.table.rightFrozenColCount;
@@ -52060,8 +52082,8 @@
52060
52082
  { x: 0, y: max },
52061
52083
  { x: 0, y: min }
52062
52084
  ],
52063
- lineWidth: line.hover.strokeWidth,
52064
- stroke: line.hover.stroke
52085
+ lineWidth: line.hover?.strokeWidth,
52086
+ stroke: line.hover?.stroke
52065
52087
  });
52066
52088
  highlightLine.name = 'highlight-line';
52067
52089
  sparkline.addChild(highlightLine);
@@ -55283,6 +55305,9 @@
55283
55305
  if (this._table.isPivotTable() || this._table.transpose) {
55284
55306
  return null;
55285
55307
  }
55308
+ if (this._table.rightFrozenColCount && col >= this._table.colCount - this._table.rightFrozenColCount) {
55309
+ return null;
55310
+ }
55286
55311
  const headerC = this._table.getHeaderDefine(col, row);
55287
55312
  if (headerC.columns && headerC.columns.length > 0) {
55288
55313
  return null;
@@ -57300,7 +57325,7 @@
57300
57325
  return TABLE_EVENT_TYPE;
57301
57326
  }
57302
57327
  options;
57303
- version = "0.10.2";
57328
+ version = "0.10.3-alpha.0";
57304
57329
  pagination;
57305
57330
  id = `VTable${Date.now()}`;
57306
57331
  headerStyleCache;
@@ -59511,7 +59536,7 @@
59511
59536
  const data = layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
59512
59537
  ? layout.dataset.collectedValues[key + (isZeroAlign ? '_align' : '')]
59513
59538
  : layout.dataset.collectedValues[key];
59514
- const range = data?.[layout.getRowKeysPath()[rowIndex][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]] ?? { min: 0, max: 1 };
59539
+ const range = data?.[layout.getRowKeysPath()[rowIndex]?.[Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)] ?? ''] ?? { min: 0, max: 1 };
59515
59540
  const axisOption = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);
59516
59541
  if (axisOption?.zero) {
59517
59542
  range.min = Math.min(range.min, 0);
@@ -59539,7 +59564,7 @@
59539
59564
  [];
59540
59565
  const recordCol = layout.getRecordIndexByCol(col);
59541
59566
  const colPath = layout.getColKeysPath()[recordCol];
59542
- const domain = data?.[colPath[colPath.length - 1]] ?? [];
59567
+ const domain = data?.[colPath?.[colPath?.length - 1] ?? ''] ?? [];
59543
59568
  const axisOption = getAxisOption(col, row, 'bottom', layout);
59544
59569
  axes.push(merge$2({
59545
59570
  domain: Array.from(domain)
@@ -61047,8 +61072,8 @@
61047
61072
  if (indicatorInfo.customRender) {
61048
61073
  hd.customRender = indicatorInfo.customRender;
61049
61074
  }
61050
- if (!isValid$1(this._indicators.find(indicator => indicator.indicatorKey === indicatorInfo.indicatorKey))) {
61051
- this._indicators.push({
61075
+ if (!isValid$1(this._indicators?.find(indicator => indicator.indicatorKey === indicatorInfo.indicatorKey))) {
61076
+ this._indicators?.push({
61052
61077
  id: ++seqId,
61053
61078
  indicatorKey: indicatorInfo.indicatorKey,
61054
61079
  field: indicatorInfo.indicatorKey,
@@ -61070,8 +61095,8 @@
61070
61095
  }
61071
61096
  }
61072
61097
  else if (hd.indicatorKey) {
61073
- if (!isValid$1(this._indicators.find(indicator => indicator.indicatorKey === hd.indicatorKey))) {
61074
- this._indicators.push({
61098
+ if (!isValid$1(this._indicators?.find(indicator => indicator.indicatorKey === hd.indicatorKey))) {
61099
+ this._indicators?.push({
61075
61100
  id: ++seqId,
61076
61101
  indicatorKey: hd.indicatorKey,
61077
61102
  field: hd.indicatorKey,
@@ -61274,7 +61299,7 @@
61274
61299
  let maxWidth;
61275
61300
  let minWidth;
61276
61301
  let isAuto;
61277
- this._indicators.forEach((obj, index) => {
61302
+ this._indicators?.forEach((obj, index) => {
61278
61303
  if (typeof obj.width === 'number') {
61279
61304
  width = Math.max(obj.width, width);
61280
61305
  }
@@ -61580,7 +61605,7 @@
61580
61605
  const paths = this.getCellHeaderPaths(_col, _row);
61581
61606
  if (this.indicatorsAsCol) {
61582
61607
  const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;
61583
- return (this._indicators.find(indicator => indicator.indicatorKey === indicatorKey) ??
61608
+ return (this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey) ??
61584
61609
  this._indicators[0] ?? {
61585
61610
  id: '',
61586
61611
  field: undefined,
@@ -61590,7 +61615,7 @@
61590
61615
  });
61591
61616
  }
61592
61617
  const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
61593
- return (this._indicators.find(indicator => indicator.indicatorKey === indicatorKey) ??
61618
+ return (this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey) ??
61594
61619
  this._indicators[0] ?? {
61595
61620
  id: '',
61596
61621
  field: undefined,
@@ -62158,11 +62183,11 @@
62158
62183
  let indicatorObj;
62159
62184
  if (this.indicatorsAsCol) {
62160
62185
  const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;
62161
- indicatorObj = this._indicators.find(indicator => indicator.indicatorKey === indicatorKey);
62186
+ indicatorObj = this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey);
62162
62187
  }
62163
62188
  else {
62164
62189
  const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
62165
- indicatorObj = this._indicators.find(indicator => indicator.indicatorKey === indicatorKey);
62190
+ indicatorObj = this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey);
62166
62191
  }
62167
62192
  indicatorObj && (indicatorObj.chartInstance = chartInstance);
62168
62193
  }
@@ -62171,11 +62196,11 @@
62171
62196
  let indicatorObj;
62172
62197
  if (this.indicatorsAsCol) {
62173
62198
  const indicatorKey = paths.colHeaderPaths.find(colPath => colPath.indicatorKey)?.indicatorKey;
62174
- indicatorObj = this._indicators.find(indicator => indicator.indicatorKey === indicatorKey);
62199
+ indicatorObj = this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey);
62175
62200
  }
62176
62201
  else {
62177
62202
  const indicatorKey = paths.rowHeaderPaths.find(rowPath => rowPath.indicatorKey)?.indicatorKey;
62178
- indicatorObj = this._indicators.find(indicator => indicator.indicatorKey === indicatorKey);
62203
+ indicatorObj = this._indicators?.find(indicator => indicator.indicatorKey === indicatorKey);
62179
62204
  }
62180
62205
  return indicatorObj?.chartInstance;
62181
62206
  }
@@ -62205,7 +62230,7 @@
62205
62230
  release() {
62206
62231
  const activeChartInstance = this._table._getActiveChartInstance();
62207
62232
  activeChartInstance?.release();
62208
- this._indicators.forEach(indicatorObject => {
62233
+ this._indicators?.forEach(indicatorObject => {
62209
62234
  indicatorObject.chartInstance?.release();
62210
62235
  });
62211
62236
  }
@@ -62997,7 +63022,7 @@
62997
63022
  if (this.indicatorsAsCol) {
62998
63023
  return this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length];
62999
63024
  }
63000
- return this.convertColKeys[this.convertColKeys.length - 1][Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length)];
63025
+ return this.convertColKeys[this.convertColKeys.length - 1]?.[Math.floor((col - this.rowHeaderLevelCount) / this.indicatorKeys.length)];
63001
63026
  }
63002
63027
  }
63003
63028
  return 0;
@@ -63139,6 +63164,9 @@
63139
63164
  if (colHeaderPaths && this.showColumnHeader && row < this.columns.length - 1) {
63140
63165
  colHeaderPaths = colHeaderPaths.slice(0, row + 1);
63141
63166
  }
63167
+ else if (!colHeaderPaths) {
63168
+ colHeaderPaths = [];
63169
+ }
63142
63170
  }
63143
63171
  if (recordRow >= 0) {
63144
63172
  rowPath = this.rowKeysPath[recordRow];
@@ -63146,6 +63174,9 @@
63146
63174
  if (rowHeaderPaths && this.showRowHeader && col < this.rows.length - 1) {
63147
63175
  rowHeaderPaths = rowHeaderPaths.slice(0, col + 1);
63148
63176
  }
63177
+ else if (!rowHeaderPaths) {
63178
+ rowHeaderPaths = [];
63179
+ }
63149
63180
  }
63150
63181
  if (colHeaderPaths && this.indicatorsAsCol && col >= this.rowHeaderLevelCount) {
63151
63182
  colHeaderPaths.push(this.indicatorKeys[(col - this.rowHeaderLevelCount) % this.indicatorKeys.length]);
@@ -63551,7 +63582,7 @@
63551
63582
  colKey.push(record[colAttr]);
63552
63583
  }
63553
63584
  }
63554
- this.dataConfig.indicators.forEach((indicatorKey) => {
63585
+ this.dataConfig.indicators?.forEach((indicatorKey) => {
63555
63586
  const recordValue = record[indicatorKey];
63556
63587
  if (recordValue !== undefined) {
63557
63588
  if (this.dataConfig.indicatorsAsCol) {
@@ -64204,6 +64235,9 @@
64204
64235
  const dimensionIndex = this.columns.indexOf(dimension);
64205
64236
  this.colsIsTotal[dimensionIndex] = true;
64206
64237
  }
64238
+ this.rowKeysPath = [];
64239
+ this.rowKeysPath_FULL = [];
64240
+ this.colKeysPath = [];
64207
64241
  if (records) {
64208
64242
  this.records = records;
64209
64243
  const t0 = typeof window !== 'undefined' ? window.performance.now() : 0;
@@ -64411,17 +64445,17 @@
64411
64445
  }
64412
64446
  else if (aggRule?.field) {
64413
64447
  if (typeof aggRule?.field === 'string') {
64414
- isValid$1(record[aggRule?.field]) && this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
64448
+ aggRule?.field in record && this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
64415
64449
  }
64416
64450
  else {
64417
64451
  const isPush = aggRule?.field.find((field) => {
64418
- return record[field];
64452
+ return field in record;
64419
64453
  });
64420
64454
  isPush && this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
64421
64455
  }
64422
64456
  }
64423
64457
  else {
64424
- isValid$1(record[this.indicatorKeys[i]]) && this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
64458
+ this.indicatorKeys[i] in record && this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
64425
64459
  }
64426
64460
  }
64427
64461
  }
@@ -64923,8 +64957,8 @@
64923
64957
  this.internalProps.columnResizeType = options.columnResizeType ?? 'column';
64924
64958
  this.internalProps.dataConfig = options.dataConfig;
64925
64959
  this.internalProps.enableDataAnalysis = options.enableDataAnalysis;
64926
- if (this.internalProps.enableDataAnalysis && (options.rows || options.columns)) {
64927
- const rowKeys = options.rows.reduce((keys, rowObj) => {
64960
+ if (this.internalProps.enableDataAnalysis) {
64961
+ const rowKeys = options.rows?.reduce((keys, rowObj) => {
64928
64962
  if (typeof rowObj === 'string') {
64929
64963
  keys.push(rowObj);
64930
64964
  }
@@ -64932,8 +64966,8 @@
64932
64966
  keys.push(rowObj.dimensionKey);
64933
64967
  }
64934
64968
  return keys;
64935
- }, []);
64936
- const columnKeys = options.columns.reduce((keys, columnObj) => {
64969
+ }, []) ?? [];
64970
+ const columnKeys = options.columns?.reduce((keys, columnObj) => {
64937
64971
  if (typeof columnObj === 'string') {
64938
64972
  keys.push(columnObj);
64939
64973
  }
@@ -64941,7 +64975,7 @@
64941
64975
  keys.push(columnObj.dimensionKey);
64942
64976
  }
64943
64977
  return keys;
64944
- }, []);
64978
+ }, []) ?? [];
64945
64979
  const indicatorKeys = options.indicators?.reduce((keys, indicatorObj) => {
64946
64980
  if (typeof indicatorObj === 'string') {
64947
64981
  keys.push(indicatorObj);
@@ -65026,7 +65060,7 @@
65026
65060
  }
65027
65061
  return keys;
65028
65062
  }, []);
65029
- const indicatorKeys = options.indicators.reduce((keys, indicatorObj) => {
65063
+ const indicatorKeys = options.indicators?.reduce((keys, indicatorObj) => {
65030
65064
  if (typeof indicatorObj === 'string') {
65031
65065
  keys.push(indicatorObj);
65032
65066
  }
@@ -65391,39 +65425,37 @@
65391
65425
  this.internalProps.columnResizeType = options.columnResizeType ?? 'column';
65392
65426
  this.internalProps.dataConfig = { isPivotChart: true };
65393
65427
  this._axes = isArray(options.axes) ? options.axes : [];
65394
- if (options.rows || options.columns) {
65395
- const rowKeys = options.rows.reduce((keys, rowObj) => {
65396
- if (typeof rowObj === 'string') {
65397
- keys.push(rowObj);
65398
- }
65399
- else {
65400
- keys.push(rowObj.dimensionKey);
65401
- }
65402
- return keys;
65403
- }, []);
65404
- const columnKeys = options.columns.reduce((keys, columnObj) => {
65405
- if (typeof columnObj === 'string') {
65406
- keys.push(columnObj);
65407
- }
65408
- else {
65409
- keys.push(columnObj.dimensionKey);
65410
- }
65411
- return keys;
65412
- }, []);
65413
- const indicatorKeys = options.indicators?.reduce((keys, indicatorObj) => {
65414
- if (typeof indicatorObj === 'string') {
65415
- keys.push(indicatorObj);
65416
- }
65417
- else {
65418
- keys.push(indicatorObj.indicatorKey);
65419
- }
65420
- return keys;
65421
- }, []) ?? [];
65422
- this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys);
65423
- this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules();
65424
- this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray();
65425
- this.dataset = new Dataset(this.internalProps.dataConfig, null, rowKeys, columnKeys, indicatorKeys, options.records, options.columnTree, options.rowTree);
65426
- }
65428
+ const rowKeys = options.rows?.reduce((keys, rowObj) => {
65429
+ if (typeof rowObj === 'string') {
65430
+ keys.push(rowObj);
65431
+ }
65432
+ else {
65433
+ keys.push(rowObj.dimensionKey);
65434
+ }
65435
+ return keys;
65436
+ }, []) ?? [];
65437
+ const columnKeys = options.columns?.reduce((keys, columnObj) => {
65438
+ if (typeof columnObj === 'string') {
65439
+ keys.push(columnObj);
65440
+ }
65441
+ else {
65442
+ keys.push(columnObj.dimensionKey);
65443
+ }
65444
+ return keys;
65445
+ }, []) ?? [];
65446
+ const indicatorKeys = options.indicators?.reduce((keys, indicatorObj) => {
65447
+ if (typeof indicatorObj === 'string') {
65448
+ keys.push(indicatorObj);
65449
+ }
65450
+ else {
65451
+ keys.push(indicatorObj.indicatorKey);
65452
+ }
65453
+ return keys;
65454
+ }, []) ?? [];
65455
+ this.internalProps.dataConfig.collectValuesBy = this._generateCollectValuesConfig(columnKeys, rowKeys);
65456
+ this.internalProps.dataConfig.aggregationRules = this._generateAggregationRules();
65457
+ this.internalProps.dataConfig.dimensionSortArray = this._getDimensionSortArray();
65458
+ this.dataset = new Dataset(this.internalProps.dataConfig, null, rowKeys, columnKeys, indicatorKeys, options.records, options.columnTree, options.rowTree);
65427
65459
  this.refreshHeader();
65428
65460
  if (options.dataSource) {
65429
65461
  _setDataSource(this, options.dataSource);
@@ -65488,7 +65520,7 @@
65488
65520
  }
65489
65521
  return keys;
65490
65522
  }, []);
65491
- const indicatorKeys = options.indicators.reduce((keys, indicatorObj) => {
65523
+ const indicatorKeys = options.indicators?.reduce((keys, indicatorObj) => {
65492
65524
  if (typeof indicatorObj === 'string') {
65493
65525
  keys.push(indicatorObj);
65494
65526
  }
@@ -65763,7 +65795,7 @@
65763
65795
  _generateCollectValuesConfig(columnKeys, rowKeys) {
65764
65796
  const option = this.options;
65765
65797
  const collectValuesBy = {};
65766
- for (let i = 0, len = option.indicators.length; i < len; i++) {
65798
+ for (let i = 0, len = option.indicators?.length; i < len; i++) {
65767
65799
  if (typeof option.indicators[i] !== 'string' && option.indicators[i].chartSpec) {
65768
65800
  if (option.indicatorsAsCol === false) {
65769
65801
  const indicatorDefine = option.indicators[i];
@@ -65881,7 +65913,7 @@
65881
65913
  }
65882
65914
  _generateAggregationRules() {
65883
65915
  const aggregationRules = [];
65884
- this.options.indicators.forEach((indicator) => {
65916
+ this.options.indicators?.forEach((indicator) => {
65885
65917
  if (typeof indicator === 'string') {
65886
65918
  aggregationRules.push({
65887
65919
  indicatorKey: indicator,
@@ -65945,7 +65977,7 @@
65945
65977
  delete spec.area.state.selected_reverse;
65946
65978
  }
65947
65979
  };
65948
- this.options.indicators.forEach((indicator) => {
65980
+ this.options.indicators?.forEach((indicator) => {
65949
65981
  if (indicator.chartSpec) {
65950
65982
  const spec = indicator.chartSpec;
65951
65983
  if (spec.series) {
@@ -66660,7 +66692,7 @@
66660
66692
  percentCalc: percentCalc
66661
66693
  });
66662
66694
 
66663
- const version = "0.10.2";
66695
+ const version = "0.10.3-alpha.0";
66664
66696
  function getIcons() {
66665
66697
  return get$1();
66666
66698
  }