@visactor/vtable 0.9.3-alpha.3 → 0.9.3-alpha.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 (99) hide show
  1. package/cjs/ListTable.js +3 -4
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.d.ts +4 -4
  4. package/cjs/PivotChart.js +18 -17
  5. package/cjs/PivotChart.js.map +1 -1
  6. package/cjs/PivotTable.js +6 -7
  7. package/cjs/PivotTable.js.map +1 -1
  8. package/cjs/components/axis/axis.js +1 -1
  9. package/cjs/components/axis/axis.js.map +1 -1
  10. package/cjs/components/legend/legend.js +3 -3
  11. package/cjs/components/legend/legend.js.map +1 -1
  12. package/cjs/components/title/title.js +3 -3
  13. package/cjs/components/title/title.js.map +1 -1
  14. package/cjs/core/BaseTable.d.ts +1 -1
  15. package/cjs/core/BaseTable.js +5 -4
  16. package/cjs/core/BaseTable.js.map +1 -1
  17. package/cjs/dataset/dataset.d.ts +4 -4
  18. package/cjs/dataset/dataset.js +16 -13
  19. package/cjs/dataset/dataset.js.map +1 -1
  20. package/cjs/index.d.ts +1 -1
  21. package/cjs/index.js +1 -1
  22. package/cjs/index.js.map +1 -1
  23. package/cjs/layout/chart-helper/get-axis-config.d.ts +1 -0
  24. package/cjs/layout/chart-helper/get-axis-config.js +18 -9
  25. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  26. package/cjs/layout/chart-helper/get-chart-spec.js +13 -7
  27. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  28. package/cjs/layout/pivot-layout.d.ts +1 -0
  29. package/cjs/layout/pivot-layout.js +11 -0
  30. package/cjs/layout/pivot-layout.js.map +1 -1
  31. package/cjs/scenegraph/graphic/chart.d.ts +6 -6
  32. package/cjs/scenegraph/graphic/chart.js +16 -2
  33. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  34. package/cjs/scenegraph/graphic/contributions/chart-render.js +1 -1
  35. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  36. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +0 -6
  37. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  38. package/cjs/scenegraph/group-creater/progress/proxy.js +2 -1
  39. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  40. package/cjs/scenegraph/layout/compute-row-height.js +10 -2
  41. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  42. package/cjs/scenegraph/refresh-node/update-chart.js +1 -7
  43. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  44. package/cjs/scenegraph/scenegraph.js.map +1 -1
  45. package/cjs/ts-types/base-table.d.ts +8 -3
  46. package/cjs/ts-types/base-table.js.map +1 -1
  47. package/cjs/ts-types/table-engine.d.ts +6 -1
  48. package/cjs/ts-types/table-engine.js.map +1 -1
  49. package/dist/vtable.js +327 -281
  50. package/dist/vtable.min.js +2 -2
  51. package/es/ListTable.js +3 -3
  52. package/es/ListTable.js.map +1 -1
  53. package/es/PivotChart.d.ts +4 -4
  54. package/es/PivotChart.js +18 -16
  55. package/es/PivotChart.js.map +1 -1
  56. package/es/PivotTable.js +6 -6
  57. package/es/PivotTable.js.map +1 -1
  58. package/es/components/axis/axis.js +1 -1
  59. package/es/components/axis/axis.js.map +1 -1
  60. package/es/components/legend/legend.js +3 -3
  61. package/es/components/legend/legend.js.map +1 -1
  62. package/es/components/title/title.js +3 -3
  63. package/es/components/title/title.js.map +1 -1
  64. package/es/core/BaseTable.d.ts +1 -1
  65. package/es/core/BaseTable.js +5 -4
  66. package/es/core/BaseTable.js.map +1 -1
  67. package/es/dataset/dataset.d.ts +4 -4
  68. package/es/dataset/dataset.js +15 -12
  69. package/es/dataset/dataset.js.map +1 -1
  70. package/es/index.d.ts +1 -1
  71. package/es/index.js +1 -1
  72. package/es/index.js.map +1 -1
  73. package/es/layout/chart-helper/get-axis-config.d.ts +1 -0
  74. package/es/layout/chart-helper/get-axis-config.js +16 -7
  75. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  76. package/es/layout/chart-helper/get-chart-spec.js +10 -6
  77. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  78. package/es/layout/pivot-layout.d.ts +1 -0
  79. package/es/layout/pivot-layout.js +11 -0
  80. package/es/layout/pivot-layout.js.map +1 -1
  81. package/es/scenegraph/graphic/chart.d.ts +6 -6
  82. package/es/scenegraph/graphic/chart.js +16 -2
  83. package/es/scenegraph/graphic/chart.js.map +1 -1
  84. package/es/scenegraph/graphic/contributions/chart-render.js +1 -1
  85. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  86. package/es/scenegraph/group-creater/cell-type/chart-cell.js +0 -6
  87. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  88. package/es/scenegraph/group-creater/progress/proxy.js +2 -1
  89. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  90. package/es/scenegraph/layout/compute-row-height.js +10 -2
  91. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  92. package/es/scenegraph/refresh-node/update-chart.js +1 -7
  93. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  94. package/es/scenegraph/scenegraph.js.map +1 -1
  95. package/es/ts-types/base-table.d.ts +8 -3
  96. package/es/ts-types/base-table.js.map +1 -1
  97. package/es/ts-types/table-engine.d.ts +6 -1
  98. package/es/ts-types/table-engine.js.map +1 -1
  99. package/package.json +10 -10
package/dist/vtable.js CHANGED
@@ -36525,7 +36525,7 @@
36525
36525
  this.table = table;
36526
36526
  this.width = width;
36527
36527
  this.height = height;
36528
- this.option = merge$2({}, option, commonAxis);
36528
+ this.option = merge$2({}, commonAxis, option);
36529
36529
  this.orient = option.orient ?? 'left';
36530
36530
  this.visible = option.visible ?? true;
36531
36531
  this.type = option.type ?? 'band';
@@ -41643,7 +41643,7 @@
41643
41643
  renderCanvas: params.canvas,
41644
41644
  mode: 'desktop-browser',
41645
41645
  canvasControled: false,
41646
- viewBox: params.viewBox,
41646
+ viewBox: { x1: 0, x2: 0, y1: 0, y2: 0 },
41647
41647
  interactive: false,
41648
41648
  animation: false
41649
41649
  });
@@ -41655,7 +41655,7 @@
41655
41655
  }
41656
41656
  activate(table) {
41657
41657
  this.active = true;
41658
- const { x1, y1, x2, y2 } = this.attribute.viewBox;
41658
+ const { x1, y1, x2, y2 } = this.getViewBox();
41659
41659
  const tableBound = table.scenegraph.tableGroup.globalAABBBounds;
41660
41660
  const bodyBound = new Bounds();
41661
41661
  bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
@@ -41723,6 +41723,17 @@
41723
41723
  updateData(data) {
41724
41724
  this.attribute.data = data;
41725
41725
  }
41726
+ getViewBox() {
41727
+ const cellGroup = this.parent;
41728
+ const padding = this.attribute.cellPadding;
41729
+ const table = this.stage.table;
41730
+ return {
41731
+ x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
41732
+ x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
41733
+ y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
41734
+ y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
41735
+ };
41736
+ }
41726
41737
  }
41727
41738
 
41728
41739
  const ChartRender = Symbol.for('ChartRender');
@@ -41731,7 +41742,8 @@
41731
41742
  numberType = CHART_NUMBER_TYPE;
41732
41743
  drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
41733
41744
  const groupAttribute = getTheme(chart, params?.theme).group;
41734
- const { dataId, data, viewBox } = chart.attribute;
41745
+ const { dataId, data } = chart.attribute;
41746
+ const viewBox = chart.getViewBox();
41735
41747
  const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
41736
41748
  const { chartInstance, active, cacheCanvas, activeChartInstance } = chart;
41737
41749
  if (!active && cacheCanvas) {
@@ -42697,7 +42709,7 @@
42697
42709
  });
42698
42710
  function computeRowsHeight(table, rowStart, rowEnd) {
42699
42711
  const time = typeof window !== 'undefined' ? window.performance.now() : 0;
42700
- if (table.heightMode === 'autoHeight') {
42712
+ if (table.heightMode === 'autoHeight' || table.heightMode === 'adaptive') {
42701
42713
  rowStart = rowStart ?? 0;
42702
42714
  rowEnd = rowEnd ?? table.rowCount - 1;
42703
42715
  if (rowStart === 0 && rowEnd === table.rowCount - 1) {
@@ -42738,7 +42750,7 @@
42738
42750
  }
42739
42751
  }
42740
42752
  }
42741
- else if (table.heightMode === 'adaptive') {
42753
+ if (table.heightMode === 'adaptive') {
42742
42754
  table._clearRowRangeHeightsMap();
42743
42755
  const totalDrawHeight = table.tableNoFrameHeight - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();
42744
42756
  let actualHeight = 0;
@@ -42762,6 +42774,17 @@
42762
42774
  }
42763
42775
  function computeRowHeight(row, startCol, endCol, table) {
42764
42776
  let maxHeight = 0;
42777
+ if (table.isPivotChart() && row >= table.columnHeaderLevelCount) {
42778
+ if (table.internalProps.layoutMap.indicatorsAsCol) {
42779
+ const optimunHeight = table.internalProps.layoutMap.getOptimunHeightForChart(row);
42780
+ if (optimunHeight > 0) {
42781
+ return optimunHeight;
42782
+ }
42783
+ }
42784
+ else {
42785
+ return table.getRowHeight(row);
42786
+ }
42787
+ }
42765
42788
  for (let col = startCol; col <= endCol; col++) {
42766
42789
  const customHeight = computeCustomRenderHeight(col, row, table);
42767
42790
  if (typeof customHeight === 'number') {
@@ -42972,12 +42995,6 @@
42972
42995
  dataId,
42973
42996
  data: table.getCellValue(col, row),
42974
42997
  cellPadding: padding,
42975
- viewBox: {
42976
- x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
42977
- x2: Math.ceil(cellGroup.globalAABBBounds.x1 + width - padding[1] + table.scrollLeft),
42978
- y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
42979
- y2: Math.ceil(cellGroup.globalAABBBounds.y1 + height - padding[2] + table.scrollTop)
42980
- },
42981
42998
  axes: table.internalProps.layoutMap.getChartAxes(col, row)
42982
42999
  });
42983
43000
  cellGroup.appendChild(chartGroup);
@@ -44005,6 +44022,10 @@
44005
44022
  cellCache = new Map();
44006
44023
  constructor(table) {
44007
44024
  this.table = table;
44025
+ if (this.table.isPivotChart()) {
44026
+ this.rowLimit = 100;
44027
+ this.colLimit = 100;
44028
+ }
44008
44029
  if (this.table.internalProps.transpose) {
44009
44030
  this.mode = 'row';
44010
44031
  }
@@ -44931,12 +44952,6 @@
44931
44952
  node.cacheCanvas = null;
44932
44953
  node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
44933
44954
  node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
44934
- node.setAttribute('viewBox', {
44935
- x1: Math.ceil(cellNode.globalAABBBounds.x1 + node.attribute.cellPadding[3] + scenegraph.table.scrollLeft),
44936
- x2: Math.ceil(cellNode.globalAABBBounds.x1 + width - node.attribute.cellPadding[1] + scenegraph.table.scrollLeft),
44937
- y1: Math.ceil(cellNode.globalAABBBounds.y1 + node.attribute.cellPadding[0] + scenegraph.table.scrollTop),
44938
- y2: Math.ceil(cellNode.globalAABBBounds.y1 + height - node.attribute.cellPadding[2] + scenegraph.table.scrollTop)
44939
- });
44940
44955
  }
44941
44956
  });
44942
44957
  });
@@ -51166,11 +51181,11 @@
51166
51181
  });
51167
51182
  if (this.orient === 'left') {
51168
51183
  this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);
51169
- this.table.tableX = Math.ceil(width);
51184
+ this.table.tableX += Math.ceil(width);
51170
51185
  }
51171
51186
  else if (this.orient === 'top') {
51172
51187
  this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);
51173
- this.table.tableY = Math.ceil(height);
51188
+ this.table.tableY += Math.ceil(height);
51174
51189
  }
51175
51190
  else if (this.orient === 'right') {
51176
51191
  this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);
@@ -51221,6 +51236,7 @@
51221
51236
  };
51222
51237
  }
51223
51238
  dispose() {
51239
+ this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent);
51224
51240
  this.legendComponent = null;
51225
51241
  }
51226
51242
  }
@@ -51267,11 +51283,11 @@
51267
51283
  }
51268
51284
  if (this._titleOption.orient === 'left') {
51269
51285
  this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);
51270
- this.table.tableX = Math.ceil(width);
51286
+ this.table.tableX += Math.ceil(width);
51271
51287
  }
51272
51288
  else if (this._titleOption.orient === 'top') {
51273
51289
  this.table.tableNoFrameHeight = this.table.tableNoFrameHeight - Math.ceil(height);
51274
- this.table.tableY = Math.ceil(height);
51290
+ this.table.tableY += Math.ceil(height);
51275
51291
  }
51276
51292
  else if (this._titleOption.orient === 'right') {
51277
51293
  this.table.tableNoFrameWidth = this.table.tableNoFrameWidth - Math.ceil(width);
@@ -51293,6 +51309,7 @@
51293
51309
  return this._titleComponent;
51294
51310
  }
51295
51311
  dispose() {
51312
+ this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent);
51296
51313
  this._titleComponent = null;
51297
51314
  }
51298
51315
  _getTitleAttrs() {
@@ -51360,7 +51377,7 @@
51360
51377
  return TABLE_EVENT_TYPE;
51361
51378
  }
51362
51379
  options;
51363
- version = "0.9.3-alpha.3";
51380
+ version = "0.9.3-alpha.4";
51364
51381
  pagerConf;
51365
51382
  id = `VTable${Date.now()}`;
51366
51383
  headerStyleCache;
@@ -52422,6 +52439,9 @@
52422
52439
  this.dataSet = new DataSet();
52423
52440
  this.scenegraph.clearCells();
52424
52441
  this.stateManeger.initState();
52442
+ this._updateSize();
52443
+ this.internalProps.legends?.dispose();
52444
+ this.internalProps.title?.dispose();
52425
52445
  if (options.legends) {
52426
52446
  internalProps.legends = new TableLegend(options.legends, this);
52427
52447
  this.scenegraph.tableGroup.setAttributes({
@@ -52675,7 +52695,7 @@
52675
52695
  return this.internalProps.layoutMap.columnHeaderLevelCount;
52676
52696
  }
52677
52697
  get records() {
52678
- return this.internalProps.records || null;
52698
+ return this.internalProps.records;
52679
52699
  }
52680
52700
  get dataSource() {
52681
52701
  return this.internalProps.dataSource;
@@ -53502,6 +53522,219 @@
53502
53522
  numberFormat: numberFormat
53503
53523
  });
53504
53524
 
53525
+ function getAxisConfigInPivotChart(col, row, layout) {
53526
+ if (!layout._table.isPivotChart()) {
53527
+ return undefined;
53528
+ }
53529
+ if (layout.indicatorsAsCol) {
53530
+ if (layout.hasTwoIndicatorAxes &&
53531
+ row === layout.columnHeaderLevelCount - 1 &&
53532
+ col >= layout.rowHeaderLevelCount &&
53533
+ col < layout.colCount - layout.rightFrozenColCount) {
53534
+ const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, layout.columnHeaderLevelCount - 1);
53535
+ let defaultKey = indicatorKeys[1];
53536
+ if (isArray$3(defaultKey)) {
53537
+ defaultKey = defaultKey[0];
53538
+ }
53539
+ if (!defaultKey) {
53540
+ return undefined;
53541
+ }
53542
+ const data = layout.dataset.collectedValues[defaultKey + '_align']
53543
+ ? layout.dataset.collectedValues[defaultKey + '_align']
53544
+ : layout.dataset.collectedValues[defaultKey];
53545
+ const index = layout.getRecordIndexByCol(col);
53546
+ const range = data[layout.getColKeysPath()[index][Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]];
53547
+ const axisOption = getAxisOption(col, row, 'top', layout);
53548
+ if (axisOption?.visible === false) {
53549
+ return;
53550
+ }
53551
+ return merge$2({}, axisOption, {
53552
+ orient: 'top',
53553
+ type: 'linear',
53554
+ range: range,
53555
+ label: {
53556
+ flush: true
53557
+ },
53558
+ title: {
53559
+ visible: false
53560
+ }
53561
+ });
53562
+ }
53563
+ else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
53564
+ col >= layout.rowHeaderLevelCount &&
53565
+ col < layout.colCount - layout.rightFrozenColCount) {
53566
+ const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
53567
+ let defaultKey = indicatorKeys[0];
53568
+ if (isArray$3(defaultKey)) {
53569
+ defaultKey = defaultKey[0];
53570
+ }
53571
+ const data = layout.dataset.collectedValues[defaultKey + '_align']
53572
+ ? layout.dataset.collectedValues[defaultKey + '_align']
53573
+ : layout.dataset.collectedValues[defaultKey];
53574
+ const index = layout.getRecordIndexByCol(col);
53575
+ const range = data[layout.getColKeysPath()[index][Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]];
53576
+ let indicatorInfo = null;
53577
+ indicatorKeys.forEach(key => {
53578
+ const info = layout.getIndicatorInfo(key);
53579
+ if (info) {
53580
+ indicatorInfo = info;
53581
+ }
53582
+ });
53583
+ const axisOption = getAxisOption(col, row, 'bottom', layout);
53584
+ if (axisOption?.visible === false) {
53585
+ return;
53586
+ }
53587
+ return merge$2({}, axisOption, {
53588
+ orient: 'bottom',
53589
+ type: 'linear',
53590
+ range: range,
53591
+ label: {
53592
+ flush: true
53593
+ },
53594
+ title: {
53595
+ text: indicatorInfo?.caption,
53596
+ autoRotate: true
53597
+ }
53598
+ });
53599
+ }
53600
+ else if (col === layout.rowHeaderLevelCount - 1 &&
53601
+ row >= layout.columnHeaderLevelCount &&
53602
+ row < layout.rowCount - layout.bottomFrozenRowCount) {
53603
+ let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row)[0];
53604
+ if (isArray$3(rowDimensionKey)) {
53605
+ rowDimensionKey = rowDimensionKey[0];
53606
+ }
53607
+ const data = layout.dataset.collectedValues[rowDimensionKey];
53608
+ const recordRow = layout.getRecordIndexByRow(row);
53609
+ const rowPath = layout.getRowKeysPath()[recordRow];
53610
+ const domain = data[rowPath[rowPath.length - 1]];
53611
+ const axisOption = getAxisOption(col, row, 'left', layout);
53612
+ if (axisOption?.visible === false) {
53613
+ return;
53614
+ }
53615
+ return merge$2({}, axisOption, {
53616
+ orient: 'left',
53617
+ type: 'band',
53618
+ data: Array.from(domain).reverse(),
53619
+ title: {
53620
+ visible: false
53621
+ }
53622
+ });
53623
+ }
53624
+ }
53625
+ else {
53626
+ if (col === layout.rowHeaderLevelCount - 1 &&
53627
+ row >= layout.columnHeaderLevelCount &&
53628
+ row < layout.rowCount - layout.bottomFrozenRowCount) {
53629
+ const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
53630
+ let defaultKey = indicatorKeys[0];
53631
+ if (isArray$3(defaultKey)) {
53632
+ defaultKey = defaultKey[0];
53633
+ }
53634
+ const data = layout.dataset.collectedValues[defaultKey + '_align']
53635
+ ? layout.dataset.collectedValues[defaultKey + '_align']
53636
+ : layout.dataset.collectedValues[defaultKey];
53637
+ const index = layout.getRecordIndexByRow(row);
53638
+ const range = data[layout.getRowKeysPath()[index][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]];
53639
+ let indicatorInfo = null;
53640
+ indicatorKeys.forEach(key => {
53641
+ const info = layout.getIndicatorInfo(key);
53642
+ if (info) {
53643
+ indicatorInfo = info;
53644
+ }
53645
+ });
53646
+ const axisOption = getAxisOption(col, row, 'left', layout);
53647
+ if (axisOption?.visible === false) {
53648
+ return;
53649
+ }
53650
+ return merge$2({}, axisOption, {
53651
+ orient: 'left',
53652
+ type: 'linear',
53653
+ range: range,
53654
+ label: {
53655
+ flush: true
53656
+ },
53657
+ title: {
53658
+ text: indicatorInfo?.caption,
53659
+ autoRotate: true
53660
+ }
53661
+ });
53662
+ }
53663
+ else if (col === layout.colCount - layout.rightFrozenColCount &&
53664
+ row >= layout.columnHeaderLevelCount &&
53665
+ row < layout.rowCount - layout.bottomFrozenRowCount) {
53666
+ const indicatorKeys = layout.getIndicatorKeyInChartSpec(layout.rowHeaderLevelCount - 1, row);
53667
+ let defaultKey = indicatorKeys[1];
53668
+ if (isArray$3(defaultKey)) {
53669
+ defaultKey = defaultKey[0];
53670
+ }
53671
+ if (!defaultKey) {
53672
+ return undefined;
53673
+ }
53674
+ const data = layout.dataset.collectedValues[defaultKey + '_align']
53675
+ ? layout.dataset.collectedValues[defaultKey + '_align']
53676
+ : layout.dataset.collectedValues[defaultKey];
53677
+ const index = layout.getRecordIndexByRow(row);
53678
+ const range = data[layout.getRowKeysPath()[index][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]];
53679
+ const axisOption = getAxisOption(col, row, 'right', layout);
53680
+ if (axisOption?.visible === false) {
53681
+ return;
53682
+ }
53683
+ return merge$2({}, axisOption, {
53684
+ orient: 'right',
53685
+ type: 'linear',
53686
+ range: range,
53687
+ label: {
53688
+ flush: true
53689
+ },
53690
+ title: {
53691
+ visible: false
53692
+ }
53693
+ });
53694
+ }
53695
+ else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
53696
+ col >= layout.rowHeaderLevelCount &&
53697
+ col < layout.colCount - layout.rightFrozenColCount) {
53698
+ let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
53699
+ if (isArray$3(columnDimensionKey)) {
53700
+ columnDimensionKey = columnDimensionKey[0];
53701
+ }
53702
+ const data = layout.dataset.collectedValues[columnDimensionKey];
53703
+ const recordCol = layout.getRecordIndexByCol(col);
53704
+ const colPath = layout.getColKeysPath()[recordCol];
53705
+ const domain = data[colPath[colPath.length - 1]];
53706
+ const axisOption = getAxisOption(col, row, 'bottom', layout);
53707
+ if (axisOption?.visible === false) {
53708
+ return;
53709
+ }
53710
+ return merge$2({}, axisOption, {
53711
+ orient: 'bottom',
53712
+ type: 'band',
53713
+ data: Array.from(domain),
53714
+ title: {
53715
+ visible: false
53716
+ }
53717
+ });
53718
+ }
53719
+ }
53720
+ return undefined;
53721
+ }
53722
+ function getAxisOption(col, row, orient, layout) {
53723
+ const spec = layout.getRawChartSpec(col, row);
53724
+ if (spec && isArray$3(spec.axes)) {
53725
+ const axisOption = spec.axes.find((axis) => {
53726
+ return axis.orient === orient;
53727
+ });
53728
+ if (axisOption) {
53729
+ return axisOption;
53730
+ }
53731
+ }
53732
+ const axisOption = layout._table.pivotChartAxes.find(axisOption => {
53733
+ return axisOption.orient === orient;
53734
+ });
53735
+ return axisOption;
53736
+ }
53737
+
53505
53738
  function getRawChartSpec(col, row, layout) {
53506
53739
  const paths = layout.getCellHeaderPaths(col, row);
53507
53740
  let indicatorObj;
@@ -53539,16 +53772,15 @@
53539
53772
  ? layout.dataset.collectedValues[key + '_align']
53540
53773
  : layout.dataset.collectedValues[key];
53541
53774
  const range = data[layout.getColKeysPath()[colIndex][Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]];
53542
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
53543
- return axisOption.orient === (index === 0 ? 'bottom' : 'top');
53544
- });
53775
+ const axisOption = getAxisOption(col, row, index === 0 ? 'bottom' : 'top', layout);
53545
53776
  axes.push(merge$2({}, axisOption, {
53546
53777
  type: 'linear',
53547
53778
  orient: index === 0 ? 'bottom' : 'top',
53548
53779
  label: { visible: false },
53549
53780
  title: { visible: false },
53550
53781
  range,
53551
- seriesIndex: index
53782
+ seriesIndex: index,
53783
+ height: -1
53552
53784
  }));
53553
53785
  });
53554
53786
  let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, col)[0];
@@ -53559,9 +53791,7 @@
53559
53791
  const recordRow = layout.getRecordIndexByRow(row);
53560
53792
  const rowPath = layout.getRowKeysPath()[recordRow];
53561
53793
  const domain = data[rowPath[rowPath.length - 1]];
53562
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
53563
- return axisOption.orient === 'left';
53564
- });
53794
+ const axisOption = getAxisOption(col, row, 'left', layout);
53565
53795
  axes.push(merge$2({}, axisOption, {
53566
53796
  type: 'band',
53567
53797
  orient: 'left',
@@ -53585,16 +53815,15 @@
53585
53815
  ? layout.dataset.collectedValues[key + '_align']
53586
53816
  : layout.dataset.collectedValues[key];
53587
53817
  const range = data[layout.getRowKeysPath()[rowIndex][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]];
53588
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
53589
- return axisOption.orient === (index === 0 ? 'left' : 'right');
53590
- });
53818
+ const axisOption = getAxisOption(col, row, index === 0 ? 'left' : 'right', layout);
53591
53819
  axes.push(merge$2({}, axisOption, {
53592
53820
  type: 'linear',
53593
53821
  orient: index === 0 ? 'left' : 'right',
53594
53822
  label: { visible: false },
53595
53823
  title: { visible: false },
53596
53824
  range,
53597
- seriesIndex: index
53825
+ seriesIndex: index,
53826
+ width: -1
53598
53827
  }));
53599
53828
  });
53600
53829
  let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
@@ -53605,9 +53834,7 @@
53605
53834
  const recordCol = layout.getRecordIndexByCol(col);
53606
53835
  const colPath = layout.getColKeysPath()[recordCol];
53607
53836
  const domain = data[colPath[colPath.length - 1]];
53608
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
53609
- return axisOption.orient === 'bottom';
53610
- });
53837
+ const axisOption = getAxisOption(col, row, 'bottom', layout);
53611
53838
  axes.push(merge$2({}, axisOption, {
53612
53839
  type: 'band',
53613
53840
  orient: 'bottom',
@@ -54415,7 +54642,6 @@
54415
54642
  internalProps.disposables.forEach(disposable => disposable?.dispose?.());
54416
54643
  internalProps.disposables = null;
54417
54644
  }
54418
- this._updateSize();
54419
54645
  if (options.dataSource) {
54420
54646
  _setDataSource(this, options.dataSource);
54421
54647
  }
@@ -54526,8 +54752,8 @@
54526
54752
  }
54527
54753
  getCellAddress(findTargetRecord, field) {
54528
54754
  let targetRecordIndex;
54529
- for (let i = 0; i < this.records.length; i++) {
54530
- const record = this.records[i];
54755
+ for (let i = 0; i < this.internalProps.records.length; i++) {
54756
+ const record = this.internalProps.records[i];
54531
54757
  if (typeof findTargetRecord === 'function') {
54532
54758
  if (findTargetRecord(record)) {
54533
54759
  targetRecordIndex = i;
@@ -56196,216 +56422,6 @@
56196
56422
  }
56197
56423
  }
56198
56424
 
56199
- function getAxisConfigInPivotChart(col, row, layout) {
56200
- if (!layout._table.isPivotChart()) {
56201
- return undefined;
56202
- }
56203
- if (layout.indicatorsAsCol) {
56204
- if (layout.hasTwoIndicatorAxes &&
56205
- row === layout.columnHeaderLevelCount - 1 &&
56206
- col >= layout.rowHeaderLevelCount &&
56207
- col < layout.colCount - layout.rightFrozenColCount) {
56208
- const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, layout.columnHeaderLevelCount - 1);
56209
- let defaultKey = indicatorKeys[1];
56210
- if (isArray$3(defaultKey)) {
56211
- defaultKey = defaultKey[0];
56212
- }
56213
- if (!defaultKey) {
56214
- return undefined;
56215
- }
56216
- const data = layout.dataset.collectedValues[defaultKey + '_align']
56217
- ? layout.dataset.collectedValues[defaultKey + '_align']
56218
- : layout.dataset.collectedValues[defaultKey];
56219
- const index = layout.getRecordIndexByCol(col);
56220
- const range = data[layout.getColKeysPath()[index][Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]];
56221
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
56222
- return axisOption.orient === 'top';
56223
- });
56224
- if (axisOption?.visible === false) {
56225
- return;
56226
- }
56227
- return merge$2({}, axisOption, {
56228
- orient: 'top',
56229
- type: 'linear',
56230
- range: range,
56231
- label: {
56232
- flush: true
56233
- },
56234
- title: {
56235
- visible: false
56236
- }
56237
- });
56238
- }
56239
- else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
56240
- col >= layout.rowHeaderLevelCount &&
56241
- col < layout.colCount - layout.rightFrozenColCount) {
56242
- const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
56243
- let defaultKey = indicatorKeys[0];
56244
- if (isArray$3(defaultKey)) {
56245
- defaultKey = defaultKey[0];
56246
- }
56247
- const data = layout.dataset.collectedValues[defaultKey + '_align']
56248
- ? layout.dataset.collectedValues[defaultKey + '_align']
56249
- : layout.dataset.collectedValues[defaultKey];
56250
- const index = layout.getRecordIndexByCol(col);
56251
- const range = data[layout.getColKeysPath()[index][Math.max(0, layout.columnHeaderLevelCount - 1 - layout.topAxesCount)]];
56252
- let indicatorInfo = null;
56253
- indicatorKeys.forEach(key => {
56254
- const info = layout.getIndicatorInfo(key);
56255
- if (info) {
56256
- indicatorInfo = info;
56257
- }
56258
- });
56259
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
56260
- return axisOption.orient === 'bottom';
56261
- });
56262
- if (axisOption?.visible === false) {
56263
- return;
56264
- }
56265
- return merge$2({}, axisOption, {
56266
- orient: 'bottom',
56267
- type: 'linear',
56268
- range: range,
56269
- label: {
56270
- flush: true
56271
- },
56272
- title: {
56273
- text: indicatorInfo?.caption,
56274
- autoRotate: true
56275
- }
56276
- });
56277
- }
56278
- else if (col === layout.rowHeaderLevelCount - 1 &&
56279
- row >= layout.rowHeaderLevelCount &&
56280
- row < layout.rowCount - layout.bottomFrozenRowCount) {
56281
- let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row)[0];
56282
- if (isArray$3(rowDimensionKey)) {
56283
- rowDimensionKey = rowDimensionKey[0];
56284
- }
56285
- const data = layout.dataset.collectedValues[rowDimensionKey];
56286
- const recordRow = layout.getRecordIndexByRow(row);
56287
- const rowPath = layout.getRowKeysPath()[recordRow];
56288
- const domain = data[rowPath[rowPath.length - 1]];
56289
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
56290
- return axisOption.orient === 'left';
56291
- });
56292
- if (axisOption?.visible === false) {
56293
- return;
56294
- }
56295
- return merge$2({}, axisOption, {
56296
- orient: 'left',
56297
- type: 'band',
56298
- data: Array.from(domain).reverse(),
56299
- title: {
56300
- visible: false
56301
- }
56302
- });
56303
- }
56304
- }
56305
- else {
56306
- if (col === layout.rowHeaderLevelCount - 1 &&
56307
- row >= layout.columnHeaderLevelCount &&
56308
- row < layout.rowCount - layout.bottomFrozenRowCount) {
56309
- const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
56310
- let defaultKey = indicatorKeys[0];
56311
- if (isArray$3(defaultKey)) {
56312
- defaultKey = defaultKey[0];
56313
- }
56314
- const data = layout.dataset.collectedValues[defaultKey + '_align']
56315
- ? layout.dataset.collectedValues[defaultKey + '_align']
56316
- : layout.dataset.collectedValues[defaultKey];
56317
- const index = layout.getRecordIndexByRow(row);
56318
- const range = data[layout.getRowKeysPath()[index][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]];
56319
- let indicatorInfo = null;
56320
- indicatorKeys.forEach(key => {
56321
- const info = layout.getIndicatorInfo(key);
56322
- if (info) {
56323
- indicatorInfo = info;
56324
- }
56325
- });
56326
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
56327
- return axisOption.orient === 'left';
56328
- });
56329
- if (axisOption?.visible === false) {
56330
- return;
56331
- }
56332
- return merge$2({}, axisOption, {
56333
- orient: 'left',
56334
- type: 'linear',
56335
- range: range,
56336
- label: {
56337
- flush: true
56338
- },
56339
- title: {
56340
- text: indicatorInfo?.caption,
56341
- autoRotate: true
56342
- }
56343
- });
56344
- }
56345
- else if (col === layout.colCount - layout.rightFrozenColCount &&
56346
- row >= layout.columnHeaderLevelCount &&
56347
- row < layout.rowCount - layout.bottomFrozenRowCount) {
56348
- const indicatorKeys = layout.getIndicatorKeyInChartSpec(layout.rowHeaderLevelCount - 1, row);
56349
- let defaultKey = indicatorKeys[1];
56350
- if (isArray$3(defaultKey)) {
56351
- defaultKey = defaultKey[0];
56352
- }
56353
- if (!defaultKey) {
56354
- return undefined;
56355
- }
56356
- const data = layout.dataset.collectedValues[defaultKey + '_align']
56357
- ? layout.dataset.collectedValues[defaultKey + '_align']
56358
- : layout.dataset.collectedValues[defaultKey];
56359
- const index = layout.getRecordIndexByRow(row);
56360
- const range = data[layout.getRowKeysPath()[index][Math.max(0, layout.rowHeaderLevelCount - 1 - layout.leftAxesCount)]];
56361
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
56362
- return axisOption.orient === 'right';
56363
- });
56364
- if (axisOption?.visible === false) {
56365
- return;
56366
- }
56367
- return merge$2({}, axisOption, {
56368
- orient: 'right',
56369
- type: 'linear',
56370
- range: range,
56371
- label: {
56372
- flush: true
56373
- },
56374
- title: {
56375
- visible: false
56376
- }
56377
- });
56378
- }
56379
- else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
56380
- col >= layout.rowHeaderLevelCount &&
56381
- col < layout.colCount - layout.rightFrozenColCount) {
56382
- let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
56383
- if (isArray$3(columnDimensionKey)) {
56384
- columnDimensionKey = columnDimensionKey[0];
56385
- }
56386
- const data = layout.dataset.collectedValues[columnDimensionKey];
56387
- const recordCol = layout.getRecordIndexByCol(col);
56388
- const colPath = layout.getColKeysPath()[recordCol];
56389
- const domain = data[colPath[colPath.length - 1]];
56390
- const axisOption = layout._table.pivotChartAxes.find(axisOption => {
56391
- return axisOption.orient === 'bottom';
56392
- });
56393
- if (axisOption?.visible === false) {
56394
- return;
56395
- }
56396
- return merge$2({}, axisOption, {
56397
- orient: 'bottom',
56398
- type: 'band',
56399
- data: Array.from(domain),
56400
- title: {
56401
- visible: false
56402
- }
56403
- });
56404
- }
56405
- }
56406
- return undefined;
56407
- }
56408
-
56409
56425
  const EMPTY_HEADER = {
56410
56426
  isEmpty: true,
56411
56427
  id: undefined,
@@ -57530,6 +57546,23 @@
57530
57546
  const barWidth = this._chartItemSpanSize || 25;
57531
57547
  return (collectedValues?.length ?? 0) * (barWidth + barWidth / 3);
57532
57548
  }
57549
+ getOptimunHeightForChart(row) {
57550
+ const path = this.getCellHeaderPaths(this.rowHeaderLevelCount, row).rowHeaderPaths;
57551
+ let collectedValues;
57552
+ for (const key in this.dataset.collectValuesBy) {
57553
+ if (this.dataset.collectValuesBy[key].type === 'yField' && !this.dataset.collectValuesBy[key].range) {
57554
+ collectedValues =
57555
+ this.dataset.collectedValues[key][path
57556
+ .map(pathObj => {
57557
+ return pathObj.value;
57558
+ })
57559
+ .join(this.dataset.stringJoinChar)];
57560
+ break;
57561
+ }
57562
+ }
57563
+ const barWidth = this._chartItemSpanSize || 25;
57564
+ return (collectedValues?.length ?? 0) * (barWidth + barWidth / 3);
57565
+ }
57533
57566
  getIndicatorKeyInChartSpec(_col, _row) {
57534
57567
  const chartSpec = this.getRawChartSpec(_col, _row);
57535
57568
  const indicatorKeys = [];
@@ -58310,7 +58343,7 @@
58310
58343
  if (records) {
58311
58344
  this.records = records;
58312
58345
  const t0 = typeof window !== 'undefined' ? window.performance.now() : 0;
58313
- this.setRecords(records);
58346
+ this.setRecords();
58314
58347
  this.processCollectedValuesWithSumBy();
58315
58348
  this.processCollectedValuesWithSortBy();
58316
58349
  const t1 = typeof window !== 'undefined' ? window.performance.now() : 0;
@@ -58355,7 +58388,7 @@
58355
58388
  this.registerAggregator(AggregationType.MIN, MinAggregator);
58356
58389
  this.registerAggregator(AggregationType.AVG, AvgAggregator);
58357
58390
  }
58358
- setRecords(records) {
58391
+ setRecords() {
58359
58392
  this.processRecords();
58360
58393
  }
58361
58394
  processCollectedValuesWithSumBy() {
@@ -58389,10 +58422,22 @@
58389
58422
  if (this.dataConfig?.filterRules?.length >= 1) {
58390
58423
  isNeedFilter = true;
58391
58424
  }
58392
- for (let i = 0, len = this.records.length; i < len; i++) {
58393
- const record = this.records[i];
58394
- if (!isNeedFilter || this.filterRecord(record)) {
58395
- this.processRecord(record);
58425
+ if (Array.isArray(this.records)) {
58426
+ for (let i = 0, len = this.records.length; i < len; i++) {
58427
+ const record = this.records[i];
58428
+ if (!isNeedFilter || this.filterRecord(record)) {
58429
+ this.processRecord(record);
58430
+ }
58431
+ }
58432
+ }
58433
+ else {
58434
+ for (const key in this.records) {
58435
+ for (let i = 0, len = this.records[key].length; i < len; i++) {
58436
+ const record = this.records[key][i];
58437
+ if (!isNeedFilter || this.filterRecord(record)) {
58438
+ this.processRecord(record, key);
58439
+ }
58440
+ }
58396
58441
  }
58397
58442
  }
58398
58443
  this.rowFlatKeys = {};
@@ -58416,7 +58461,7 @@
58416
58461
  }
58417
58462
  return isReserved;
58418
58463
  }
58419
- processRecord(record) {
58464
+ processRecord(record, assignedIndicatorKey) {
58420
58465
  this.derivedFieldRules?.forEach((derivedFieldRule, i) => {
58421
58466
  record[derivedFieldRule.fieldName] = derivedFieldRule.derivedFunc(record);
58422
58467
  });
@@ -58496,7 +58541,10 @@
58496
58541
  if (!this.tree[flatRowKey]?.[flatColKey]?.[i]) {
58497
58542
  this.tree[flatRowKey][flatColKey][i] = new this.aggregators[aggRule?.aggregationType ?? AggregationType.SUM](aggRule?.field ?? this.indicatorKeys[i], aggRule?.formatFun);
58498
58543
  }
58499
- if (aggRule?.field) {
58544
+ if (assignedIndicatorKey) {
58545
+ this.indicatorKeys[i] === assignedIndicatorKey && this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
58546
+ }
58547
+ else if (aggRule?.field) {
58500
58548
  if (typeof aggRule?.field === 'string') {
58501
58549
  isValid$1(record[aggRule?.field]) && this.tree[flatRowKey]?.[flatColKey]?.[i].push(record);
58502
58550
  }
@@ -59099,7 +59147,6 @@
59099
59147
  internalProps.disposables.forEach(disposable => disposable?.dispose?.());
59100
59148
  internalProps.disposables = null;
59101
59149
  }
59102
- this._updateSize();
59103
59150
  if (options.dataSource) {
59104
59151
  _setDataSource(this, options.dataSource);
59105
59152
  }
@@ -59321,10 +59368,10 @@
59321
59368
  if (moveContext) {
59322
59369
  if (moveContext.moveType === 'column') {
59323
59370
  if (this.options.records?.[0]?.constructor === Array) {
59324
- for (let row = 0; row < this.records.length; row++) {
59325
- const sourceColumns = this.records[row].splice(moveContext.sourceIndex - this.rowHeaderLevelCount, moveContext.moveSize);
59371
+ for (let row = 0; row < this.internalProps.records.length; row++) {
59372
+ const sourceColumns = this.internalProps.records[row].splice(moveContext.sourceIndex - this.rowHeaderLevelCount, moveContext.moveSize);
59326
59373
  sourceColumns.unshift(moveContext.targetIndex - this.rowHeaderLevelCount, 0);
59327
- Array.prototype.splice.apply(this.records[row], sourceColumns);
59374
+ Array.prototype.splice.apply(this.internalProps.records[row], sourceColumns);
59328
59375
  }
59329
59376
  }
59330
59377
  this.colWidthsMap.adjustOrder(moveContext.sourceIndex, moveContext.targetIndex, moveContext.moveSize);
@@ -59340,9 +59387,9 @@
59340
59387
  }
59341
59388
  else if (moveContext.moveType === 'row') {
59342
59389
  if (this.options.records?.[0]?.constructor === Array) {
59343
- const sourceRows = this.records.splice(moveContext.sourceIndex - this.columnHeaderLevelCount, moveContext.moveSize);
59390
+ const sourceRows = this.internalProps.records.splice(moveContext.sourceIndex - this.columnHeaderLevelCount, moveContext.moveSize);
59344
59391
  sourceRows.unshift(moveContext.targetIndex - this.columnHeaderLevelCount, 0);
59345
- Array.prototype.splice.apply(this.records, sourceRows);
59392
+ Array.prototype.splice.apply(this.internalProps.records, sourceRows);
59346
59393
  }
59347
59394
  this.rowHeightsMap.adjustOrder(moveContext.sourceIndex, moveContext.targetIndex, moveContext.moveSize);
59348
59395
  }
@@ -59424,9 +59471,8 @@
59424
59471
  }
59425
59472
  this.setCustomStateNameToSpec();
59426
59473
  this.internalProps.dataConfig = { isPivotChart: true };
59427
- this.internalProps.enableDataAnalysis = true;
59428
59474
  this._axes = isArray$3(options.axes) ? options.axes : [];
59429
- if (this.internalProps.enableDataAnalysis && (options.rows || options.columns)) {
59475
+ if (options.rows || options.columns) {
59430
59476
  const rowKeys = options.rows.reduce((keys, rowObj) => {
59431
59477
  if (typeof rowObj === 'string') {
59432
59478
  keys.push(rowObj);
@@ -59502,8 +59548,7 @@
59502
59548
  super.updateOption(options);
59503
59549
  this.setCustomStateNameToSpec();
59504
59550
  internalProps.dataConfig = {};
59505
- this.internalProps.enableDataAnalysis = true;
59506
- if (this.internalProps.enableDataAnalysis && (options.rows || options.columns)) {
59551
+ if (options.rows || options.columns) {
59507
59552
  const rowKeys = options.rows.reduce((keys, rowObj) => {
59508
59553
  if (typeof rowObj === 'string') {
59509
59554
  keys.push(rowObj);
@@ -59540,7 +59585,6 @@
59540
59585
  internalProps.disposables.forEach(disposable => disposable?.dispose?.());
59541
59586
  internalProps.disposables = null;
59542
59587
  }
59543
- this._updateSize();
59544
59588
  if (options.dataSource) {
59545
59589
  _setDataSource(this, options.dataSource);
59546
59590
  }
@@ -59561,9 +59605,7 @@
59561
59605
  if (internalProps.headerEvents) {
59562
59606
  internalProps.headerEvents.forEach((id) => this.unlisten(id));
59563
59607
  }
59564
- if (this.internalProps.enableDataAnalysis) {
59565
- internalProps.layoutMap = new PivotLayoutMap(this, this.dataset);
59566
- }
59608
+ internalProps.layoutMap = new PivotLayoutMap(this, this.dataset);
59567
59609
  for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
59568
59610
  const { width, minWidth, maxWidth } = internalProps.layoutMap.columnWidths?.[col] ?? {};
59569
59611
  if (width && ((typeof width === 'string' && width !== 'auto') || (typeof width === 'number' && width > 0))) {
@@ -59708,10 +59750,10 @@
59708
59750
  if (moveContext) {
59709
59751
  if (moveContext.moveType === 'column') {
59710
59752
  if (this.options.records?.[0]?.constructor === Array) {
59711
- for (let row = 0; row < this.records.length; row++) {
59712
- const sourceColumns = this.records[row].splice(moveContext.sourceIndex - this.rowHeaderLevelCount, moveContext.moveSize);
59753
+ for (let row = 0; row < this.internalProps.records.length; row++) {
59754
+ const sourceColumns = this.internalProps.records[row].splice(moveContext.sourceIndex - this.rowHeaderLevelCount, moveContext.moveSize);
59713
59755
  sourceColumns.unshift(moveContext.targetIndex - this.rowHeaderLevelCount, 0);
59714
- Array.prototype.splice.apply(this.records[row], sourceColumns);
59756
+ Array.prototype.splice.apply(this.internalProps.records[row], sourceColumns);
59715
59757
  }
59716
59758
  }
59717
59759
  this.colWidthsMap.adjustOrder(moveContext.sourceIndex, moveContext.targetIndex, moveContext.moveSize);
@@ -59727,9 +59769,9 @@
59727
59769
  }
59728
59770
  else if (moveContext.moveType === 'row') {
59729
59771
  if (this.options.records?.[0]?.constructor === Array) {
59730
- const sourceRows = this.records.splice(moveContext.sourceIndex - this.columnHeaderLevelCount, moveContext.moveSize);
59772
+ const sourceRows = this.internalProps.records.splice(moveContext.sourceIndex - this.columnHeaderLevelCount, moveContext.moveSize);
59731
59773
  sourceRows.unshift(moveContext.targetIndex - this.columnHeaderLevelCount, 0);
59732
- Array.prototype.splice.apply(this.records, sourceRows);
59774
+ Array.prototype.splice.apply(this.internalProps.records, sourceRows);
59733
59775
  }
59734
59776
  this.rowHeightsMap.adjustOrder(moveContext.sourceIndex, moveContext.targetIndex, moveContext.moveSize);
59735
59777
  }
@@ -59940,9 +59982,12 @@
59940
59982
  });
59941
59983
  }
59942
59984
  else {
59985
+ const field = this.options.indicatorsAsCol === false
59986
+ ? indicator.chartSpec.yField
59987
+ : indicator.chartSpec.xField;
59943
59988
  aggregationRules.push({
59944
59989
  indicatorKey: indicator.indicatorKey,
59945
- field: indicator.indicatorKey,
59990
+ field: field ?? indicator.indicatorKey,
59946
59991
  aggregationType: AggregationType.RECORD
59947
59992
  });
59948
59993
  }
@@ -60029,7 +60074,8 @@
60029
60074
  const chartNode = cellGroup?.getChildren()?.[0];
60030
60075
  if (chartNode.attribute.chartInstance) {
60031
60076
  const chartInstance = chartNode.attribute.chartInstance;
60032
- const { dataId, data, viewBox, axes } = chartNode.attribute;
60077
+ const { dataId, data, axes } = chartNode.attribute;
60078
+ const viewBox = chartNode.getViewBox();
60033
60079
  axes.forEach((axis, index) => {
60034
60080
  if (axis.type === 'linear') {
60035
60081
  const chartAxis = chartInstance._chart._components[index];
@@ -60686,7 +60732,7 @@
60686
60732
  percentCalc: percentCalc
60687
60733
  });
60688
60734
 
60689
- const version = "0.9.3-alpha.3";
60735
+ const version = "0.9.3-alpha.4";
60690
60736
  function getIcons() {
60691
60737
  return get$1();
60692
60738
  }