@visactor/vtable 0.9.3-alpha.0 → 0.9.3-alpha.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 (84) hide show
  1. package/README.md +15 -15
  2. package/cjs/PivotChart.js +20 -10
  3. package/cjs/PivotChart.js.map +1 -1
  4. package/cjs/core/BaseTable.js +1 -1
  5. package/cjs/core/BaseTable.js.map +1 -1
  6. package/cjs/dataset/dataset.d.ts +1 -0
  7. package/cjs/dataset/dataset.js +11 -3
  8. package/cjs/dataset/dataset.js.map +1 -1
  9. package/cjs/dataset/statistics-helper.d.ts +1 -2
  10. package/cjs/dataset/statistics-helper.js.map +1 -1
  11. package/cjs/index.d.ts +1 -1
  12. package/cjs/index.js +1 -1
  13. package/cjs/index.js.map +1 -1
  14. package/cjs/layout/chart-helper/get-axis-config.js +18 -8
  15. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  16. package/cjs/layout/chart-helper/get-chart-spec.js +8 -2
  17. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  18. package/cjs/layout/pivot-layout.d.ts +1 -0
  19. package/cjs/layout/pivot-layout.js +10 -4
  20. package/cjs/layout/pivot-layout.js.map +1 -1
  21. package/cjs/scenegraph/graphic/contributions/chart-render.js +2 -2
  22. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  23. package/cjs/scenegraph/group-creater/column-helper.js +1 -1
  24. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  25. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  26. package/cjs/scenegraph/group-creater/progress/proxy.js +18 -22
  27. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  28. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
  29. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +60 -26
  30. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  31. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
  32. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +90 -36
  33. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  34. package/cjs/scenegraph/layout/update-width.js +2 -1
  35. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  36. package/cjs/scenegraph/scenegraph.js +3 -2
  37. package/cjs/scenegraph/scenegraph.js.map +1 -1
  38. package/cjs/scenegraph/utils/text-icon-layout.js +1 -1
  39. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  40. package/cjs/ts-types/new-data-set.d.ts +3 -3
  41. package/cjs/ts-types/new-data-set.js.map +1 -1
  42. package/dist/vtable.js +370 -136
  43. package/dist/vtable.min.js +3 -3
  44. package/es/PivotChart.js +20 -10
  45. package/es/PivotChart.js.map +1 -1
  46. package/es/core/BaseTable.js +1 -1
  47. package/es/core/BaseTable.js.map +1 -1
  48. package/es/dataset/dataset.d.ts +1 -0
  49. package/es/dataset/dataset.js +11 -3
  50. package/es/dataset/dataset.js.map +1 -1
  51. package/es/dataset/statistics-helper.d.ts +1 -2
  52. package/es/dataset/statistics-helper.js.map +1 -1
  53. package/es/index.d.ts +1 -1
  54. package/es/index.js +1 -1
  55. package/es/index.js.map +1 -1
  56. package/es/layout/chart-helper/get-axis-config.js +19 -9
  57. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  58. package/es/layout/chart-helper/get-chart-spec.js +9 -3
  59. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  60. package/es/layout/pivot-layout.d.ts +1 -0
  61. package/es/layout/pivot-layout.js +10 -4
  62. package/es/layout/pivot-layout.js.map +1 -1
  63. package/es/scenegraph/graphic/contributions/chart-render.js +2 -2
  64. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  65. package/es/scenegraph/group-creater/column-helper.js +1 -1
  66. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  67. package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -1
  68. package/es/scenegraph/group-creater/progress/proxy.js +17 -23
  69. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  70. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.d.ts +1 -0
  71. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +59 -23
  72. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  73. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.d.ts +1 -0
  74. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +90 -33
  75. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  76. package/es/scenegraph/layout/update-width.js +2 -1
  77. package/es/scenegraph/layout/update-width.js.map +1 -1
  78. package/es/scenegraph/scenegraph.js +3 -2
  79. package/es/scenegraph/scenegraph.js.map +1 -1
  80. package/es/scenegraph/utils/text-icon-layout.js +1 -1
  81. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  82. package/es/ts-types/new-data-set.d.ts +3 -3
  83. package/es/ts-types/new-data-set.js.map +1 -1
  84. package/package.json +3 -3
package/dist/vtable.js CHANGED
@@ -39565,23 +39565,25 @@
39565
39565
  let absoluteLeftIconWidth = 0;
39566
39566
  let absoluteRightIconWidth = 0;
39567
39567
  if (!Array.isArray(icons) || icons.length === 0) {
39568
- const text = convertInternal(textStr).replace(/\r?\n/g, '\n').replace(/\r/g, '\n').split('\n');
39569
- const hierarchyOffset = getHierarchyOffset(cellGroup.col, cellGroup.row, table);
39570
- const attribute = {
39571
- text: text.length === 1 && !autoWrapText ? text[0] : text,
39572
- maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
39573
- textBaseline: 'top',
39574
- autoWrapText,
39575
- lineClamp,
39576
- heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
39577
- pickable: false,
39578
- dx: hierarchyOffset
39579
- };
39580
- const wrapText = new WrapText(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
39581
- wrapText.name = 'text';
39582
- cellGroup.appendChild(wrapText);
39583
- contentWidth = wrapText.AABBBounds.width();
39584
- contentHeight = wrapText.AABBBounds.height();
39568
+ if (textStr) {
39569
+ const text = convertInternal(textStr).replace(/\r?\n/g, '\n').replace(/\r/g, '\n').split('\n');
39570
+ const hierarchyOffset = getHierarchyOffset(cellGroup.col, cellGroup.row, table);
39571
+ const attribute = {
39572
+ text: text.length === 1 && !autoWrapText ? text[0] : text,
39573
+ maxLineWidth: autoColWidth ? Infinity : cellWidth - (padding[1] + padding[3] + hierarchyOffset),
39574
+ textBaseline: 'top',
39575
+ autoWrapText,
39576
+ lineClamp,
39577
+ heightLimit: autoRowHeight ? -1 : cellHeight - (padding[0] + padding[2]),
39578
+ pickable: false,
39579
+ dx: hierarchyOffset
39580
+ };
39581
+ const wrapText = new WrapText(cellTheme.text ? Object.assign({}, cellTheme.text, attribute) : attribute);
39582
+ wrapText.name = 'text';
39583
+ cellGroup.appendChild(wrapText);
39584
+ contentWidth = wrapText.AABBBounds.width();
39585
+ contentHeight = wrapText.AABBBounds.height();
39586
+ }
39585
39587
  }
39586
39588
  else {
39587
39589
  icons.forEach(icon => {
@@ -40590,7 +40592,7 @@
40590
40592
  else if (type === 'image' || type === 'video') {
40591
40593
  updateImageCellContentWhileResize(cellGroup, col, row, scene.table);
40592
40594
  }
40593
- else if (cellGroup.firstChild.name === 'axis') {
40595
+ else if (cellGroup.firstChild?.name === 'axis') {
40594
40596
  const axisConfig = scene.table.internalProps.layoutMap.getAxisConfigInPivotChart(col, row);
40595
40597
  if (axisConfig) {
40596
40598
  const axis = new CartesianAxis(axisConfig, cellGroup.attribute.width, cellGroup.attribute.height, scene.table);
@@ -41746,7 +41748,7 @@
41746
41748
  for (const dataIdStr in dataId) {
41747
41749
  const dataIdAndField = dataId[dataIdStr];
41748
41750
  activeChartInstance.updateDataSync(dataIdStr, dataIdAndField
41749
- ? data.filter((item) => {
41751
+ ? data?.filter((item) => {
41750
41752
  return item.hasOwnProperty(dataIdAndField);
41751
41753
  }) ?? []
41752
41754
  : data ?? []);
@@ -41782,7 +41784,7 @@
41782
41784
  for (const dataIdStr in dataId) {
41783
41785
  const dataIdAndField = dataId[dataIdStr];
41784
41786
  chartInstance.updateDataSync(dataIdStr, dataIdAndField
41785
- ? data.filter((item) => {
41787
+ ? data?.filter((item) => {
41786
41788
  return item.hasOwnProperty(dataIdAndField);
41787
41789
  }) ?? []
41788
41790
  : data ?? []);
@@ -43361,6 +43363,9 @@
43361
43363
  if (cellTheme.text.textBaseline) {
43362
43364
  textBaseline = cellTheme.text.textBaseline;
43363
43365
  }
43366
+ if (cellType !== 'body' && !cellTheme.group.fill) {
43367
+ cellTheme.group.fill = '#fff';
43368
+ }
43364
43369
  let cellWidth = colWidth;
43365
43370
  let cellHeight = table.getRowHeight(row);
43366
43371
  const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||
@@ -43557,33 +43562,20 @@
43557
43562
  else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {
43558
43563
  count = proxy.colStart - proxy.bodyLeftCol;
43559
43564
  }
43560
- const bodyGroup = proxy.table.scenegraph.bodyGroup;
43565
+ proxy.table.scenegraph.bodyGroup;
43561
43566
  if (count < proxy.colEnd - proxy.colStart) {
43562
43567
  const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;
43563
43568
  const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;
43564
43569
  const distStartCol = direction === 'left' ? proxy.colEnd + 1 : proxy.colStart - count;
43565
43570
  const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;
43566
43571
  computeColsWidth(proxy.table, distStartCol, distEndCol);
43567
- for (let col = startCol; col <= endCol; col++) {
43568
- if (direction === 'left') {
43569
- const colGroup = bodyGroup.firstChild;
43570
- updateColGroupPosition(colGroup, bodyGroup.lastChild.col + 1, bodyGroup.lastChild.attribute.x + bodyGroup.lastChild.attribute.width);
43571
- bodyGroup.appendChild(colGroup);
43572
- }
43573
- else {
43574
- const colGroup = bodyGroup.lastChild;
43575
- updateColGroupPosition(colGroup, bodyGroup.firstChild.col - 1, bodyGroup.firstChild.attribute.x - proxy.table.getColWidth(bodyGroup.firstChild.col - 1));
43576
- bodyGroup.insertBefore(colGroup, bodyGroup.firstChild);
43577
- }
43578
- }
43572
+ updatePartColPosition(startCol, endCol, direction, proxy);
43579
43573
  const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenColCount * 1);
43580
43574
  const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenColCount * 2);
43581
- for (let col = syncLeftCol; col <= syncRightCol; col++) {
43582
- const colGroup = proxy.table.scenegraph.getColGroup(col);
43583
- updateColGroupContent(colGroup, proxy);
43584
- }
43585
43575
  proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;
43586
43576
  proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
43577
+ checkFirstColMerge(distStartCol, proxy);
43578
+ updateColContent(syncLeftCol, syncRightCol, proxy);
43587
43579
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
43588
43580
  proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
43589
43581
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
@@ -43598,24 +43590,13 @@
43598
43590
  computeColsWidth(proxy.table, distStartCol, distEndCol);
43599
43591
  const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);
43600
43592
  console.log('distStartColY', proxy.bodyLeftCol, distStartCol - 1, distStartColY);
43601
- bodyGroup.forEachChildren((colGroup, index) => {
43602
- if (colGroup.type === 'group') {
43603
- updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
43604
- ? distStartColY
43605
- : colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
43606
- }
43607
- });
43593
+ updateAllColPosition(distStartColY, count, direction, proxy);
43608
43594
  const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenRowCount * 1);
43609
43595
  const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenRowCount * 2);
43610
- for (let col = syncLeftCol; col <= syncRightCol; col++) {
43611
- const colGroup = proxy.table.scenegraph.getColGroup(col);
43612
- updateColGroupContent(colGroup, proxy);
43613
- }
43614
- const cellGroup = proxy.table.scenegraph.getCell(screenLeftCol, 0);
43615
- cellGroup.AABBBounds.width();
43616
- console.log('leftCell', cellGroup.col, cellGroup.globalAABBBounds, cellGroup);
43617
43596
  proxy.colStart = distStartCol;
43618
43597
  proxy.colEnd = distEndCol;
43598
+ checkFirstColMerge(distStartCol, proxy);
43599
+ updateColContent(syncLeftCol, syncRightCol, proxy);
43619
43600
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
43620
43601
  proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
43621
43602
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
@@ -43641,6 +43622,88 @@
43641
43622
  }
43642
43623
  colGroup.needUpdate = false;
43643
43624
  }
43625
+ function updatePartColPosition(startCol, endCol, direction, proxy) {
43626
+ for (let col = startCol; col <= endCol; col++) {
43627
+ if (proxy.table.scenegraph.bodyGroup.childrenCount > 0) {
43628
+ updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
43629
+ }
43630
+ if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {
43631
+ updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
43632
+ }
43633
+ if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {
43634
+ updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
43635
+ }
43636
+ }
43637
+ }
43638
+ function updateColPosition(containerGroup, direction, proxy) {
43639
+ if (direction === 'left') {
43640
+ const colGroup = containerGroup.firstChild;
43641
+ updateColGroupPosition(colGroup, containerGroup.lastChild.col + 1, containerGroup.lastChild.attribute.x + containerGroup.lastChild.attribute.width);
43642
+ containerGroup.appendChild(colGroup);
43643
+ }
43644
+ else {
43645
+ const colGroup = containerGroup.lastChild;
43646
+ updateColGroupPosition(colGroup, containerGroup.firstChild.col - 1, containerGroup.firstChild.attribute.x -
43647
+ proxy.table.getColWidth(containerGroup.firstChild.col - 1));
43648
+ containerGroup.insertBefore(colGroup, containerGroup.firstChild);
43649
+ }
43650
+ }
43651
+ function updateColContent(syncLeftCol, syncRightCol, proxy) {
43652
+ for (let col = syncLeftCol; col <= syncRightCol; col++) {
43653
+ const colGroup = proxy.table.scenegraph.getColGroup(col);
43654
+ updateColGroupContent(colGroup, proxy);
43655
+ const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);
43656
+ updateColGroupContent(colHeaderColGroup, proxy);
43657
+ const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);
43658
+ updateColGroupContent(bottomColGroup, proxy);
43659
+ }
43660
+ }
43661
+ function updateAllColPosition(distStartColY, count, direction, proxy) {
43662
+ proxy.table.scenegraph.colHeaderGroup.forEachChildren((colGroup, index) => {
43663
+ if (colGroup.type === 'group') {
43664
+ updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
43665
+ ? distStartColY
43666
+ : colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
43667
+ }
43668
+ });
43669
+ proxy.table.scenegraph.bottomFrozenGroup.forEachChildren((colGroup, index) => {
43670
+ if (colGroup.type === 'group') {
43671
+ updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
43672
+ ? distStartColY
43673
+ : colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
43674
+ }
43675
+ });
43676
+ proxy.table.scenegraph.bodyGroup.forEachChildren((colGroup, index) => {
43677
+ if (colGroup.type === 'group') {
43678
+ updateColGroupPosition(colGroup, direction === 'left' ? colGroup.col + count : colGroup.col - count, index === 0
43679
+ ? distStartColY
43680
+ : colGroup._prev.attribute.x + proxy.table.getColWidth(colGroup._prev.col));
43681
+ }
43682
+ });
43683
+ }
43684
+ function checkFirstColMerge(col, proxy) {
43685
+ for (let row = 0; row < proxy.table.rowCount; row++) {
43686
+ if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
43687
+ (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
43688
+ continue;
43689
+ }
43690
+ const range = getCellMergeInfo(proxy.table, col, row);
43691
+ if (range && range.start.row !== row) {
43692
+ const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
43693
+ const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
43694
+ newCellGroup.col = col;
43695
+ newCellGroup.row = row;
43696
+ newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1));
43697
+ oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
43698
+ oldCellGroup.parent.removeChild(oldCellGroup);
43699
+ oldCellGroup.needUpdate = false;
43700
+ newCellGroup.needUpdate = false;
43701
+ if (proxy.cellCache.get(col)) {
43702
+ proxy.cellCache.set(col, newCellGroup);
43703
+ }
43704
+ }
43705
+ }
43706
+ }
43644
43707
 
43645
43708
  function updateAutoRow(colStart, colEnd, rowStart, rowEnd, table, direction = 'up') {
43646
43709
  if (direction === 'up') {
@@ -43713,39 +43776,21 @@
43713
43776
  if (count < proxy.rowEnd - proxy.rowStart) {
43714
43777
  const startRow = direction === 'up' ? proxy.rowStart : proxy.rowEnd - count + 1;
43715
43778
  const endRow = direction === 'up' ? proxy.rowStart + count - 1 : proxy.rowEnd;
43716
- for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
43717
- const colGroup = proxy.table.scenegraph.getColGroup(col);
43718
- for (let row = startRow; row <= endRow; row++) {
43719
- if (direction === 'up') {
43720
- const cellGroup = colGroup.firstChild;
43721
- proxy.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + colGroup.lastChild.attribute.height);
43722
- colGroup.appendChild(cellGroup);
43723
- }
43724
- else {
43725
- const cellGroup = colGroup.lastChild;
43726
- proxy.updateCellGroupPosition(cellGroup, colGroup.firstChild.row - 1, colGroup.firstChild.attribute.y - cellGroup.attribute.height);
43727
- colGroup.insertBefore(cellGroup, colGroup.firstChild);
43728
- }
43729
- }
43730
- }
43779
+ updatePartRowPosition(startRow, endRow, direction, proxy);
43731
43780
  const distStartRow = direction === 'up' ? proxy.rowEnd + 1 : proxy.rowStart - count;
43732
- const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;
43781
+ direction === 'up' ? proxy.rowEnd + count : proxy.rowStart - 1;
43733
43782
  const syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);
43734
43783
  const syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);
43735
43784
  if (proxy.table.heightMode === 'autoHeight') {
43736
43785
  computeRowsHeight(proxy.table, syncTopRow, syncBottomRow);
43737
43786
  }
43738
- for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
43739
- for (let row = syncTopRow; row <= syncBottomRow; row++) {
43740
- const cellGroup = proxy.highPerformanceGetCell(col, row, distStartRow, distEndRow);
43741
- proxy.updateCellGroupContent(cellGroup);
43742
- }
43743
- }
43787
+ proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
43788
+ proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
43789
+ checkFirstRowMerge(distStartRow, proxy);
43790
+ updateRowContent(syncTopRow, syncBottomRow, proxy);
43744
43791
  if (proxy.table.heightMode === 'autoHeight') {
43745
43792
  updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, direction);
43746
43793
  }
43747
- proxy.rowStart = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
43748
- proxy.rowEnd = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
43749
43794
  proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
43750
43795
  proxy.totalRow = direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count;
43751
43796
  proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
@@ -43760,14 +43805,7 @@
43760
43805
  const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
43761
43806
  const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
43762
43807
  const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);
43763
- for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
43764
- const colGroup = proxy.table.scenegraph.getColGroup(col);
43765
- colGroup?.forEachChildren((cellGroup, index) => {
43766
- proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
43767
- ? distStartRowY
43768
- : cellGroup._prev.attribute.y + cellGroup._prev.attribute.height);
43769
- });
43770
- }
43808
+ updateAllRowPosition(distStartRowY, count, direction, proxy);
43771
43809
  let syncTopRow;
43772
43810
  let syncBottomRow;
43773
43811
  if (proxy.table.heightMode === 'autoHeight') {
@@ -43784,12 +43822,8 @@
43784
43822
  }
43785
43823
  proxy.rowStart = distStartRow;
43786
43824
  proxy.rowEnd = distEndRow;
43787
- for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
43788
- for (let row = syncTopRow; row <= syncBottomRow; row++) {
43789
- const cellGroup = proxy.highPerformanceGetCell(col, row, distStartRow, distEndRow);
43790
- proxy.updateCellGroupContent(cellGroup);
43791
- }
43792
- }
43825
+ checkFirstRowMerge(distStartRow, proxy);
43826
+ updateRowContent(syncTopRow, syncBottomRow, proxy);
43793
43827
  console.log('updateAutoRow', distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
43794
43828
  if (proxy.table.heightMode === 'autoHeight') {
43795
43829
  updateAutoRow(proxy.bodyLeftCol, proxy.bodyRightCol, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
@@ -43807,6 +43841,107 @@
43807
43841
  }
43808
43842
  }
43809
43843
  }
43844
+ function updatePartRowPosition(startRow, endRow, direction, proxy) {
43845
+ for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {
43846
+ const colGroup = proxy.table.scenegraph.getColGroup(col);
43847
+ for (let row = startRow; row <= endRow; row++) {
43848
+ updateCellGroupPosition(colGroup, direction, proxy);
43849
+ }
43850
+ }
43851
+ for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
43852
+ const colGroup = proxy.table.scenegraph.getColGroup(col);
43853
+ for (let row = startRow; row <= endRow; row++) {
43854
+ updateCellGroupPosition(colGroup, direction, proxy);
43855
+ }
43856
+ }
43857
+ for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
43858
+ const colGroup = proxy.table.scenegraph.getColGroup(col);
43859
+ for (let row = startRow; row <= endRow; row++) {
43860
+ updateCellGroupPosition(colGroup, direction, proxy);
43861
+ }
43862
+ }
43863
+ }
43864
+ function updateCellGroupPosition(colGroup, direction, proxy) {
43865
+ if (direction === 'up') {
43866
+ const cellGroup = colGroup.firstChild;
43867
+ proxy.updateCellGroupPosition(cellGroup, colGroup.lastChild.row + 1, colGroup.lastChild.attribute.y + colGroup.lastChild.attribute.height);
43868
+ colGroup.appendChild(cellGroup);
43869
+ }
43870
+ else {
43871
+ const cellGroup = colGroup.lastChild;
43872
+ proxy.updateCellGroupPosition(cellGroup, colGroup.firstChild.row - 1, colGroup.firstChild.attribute.y - cellGroup.attribute.height);
43873
+ colGroup.insertBefore(cellGroup, colGroup.firstChild);
43874
+ }
43875
+ }
43876
+ function updateAllRowPosition(distStartRowY, count, direction, proxy) {
43877
+ for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {
43878
+ const colGroup = proxy.table.scenegraph.getColGroup(col);
43879
+ colGroup?.forEachChildren((cellGroup, index) => {
43880
+ proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
43881
+ ? distStartRowY
43882
+ : cellGroup._prev.attribute.y + proxy.table.getRowHeight(cellGroup._prev.row));
43883
+ });
43884
+ }
43885
+ for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
43886
+ const colGroup = proxy.table.scenegraph.getColGroup(col);
43887
+ colGroup?.forEachChildren((cellGroup, index) => {
43888
+ proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
43889
+ ? distStartRowY
43890
+ : cellGroup._prev.attribute.y + proxy.table.getRowHeight(cellGroup._prev.row));
43891
+ });
43892
+ }
43893
+ for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
43894
+ const colGroup = proxy.table.scenegraph.getColGroup(col);
43895
+ colGroup?.forEachChildren((cellGroup, index) => {
43896
+ proxy.updateCellGroupPosition(cellGroup, direction === 'up' ? cellGroup.row + count : cellGroup.row - count, index === 0
43897
+ ? distStartRowY
43898
+ : cellGroup._prev.attribute.y + proxy.table.getRowHeight(cellGroup._prev.row));
43899
+ });
43900
+ }
43901
+ }
43902
+ function updateRowContent(syncTopRow, syncBottomRow, proxy) {
43903
+ for (let col = 0; col < proxy.table.rowHeaderLevelCount; col++) {
43904
+ for (let row = syncTopRow; row <= syncBottomRow; row++) {
43905
+ const cellGroup = proxy.highPerformanceGetCell(col, row, true);
43906
+ proxy.updateCellGroupContent(cellGroup);
43907
+ }
43908
+ }
43909
+ for (let col = proxy.table.colCount - proxy.table.rightFrozenColCount; col < proxy.table.colCount; col++) {
43910
+ for (let row = syncTopRow; row <= syncBottomRow; row++) {
43911
+ const cellGroup = proxy.highPerformanceGetCell(col, row);
43912
+ proxy.updateCellGroupContent(cellGroup);
43913
+ }
43914
+ }
43915
+ for (let col = proxy.bodyLeftCol; col <= proxy.bodyRightCol; col++) {
43916
+ for (let row = syncTopRow; row <= syncBottomRow; row++) {
43917
+ const cellGroup = proxy.highPerformanceGetCell(col, row);
43918
+ proxy.updateCellGroupContent(cellGroup);
43919
+ }
43920
+ }
43921
+ }
43922
+ function checkFirstRowMerge(row, proxy) {
43923
+ for (let col = 0; col < proxy.table.colCount; col++) {
43924
+ if ((col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||
43925
+ (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)) {
43926
+ continue;
43927
+ }
43928
+ const range = getCellMergeInfo(proxy.table, col, row);
43929
+ if (range && range.start.row !== row) {
43930
+ const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
43931
+ const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
43932
+ newCellGroup.col = col;
43933
+ newCellGroup.row = row;
43934
+ newCellGroup.setAttribute('y', proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1));
43935
+ oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
43936
+ oldCellGroup.parent.removeChild(oldCellGroup);
43937
+ oldCellGroup.needUpdate = false;
43938
+ newCellGroup.needUpdate = false;
43939
+ if (proxy.cellCache.get(col)) {
43940
+ proxy.cellCache.set(col, newCellGroup);
43941
+ }
43942
+ }
43943
+ }
43944
+ }
43810
43945
 
43811
43946
  class SceneProxy {
43812
43947
  table;
@@ -43991,6 +44126,22 @@
43991
44126
  createColGroup(onceCount) {
43992
44127
  const endCol = Math.min(this.totalCol, this.currentCol + onceCount);
43993
44128
  computeColsWidth(this.table, this.currentCol + 1, endCol);
44129
+ if (this.table.columnHeaderLevelCount) {
44130
+ const lastColumnGroup = (this.table.scenegraph.colHeaderGroup.lastChild instanceof Group
44131
+ ? this.table.scenegraph.colHeaderGroup.lastChild
44132
+ : this.table.scenegraph.colHeaderGroup.lastChild._prev);
44133
+ const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;
44134
+ const yOrigin = lastColumnGroup.attribute.y;
44135
+ createColGroup(this.table.scenegraph.colHeaderGroup, xOrigin, yOrigin, this.currentCol + 1, endCol, 0, this.table.columnHeaderLevelCount - 1, 'columnHeader', this.table);
44136
+ }
44137
+ if (this.table.bottomFrozenRowCount) {
44138
+ const lastColumnGroup = (this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Group
44139
+ ? this.table.scenegraph.bottomFrozenGroup.lastChild
44140
+ : this.table.scenegraph.bottomFrozenGroup.lastChild._prev);
44141
+ const xOrigin = lastColumnGroup.attribute.x + lastColumnGroup.attribute.width;
44142
+ const yOrigin = lastColumnGroup.attribute.y;
44143
+ createColGroup(this.table.scenegraph.bottomFrozenGroup, xOrigin, yOrigin, this.currentCol + 1, endCol, this.table.rowCount - this.table.bottomFrozenRowCount, this.table.rowCount - 1, 'columnHeader', this.table);
44144
+ }
43994
44145
  const lastColumnGroup = (this.table.scenegraph.bodyGroup.lastChild instanceof Group
43995
44146
  ? this.table.scenegraph.bodyGroup.lastChild
43996
44147
  : this.table.scenegraph.bodyGroup.lastChild._prev);
@@ -44044,12 +44195,7 @@
44044
44195
  if (this.table.heightMode === 'autoHeight') {
44045
44196
  computeRowsHeight(this.table, this.rowUpdatePos, distRow);
44046
44197
  }
44047
- for (let col = this.bodyLeftCol; col <= this.bodyRightCol; col++) {
44048
- for (let row = this.rowUpdatePos; row <= distRow; row++) {
44049
- const cellGroup = this.highPerformanceGetCell(col, row);
44050
- this.updateCellGroupContent(cellGroup);
44051
- }
44052
- }
44198
+ updateRowContent(this.rowUpdatePos, distRow, this);
44053
44199
  if (this.table.heightMode === 'autoHeight') {
44054
44200
  updateAutoRow(this.bodyLeftCol, this.bodyRightCol, this.rowUpdatePos, distRow, this.table, this.rowUpdateDirection);
44055
44201
  }
@@ -44060,17 +44206,8 @@
44060
44206
  }
44061
44207
  updateColGroups(count) {
44062
44208
  const distCol = Math.min(this.bodyRightCol, this.colUpdatePos + count);
44063
- for (let col = this.colUpdatePos; col <= distCol; col++) {
44064
- const colGroup = this.table.scenegraph.getColGroup(col);
44065
- if (colGroup) {
44066
- let cellGroup = colGroup.firstChild;
44067
- while (cellGroup) {
44068
- const newCellGroup = this.updateCellGroupContent(cellGroup);
44069
- cellGroup = newCellGroup._next;
44070
- }
44071
- colGroup.needUpdate = false;
44072
- }
44073
- }
44209
+ computeColsWidth(this.table, this.colUpdatePos, distCol);
44210
+ updateColContent(this.colUpdatePos, distCol, this);
44074
44211
  this.colUpdatePos = distCol + 1;
44075
44212
  }
44076
44213
  updateCellGroupPosition(cellGroup, newRow, y) {
@@ -44134,18 +44271,22 @@
44134
44271
  await this.progress();
44135
44272
  }
44136
44273
  }
44137
- highPerformanceGetCell(col, row, rowStart = this.rowStart, rowEnd = this.rowEnd, getShadow) {
44138
- if (row < rowStart || row > rowEnd) {
44274
+ highPerformanceGetCell(col, row, getShadow) {
44275
+ if (row >= this.table.columnHeaderLevelCount &&
44276
+ row < this.table.rowCount - this.table.bottomFrozenRowCount &&
44277
+ (row < this.rowStart || row > this.rowEnd)) {
44139
44278
  return emptyGroup;
44140
44279
  }
44141
- if (row < this.rowStart || row > this.rowEnd || col < this.colStart || col > this.colEnd) {
44280
+ if (col >= this.table.rowHeaderLevelCount &&
44281
+ col < this.table.colCount - this.table.rightFrozenColCount &&
44282
+ (col < this.colStart || col > this.colEnd)) {
44142
44283
  return emptyGroup;
44143
44284
  }
44144
44285
  if (this.cellCache.get(col)) {
44145
44286
  const cacheCellGoup = this.cellCache.get(col);
44146
44287
  if ((cacheCellGoup._next || cacheCellGoup._prev) && Math.abs(cacheCellGoup.row - row) < row) {
44147
44288
  let cellGroup = getCellByCache(cacheCellGoup, row);
44148
- if (!cellGroup) {
44289
+ if (!cellGroup || (!getShadow && cellGroup.role === 'shadow-cell')) {
44149
44290
  cellGroup = this.table.scenegraph.getCell(col, row, getShadow);
44150
44291
  }
44151
44292
  cellGroup.row && this.cellCache.set(col, cellGroup);
@@ -45326,10 +45467,7 @@
45326
45467
  return cell || emptyGroup;
45327
45468
  }
45328
45469
  highPerformanceGetCell(col, row, getShadow) {
45329
- if (!this.table.isHeader(col, row)) {
45330
- return this.proxy.highPerformanceGetCell(col, row, 0, this.table.rowCount - 1, getShadow);
45331
- }
45332
- return this.getCell(col, row, getShadow);
45470
+ return this.proxy.highPerformanceGetCell(col, row, getShadow);
45333
45471
  }
45334
45472
  getColGroup(col, isCornerOrColHeader = false) {
45335
45473
  let element;
@@ -45841,6 +45979,7 @@
45841
45979
  this.rowHeaderGroup.setDeltaWidth(rowHeaderX - this.rowHeaderGroup.attribute.width);
45842
45980
  this.bodyGroup.setDeltaWidth(bodyX - this.bodyGroup.attribute.width);
45843
45981
  this.colHeaderGroup.setAttribute('x', this.cornerHeaderGroup.attribute.width);
45982
+ this.bottomFrozenGroup.setAttribute('x', this.rowHeaderGroup.attribute.width);
45844
45983
  this.bodyGroup.setAttribute('x', this.rowHeaderGroup.attribute.width);
45845
45984
  this.updateTableSize();
45846
45985
  const oldHorizontalBarPos = this.table.stateManeger.scroll.horizontalBarPos;
@@ -51158,7 +51297,7 @@
51158
51297
  return TABLE_EVENT_TYPE;
51159
51298
  }
51160
51299
  options;
51161
- version = "0.9.3-alpha.0";
51300
+ version = "0.9.3-alpha.1";
51162
51301
  pagerConf;
51163
51302
  id = `VTable${Date.now()}`;
51164
51303
  headerStyleCache;
@@ -53344,6 +53483,9 @@
53344
53483
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
53345
53484
  const colIndex = layout.getRecordIndexByCol(col);
53346
53485
  indicatorKeys.forEach((key, index) => {
53486
+ if (isArray$3(key)) {
53487
+ key = key[0];
53488
+ }
53347
53489
  const data = layout.dataset.collectedValues[key + '_align']
53348
53490
  ? layout.dataset.collectedValues[key + '_align']
53349
53491
  : layout.dataset.collectedValues[key];
@@ -53360,7 +53502,10 @@
53360
53502
  seriesIndex: index
53361
53503
  }));
53362
53504
  });
53363
- const rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, col)[0];
53505
+ let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, col)[0];
53506
+ if (isArray$3(rowDimensionKey)) {
53507
+ rowDimensionKey = rowDimensionKey[0];
53508
+ }
53364
53509
  const data = layout.dataset.cacheCollectedValues[rowDimensionKey] || layout.dataset.collectedValues[rowDimensionKey];
53365
53510
  const recordRow = layout.getRecordIndexByRow(row);
53366
53511
  const rowPath = layout.getRowKeysPath()[recordRow];
@@ -53384,6 +53529,9 @@
53384
53529
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
53385
53530
  const rowIndex = layout.getRecordIndexByRow(row);
53386
53531
  indicatorKeys.forEach((key, index) => {
53532
+ if (isArray$3(key)) {
53533
+ key = key[0];
53534
+ }
53387
53535
  const data = layout.dataset.collectedValues[key + '_align']
53388
53536
  ? layout.dataset.collectedValues[key + '_align']
53389
53537
  : layout.dataset.collectedValues[key];
@@ -53400,7 +53548,10 @@
53400
53548
  seriesIndex: index
53401
53549
  }));
53402
53550
  });
53403
- const columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
53551
+ let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
53552
+ if (isArray$3(columnDimensionKey)) {
53553
+ columnDimensionKey = columnDimensionKey[0];
53554
+ }
53404
53555
  const data = layout.dataset.cacheCollectedValues[columnDimensionKey] || layout.dataset.collectedValues[columnDimensionKey];
53405
53556
  const recordCol = layout.getRecordIndexByCol(col);
53406
53557
  const colPath = layout.getColKeysPath()[recordCol];
@@ -56006,7 +56157,10 @@
56006
56157
  col >= layout.rowHeaderLevelCount &&
56007
56158
  col < layout.colCount - layout.rightFrozenColCount) {
56008
56159
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, layout.columnHeaderLevelCount - 1);
56009
- const defaultKey = indicatorKeys[1];
56160
+ let defaultKey = indicatorKeys[1];
56161
+ if (isArray$3(defaultKey)) {
56162
+ defaultKey = defaultKey[0];
56163
+ }
56010
56164
  if (!defaultKey) {
56011
56165
  return undefined;
56012
56166
  }
@@ -56037,7 +56191,10 @@
56037
56191
  col >= layout.rowHeaderLevelCount &&
56038
56192
  col < layout.colCount - layout.rightFrozenColCount) {
56039
56193
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
56040
- const defaultKey = indicatorKeys[0];
56194
+ let defaultKey = indicatorKeys[0];
56195
+ if (isArray$3(defaultKey)) {
56196
+ defaultKey = defaultKey[0];
56197
+ }
56041
56198
  const data = layout.dataset.collectedValues[defaultKey + '_align']
56042
56199
  ? layout.dataset.collectedValues[defaultKey + '_align']
56043
56200
  : layout.dataset.collectedValues[defaultKey];
@@ -56072,7 +56229,10 @@
56072
56229
  else if (col === layout.rowHeaderLevelCount - 1 &&
56073
56230
  row >= layout.rowHeaderLevelCount &&
56074
56231
  row < layout.rowCount - layout.bottomFrozenRowCount) {
56075
- const rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row)[0];
56232
+ let rowDimensionKey = layout.getDimensionKeyInChartSpec(layout.rowHeaderLevelCount, row)[0];
56233
+ if (isArray$3(rowDimensionKey)) {
56234
+ rowDimensionKey = rowDimensionKey[0];
56235
+ }
56076
56236
  const data = layout.dataset.collectedValues[rowDimensionKey];
56077
56237
  const recordRow = layout.getRecordIndexByRow(row);
56078
56238
  const rowPath = layout.getRowKeysPath()[recordRow];
@@ -56098,7 +56258,10 @@
56098
56258
  row >= layout.columnHeaderLevelCount &&
56099
56259
  row < layout.rowCount - layout.bottomFrozenRowCount) {
56100
56260
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(col, row);
56101
- const defaultKey = indicatorKeys[0];
56261
+ let defaultKey = indicatorKeys[0];
56262
+ if (isArray$3(defaultKey)) {
56263
+ defaultKey = defaultKey[0];
56264
+ }
56102
56265
  const data = layout.dataset.collectedValues[defaultKey + '_align']
56103
56266
  ? layout.dataset.collectedValues[defaultKey + '_align']
56104
56267
  : layout.dataset.collectedValues[defaultKey];
@@ -56134,7 +56297,10 @@
56134
56297
  row >= layout.columnHeaderLevelCount &&
56135
56298
  row < layout.rowCount - layout.bottomFrozenRowCount) {
56136
56299
  const indicatorKeys = layout.getIndicatorKeyInChartSpec(layout.rowHeaderLevelCount - 1, row);
56137
- const defaultKey = indicatorKeys[1];
56300
+ let defaultKey = indicatorKeys[1];
56301
+ if (isArray$3(defaultKey)) {
56302
+ defaultKey = defaultKey[0];
56303
+ }
56138
56304
  if (!defaultKey) {
56139
56305
  return undefined;
56140
56306
  }
@@ -56164,7 +56330,10 @@
56164
56330
  else if (row === layout.rowCount - layout.bottomFrozenRowCount &&
56165
56331
  col >= layout.rowHeaderLevelCount &&
56166
56332
  col < layout.colCount - layout.rightFrozenColCount) {
56167
- const columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
56333
+ let columnDimensionKey = layout.getDimensionKeyInChartSpec(col, layout.columnHeaderLevelCount)[0];
56334
+ if (isArray$3(columnDimensionKey)) {
56335
+ columnDimensionKey = columnDimensionKey[0];
56336
+ }
56168
56337
  const data = layout.dataset.collectedValues[columnDimensionKey];
56169
56338
  const recordCol = layout.getRecordIndexByCol(col);
56170
56339
  const colPath = layout.getColKeysPath()[recordCol];
@@ -56231,8 +56400,10 @@
56231
56400
  cornerSetting;
56232
56401
  _table;
56233
56402
  hasTwoIndicatorAxes;
56403
+ _chartItemSpanSize;
56234
56404
  constructor(table, dataset) {
56235
56405
  this._table = table;
56406
+ this._chartItemSpanSize = 0;
56236
56407
  this.rowTree = table.options.rowTree;
56237
56408
  this.columnTree = table.options.columnTree;
56238
56409
  this.rowsDefine = table.options.rows ?? [];
@@ -56349,6 +56520,28 @@
56349
56520
  }
56350
56521
  return false;
56351
56522
  });
56523
+ this._chartItemSpanSize = 0;
56524
+ this._indicatorObjects.find(indicatorObject => {
56525
+ if (indicatorObject.chartSpec?.barWidth) {
56526
+ this._chartItemSpanSize = indicatorObject.chartSpec?.barWidth;
56527
+ }
56528
+ if (this._chartItemSpanSize > 0) {
56529
+ return true;
56530
+ }
56531
+ indicatorObject.chartSpec.series?.find((seriesObject) => {
56532
+ if (seriesObject.barWidth) {
56533
+ this._chartItemSpanSize = seriesObject.barWidth;
56534
+ }
56535
+ if (this._chartItemSpanSize > 0) {
56536
+ return true;
56537
+ }
56538
+ return false;
56539
+ });
56540
+ if (this._chartItemSpanSize > 0) {
56541
+ return true;
56542
+ }
56543
+ return false;
56544
+ });
56352
56545
  if (this.indicatorsAsCol) {
56353
56546
  const cell_id = 'rowHeaderEmpty';
56354
56547
  this._headerObjectMap[cell_id] = {
@@ -56547,7 +56740,7 @@
56547
56740
  else if (this.cornerSetting.titleOnDimension === 'row') {
56548
56741
  cornerAttrs = this.rowShowAttrs;
56549
56742
  }
56550
- cornerAttrs.forEach(cornerAttrStr => {
56743
+ cornerAttrs?.forEach(cornerAttrStr => {
56551
56744
  if (!this._headerObjectMap[cornerAttrStr]) {
56552
56745
  const dimensionInfo = this.getDimensionInfo(cornerAttrStr);
56553
56746
  this._headerObjectMap[cornerAttrStr] = {
@@ -57285,7 +57478,8 @@
57285
57478
  break;
57286
57479
  }
57287
57480
  }
57288
- return (collectedValues?.size ?? 0) * 50;
57481
+ const barWidth = this._chartItemSpanSize || 25;
57482
+ return (collectedValues?.length ?? 0) * (barWidth + barWidth / 3);
57289
57483
  }
57290
57484
  getIndicatorKeyInChartSpec(_col, _row) {
57291
57485
  const chartSpec = this.getRawChartSpec(_col, _row);
@@ -58069,6 +58263,7 @@
58069
58263
  const t0 = typeof window !== 'undefined' ? window.performance.now() : 0;
58070
58264
  this.setRecords(records);
58071
58265
  this.processCollectedValuesWithSumBy();
58266
+ this.processCollectedValuesWithSortBy();
58072
58267
  const t1 = typeof window !== 'undefined' ? window.performance.now() : 0;
58073
58268
  console.log('processRecords:', t1 - t0);
58074
58269
  const t4 = typeof window !== 'undefined' ? window.performance.now() : 0;
@@ -58131,6 +58326,15 @@
58131
58326
  }
58132
58327
  }
58133
58328
  }
58329
+ processCollectedValuesWithSortBy() {
58330
+ for (const field in this.collectedValues) {
58331
+ if (this.collectValuesBy[field]?.sortBy) {
58332
+ for (const byKeys in this.collectedValues[field]) {
58333
+ this.collectedValues[field][byKeys] = this.collectedValues[field][byKeys].sort((a, b) => this.collectValuesBy[field]?.sortBy.indexOf(a) - this.collectValuesBy[field]?.sortBy.indexOf(b));
58334
+ }
58335
+ }
58336
+ }
58337
+ }
58134
58338
  processRecords() {
58135
58339
  let isNeedFilter = false;
58136
58340
  if (this.dataConfig?.filterRules?.length >= 1) {
@@ -58194,7 +58398,7 @@
58194
58398
  };
58195
58399
  }
58196
58400
  else {
58197
- this.collectedValues[field][collectKeys] = new Set();
58401
+ this.collectedValues[field][collectKeys] = [];
58198
58402
  }
58199
58403
  }
58200
58404
  if (this.collectValuesBy[field].sumBy) {
@@ -58211,7 +58415,9 @@
58211
58415
  }
58212
58416
  else {
58213
58417
  const fieldRange = this.collectedValues[field][collectKeys];
58214
- fieldRange.add(record[field]);
58418
+ if (fieldRange.indexOf(record[field]) === -1) {
58419
+ fieldRange.push(record[field]);
58420
+ }
58215
58421
  }
58216
58422
  }
58217
58423
  }
@@ -59559,13 +59765,21 @@
59559
59765
  collectValuesBy[xField] = {
59560
59766
  by: columnKeys,
59561
59767
  type: chartSeries.direction !== 'horizontal' ? 'xField' : undefined,
59562
- range: chartSeries.direction === 'horizontal'
59768
+ range: chartSeries.direction === 'horizontal',
59769
+ sortBy: chartSeries.direction !== 'horizontal'
59770
+ ? chartSeries?.data?.fields?.[xField]?.domain ??
59771
+ indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
59772
+ : undefined
59563
59773
  };
59564
59774
  const yField = chartSeries.yField;
59565
59775
  collectValuesBy[yField] = {
59566
59776
  by: rowKeys,
59567
59777
  range: chartSeries.direction !== 'horizontal',
59568
- sumBy: chartSeries.stack !== false && columnKeys.concat(xField)
59778
+ sumBy: chartSeries.stack !== false && columnKeys.concat(xField),
59779
+ sortBy: chartSeries.direction === 'horizontal'
59780
+ ? chartSeries?.data?.fields?.[yField]?.domain ??
59781
+ indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
59782
+ : undefined
59569
59783
  };
59570
59784
  });
59571
59785
  }
@@ -59576,13 +59790,19 @@
59576
59790
  collectValuesBy[xField] = {
59577
59791
  by: columnKeys,
59578
59792
  type: indicatorDefine.chartSpec.direction !== 'horizontal' ? 'xField' : undefined,
59579
- range: indicatorDefine.chartSpec.direction === 'horizontal'
59793
+ range: indicatorDefine.chartSpec.direction === 'horizontal',
59794
+ sortBy: indicatorDefine.chartSpec.direction !== 'horizontal'
59795
+ ? indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
59796
+ : undefined
59580
59797
  };
59581
59798
  const yField = indicatorDefine.chartSpec.yField;
59582
59799
  collectValuesBy[yField] = {
59583
59800
  by: rowKeys,
59584
59801
  range: option.indicators[i].chartSpec.direction !== 'horizontal',
59585
- sumBy: indicatorDefine.chartSpec.stack !== false && columnKeys.concat(xField)
59802
+ sumBy: indicatorDefine.chartSpec.stack !== false && columnKeys.concat(xField),
59803
+ sortBy: indicatorDefine.chartSpec.direction === 'horizontal'
59804
+ ? indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
59805
+ : undefined
59586
59806
  };
59587
59807
  }
59588
59808
  }
@@ -59600,13 +59820,21 @@
59600
59820
  collectValuesBy[yField] = {
59601
59821
  by: rowKeys,
59602
59822
  type: chartSeries.direction === 'horizontal' ? 'yField' : undefined,
59603
- range: chartSeries.direction !== 'horizontal'
59823
+ range: chartSeries.direction !== 'horizontal',
59824
+ sortBy: chartSeries.direction === 'horizontal'
59825
+ ? chartSeries?.data?.fields?.[yField]?.domain ??
59826
+ indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
59827
+ : undefined
59604
59828
  };
59605
59829
  const xField = chartSeries.xField;
59606
59830
  collectValuesBy[xField] = {
59607
59831
  by: columnKeys,
59608
59832
  range: chartSeries.direction === 'horizontal',
59609
- sumBy: chartSeries.stack !== false && rowKeys.concat(yField)
59833
+ sumBy: chartSeries.stack !== false && rowKeys.concat(yField),
59834
+ sortBy: chartSeries.direction !== 'horizontal'
59835
+ ? chartSeries?.data?.fields?.[xField]?.domain ??
59836
+ indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
59837
+ : undefined
59610
59838
  };
59611
59839
  });
59612
59840
  }
@@ -59617,13 +59845,19 @@
59617
59845
  collectValuesBy[yField] = {
59618
59846
  by: rowKeys,
59619
59847
  type: indicatorDefine.chartSpec.direction === 'horizontal' ? 'yField' : undefined,
59620
- range: indicatorDefine.chartSpec.direction !== 'horizontal'
59848
+ range: indicatorDefine.chartSpec.direction !== 'horizontal',
59849
+ sortBy: indicatorDefine.chartSpec.direction === 'horizontal'
59850
+ ? indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
59851
+ : undefined
59621
59852
  };
59622
59853
  const xField = indicatorDefine.chartSpec.xField;
59623
59854
  collectValuesBy[xField] = {
59624
59855
  by: columnKeys,
59625
59856
  range: option.indicators[i].chartSpec.direction === 'horizontal',
59626
- sumBy: indicatorDefine.chartSpec.stack !== false && rowKeys.concat(yField)
59857
+ sumBy: indicatorDefine.chartSpec.stack !== false && rowKeys.concat(yField),
59858
+ sortBy: indicatorDefine.chartSpec.direction !== 'horizontal'
59859
+ ? indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
59860
+ : undefined
59627
59861
  };
59628
59862
  }
59629
59863
  }
@@ -60403,7 +60637,7 @@
60403
60637
  percentCalc: percentCalc
60404
60638
  });
60405
60639
 
60406
- const version = "0.9.3-alpha.0";
60640
+ const version = "0.9.3-alpha.1";
60407
60641
  function getIcons() {
60408
60642
  return get$1();
60409
60643
  }