@visactor/vtable 1.22.11-alpha.5 → 1.22.11-alpha.6

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 (137) hide show
  1. package/cjs/ListTable.d.ts +7 -34
  2. package/cjs/ListTable.js +14 -134
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +3 -0
  5. package/cjs/PivotChart.js +12 -5
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/body-helper/style.js +2 -1
  8. package/cjs/core/BaseTable.js +1 -1
  9. package/cjs/core/BaseTable.js.map +1 -1
  10. package/cjs/core/FouseInput.js +1 -2
  11. package/cjs/core/TABLE_EVENT_TYPE.d.ts +0 -1
  12. package/cjs/core/TABLE_EVENT_TYPE.js +0 -1
  13. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  14. package/cjs/core/record-helper.d.ts +2 -4
  15. package/cjs/core/record-helper.js +24 -81
  16. package/cjs/core/record-helper.js.map +1 -1
  17. package/cjs/data/DataSource.d.ts +0 -1
  18. package/cjs/data/DataSource.js +3 -25
  19. package/cjs/data/DataSource.js.map +1 -1
  20. package/cjs/dataset/DataStatistics.js +2 -1
  21. package/cjs/dataset/dataset-pivot-table.js +1 -2
  22. package/cjs/event/event.d.ts +1 -2
  23. package/cjs/event/event.js +9 -20
  24. package/cjs/event/event.js.map +1 -1
  25. package/cjs/event/listener/table-group.js +10 -6
  26. package/cjs/event/listener/table-group.js.map +1 -1
  27. package/cjs/header-helper/style.js +2 -1
  28. package/cjs/index.d.ts +1 -1
  29. package/cjs/index.js +1 -1
  30. package/cjs/index.js.map +1 -1
  31. package/cjs/layout/index.js +1 -2
  32. package/cjs/layout/pivot-header-layout.d.ts +6 -0
  33. package/cjs/layout/pivot-header-layout.js +39 -20
  34. package/cjs/layout/pivot-header-layout.js.map +1 -1
  35. package/cjs/plugins/custom-cell-style.d.ts +0 -5
  36. package/cjs/plugins/custom-cell-style.js +1 -10
  37. package/cjs/plugins/custom-cell-style.js.map +1 -1
  38. package/cjs/scenegraph/graphic/active-cell-chart-list.d.ts +14 -2
  39. package/cjs/scenegraph/graphic/active-cell-chart-list.js +195 -75
  40. package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  41. package/cjs/scenegraph/graphic/chart.d.ts +9 -1
  42. package/cjs/scenegraph/graphic/chart.js +48 -20
  43. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  44. package/cjs/scenegraph/graphic/contributions/chart-render.js +3 -4
  45. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  46. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -1
  47. package/cjs/scenegraph/refresh-node/update-chart.js +2 -1
  48. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  49. package/cjs/scenegraph/scenegraph.d.ts +2 -2
  50. package/cjs/scenegraph/scenegraph.js +41 -12
  51. package/cjs/scenegraph/scenegraph.js.map +1 -1
  52. package/cjs/state/state.js +1 -1
  53. package/cjs/themes/theme-define.js +6 -0
  54. package/cjs/themes/theme-define.js.map +1 -1
  55. package/cjs/tools/util.d.ts +5 -0
  56. package/cjs/tools/util.js +22 -4
  57. package/cjs/tools/util.js.map +1 -1
  58. package/cjs/ts-types/base-table.d.ts +2 -2
  59. package/cjs/ts-types/base-table.js.map +1 -1
  60. package/cjs/ts-types/events.d.ts +0 -15
  61. package/cjs/ts-types/events.js.map +1 -1
  62. package/cjs/ts-types/table-engine.d.ts +13 -32
  63. package/cjs/ts-types/table-engine.js.map +1 -1
  64. package/cjs/vrender.js.map +1 -1
  65. package/dist/vtable.js +585 -559
  66. package/dist/vtable.min.js +2 -2
  67. package/es/ListTable.d.ts +7 -34
  68. package/es/ListTable.js +14 -130
  69. package/es/ListTable.js.map +1 -1
  70. package/es/PivotChart.d.ts +3 -0
  71. package/es/PivotChart.js +13 -4
  72. package/es/PivotChart.js.map +1 -1
  73. package/es/body-helper/style.js +2 -1
  74. package/es/core/BaseTable.js +1 -1
  75. package/es/core/BaseTable.js.map +1 -1
  76. package/es/core/FouseInput.js +1 -2
  77. package/es/core/TABLE_EVENT_TYPE.d.ts +0 -1
  78. package/es/core/TABLE_EVENT_TYPE.js +0 -1
  79. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  80. package/es/core/record-helper.d.ts +2 -4
  81. package/es/core/record-helper.js +20 -75
  82. package/es/core/record-helper.js.map +1 -1
  83. package/es/data/DataSource.d.ts +0 -1
  84. package/es/data/DataSource.js +3 -25
  85. package/es/data/DataSource.js.map +1 -1
  86. package/es/dataset/DataStatistics.js +2 -1
  87. package/es/dataset/dataset-pivot-table.js +1 -2
  88. package/es/event/event.d.ts +1 -2
  89. package/es/event/event.js +9 -20
  90. package/es/event/event.js.map +1 -1
  91. package/es/event/listener/table-group.js +9 -6
  92. package/es/event/listener/table-group.js.map +1 -1
  93. package/es/header-helper/style.js +2 -1
  94. package/es/index.d.ts +1 -1
  95. package/es/index.js +1 -1
  96. package/es/index.js.map +1 -1
  97. package/es/layout/index.js +1 -2
  98. package/es/layout/pivot-header-layout.d.ts +6 -0
  99. package/es/layout/pivot-header-layout.js +39 -20
  100. package/es/layout/pivot-header-layout.js.map +1 -1
  101. package/es/plugins/custom-cell-style.d.ts +0 -5
  102. package/es/plugins/custom-cell-style.js +1 -10
  103. package/es/plugins/custom-cell-style.js.map +1 -1
  104. package/es/scenegraph/graphic/active-cell-chart-list.d.ts +14 -2
  105. package/es/scenegraph/graphic/active-cell-chart-list.js +183 -68
  106. package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
  107. package/es/scenegraph/graphic/chart.d.ts +9 -1
  108. package/es/scenegraph/graphic/chart.js +47 -19
  109. package/es/scenegraph/graphic/chart.js.map +1 -1
  110. package/es/scenegraph/graphic/contributions/chart-render.js +3 -4
  111. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  112. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -1
  113. package/es/scenegraph/refresh-node/update-chart.js +2 -1
  114. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  115. package/es/scenegraph/scenegraph.d.ts +2 -2
  116. package/es/scenegraph/scenegraph.js +41 -11
  117. package/es/scenegraph/scenegraph.js.map +1 -1
  118. package/es/state/state.js +1 -1
  119. package/es/themes/theme-define.js +6 -0
  120. package/es/themes/theme-define.js.map +1 -1
  121. package/es/tools/util.d.ts +5 -0
  122. package/es/tools/util.js +18 -0
  123. package/es/tools/util.js.map +1 -1
  124. package/es/ts-types/base-table.d.ts +2 -2
  125. package/es/ts-types/base-table.js.map +1 -1
  126. package/es/ts-types/events.d.ts +0 -15
  127. package/es/ts-types/events.js.map +1 -1
  128. package/es/ts-types/table-engine.d.ts +13 -32
  129. package/es/ts-types/table-engine.js.map +1 -1
  130. package/es/vrender.js.map +1 -1
  131. package/package.json +5 -5
  132. package/cjs/core/index.d.ts +0 -1
  133. package/cjs/core/index.js +0 -30
  134. package/cjs/core/index.js.map +0 -1
  135. package/es/core/index.d.ts +0 -1
  136. package/es/core/index.js +0 -2
  137. package/es/core/index.js.map +0 -1
package/dist/vtable.js CHANGED
@@ -36018,6 +36018,47 @@
36018
36018
  }
36019
36019
  };
36020
36020
  }
36021
+ function cancellableThrottle(func, delay) {
36022
+ let timer = null;
36023
+ let lastArgs = null;
36024
+ let context = null;
36025
+ const throttled = function (...args) {
36026
+ lastArgs = args;
36027
+ context = this;
36028
+ if (!timer) {
36029
+ timer = setTimeout(() => {
36030
+ if (lastArgs) {
36031
+ func.apply(context, lastArgs);
36032
+ }
36033
+ timer = null;
36034
+ lastArgs = null;
36035
+ context = null;
36036
+ }, delay);
36037
+ }
36038
+ };
36039
+ const cancel = () => {
36040
+ if (timer) {
36041
+ clearTimeout(timer);
36042
+ timer = null;
36043
+ lastArgs = null;
36044
+ context = null;
36045
+ }
36046
+ };
36047
+ const flush = () => {
36048
+ if (timer && lastArgs) {
36049
+ clearTimeout(timer);
36050
+ func.apply(context, lastArgs);
36051
+ timer = null;
36052
+ lastArgs = null;
36053
+ context = null;
36054
+ }
36055
+ };
36056
+ return {
36057
+ throttled,
36058
+ cancel,
36059
+ flush
36060
+ };
36061
+ }
36021
36062
  function pad(num, totalChars) {
36022
36063
  const pad = '0';
36023
36064
  num = `${num}`;
@@ -36410,7 +36451,6 @@
36410
36451
  AFTER_UPDATE_CELL_CONTENT_WIDTH: 'after_update_cell_content_width',
36411
36452
  AFTER_UPDATE_SELECT_BORDER_HEIGHT: 'after_update_select_border_height',
36412
36453
  CHANGE_CELL_VALUE: 'change_cell_value',
36413
- CHANGE_CELL_VALUES: 'change_cell_values',
36414
36454
  DRAG_FILL_HANDLE_END: 'drag_fill_handle_end',
36415
36455
  MOUSEDOWN_FILL_HANDLE: 'mousedown_fill_handle',
36416
36456
  DBLCLICK_FILL_HANDLE: 'dblclick_fill_handle',
@@ -37665,6 +37705,9 @@
37665
37705
  get textAlign() {
37666
37706
  return defaultStyle.textAlign ?? 'left';
37667
37707
  },
37708
+ get textStickBaseOnAlign() {
37709
+ return defaultStyle.textStickBaseOnAlign;
37710
+ },
37668
37711
  get textBaseline() {
37669
37712
  return defaultStyle.textBaseline ?? 'middle';
37670
37713
  },
@@ -38266,6 +38309,9 @@
38266
38309
  get textStick() {
38267
38310
  return style.textStick;
38268
38311
  },
38312
+ get textStickBaseOnAlign() {
38313
+ return style.textStickBaseOnAlign;
38314
+ },
38269
38315
  get marked() {
38270
38316
  return style.marked;
38271
38317
  },
@@ -38927,48 +38973,6 @@
38927
38973
  }
38928
38974
  }
38929
38975
  }
38930
- changeFieldValueByRecordIndex(value, recordIndex, field, table) {
38931
- if (field === null) {
38932
- return undefined;
38933
- }
38934
- if (recordIndex === undefined || recordIndex === null) {
38935
- return;
38936
- }
38937
- const rawKey = recordIndex.toString();
38938
- if (!this.beforeChangedRecordsMap.has(rawKey)) {
38939
- const rawRecords = Array.isArray(this.dataSourceObj?.records)
38940
- ? this.dataSourceObj.records
38941
- : null;
38942
- const originRecord = rawRecords
38943
- ? Array.isArray(recordIndex)
38944
- ? getValueFromDeepArray(rawRecords, recordIndex)
38945
- : rawRecords[recordIndex]
38946
- : undefined;
38947
- this.beforeChangedRecordsMap.set(rawKey, cloneDeep(originRecord, undefined, ['vtable_gantt_linkedFrom', 'vtable_gantt_linkedTo']) ?? {});
38948
- }
38949
- if (typeof field === 'string' || typeof field === 'number') {
38950
- const beforeChangedValue = this.beforeChangedRecordsMap.get(rawKey)?.[field];
38951
- const rawRecords = Array.isArray(this.dataSourceObj?.records)
38952
- ? this.dataSourceObj.records
38953
- : null;
38954
- const record = rawRecords
38955
- ? Array.isArray(recordIndex)
38956
- ? getValueFromDeepArray(rawRecords, recordIndex)
38957
- : rawRecords[recordIndex]
38958
- : undefined;
38959
- let formatValue = value;
38960
- if (typeof beforeChangedValue === 'number' && isAllDigits(value)) {
38961
- formatValue = parseFloat(value);
38962
- }
38963
- if (record) {
38964
- record[field] = formatValue;
38965
- }
38966
- else if (rawRecords && typeof recordIndex === 'number') {
38967
- rawRecords[recordIndex] = this.addRecordRule === 'Array' ? [] : {};
38968
- rawRecords[recordIndex][field] = formatValue;
38969
- }
38970
- }
38971
- }
38972
38976
  cacheBeforeChangedRecord(dataIndex, table) {
38973
38977
  if (!this.beforeChangedRecordsMap.has(dataIndex.toString())) {
38974
38978
  const originRecord = this.getOriginalRecord(dataIndex);
@@ -39090,20 +39094,11 @@
39090
39094
  }
39091
39095
  }
39092
39096
  adjustBeforeChangedRecordsMap(insertIndex, insertCount, type = 'add') {
39093
- const delta = type === 'add' ? insertCount : -insertCount;
39094
- const numericKeys = [];
39095
- this.beforeChangedRecordsMap.forEach((_, key) => {
39096
- const numKey = Number(key);
39097
- if (Number.isInteger(numKey) && numKey.toString() === key && numKey >= insertIndex) {
39098
- numericKeys.push(numKey);
39099
- }
39100
- });
39101
- numericKeys.sort((a, b) => (type === 'add' ? b - a : a - b));
39102
- for (let i = 0; i < numericKeys.length; i++) {
39103
- const key = numericKeys[i];
39097
+ const length = this.beforeChangedRecordsMap.size;
39098
+ for (let key = length - 1; key >= insertIndex; key--) {
39104
39099
  const record = this.beforeChangedRecordsMap.get(key.toString());
39105
39100
  this.beforeChangedRecordsMap.delete(key.toString());
39106
- this.beforeChangedRecordsMap.set((key + delta).toString(), record);
39101
+ this.beforeChangedRecordsMap.set((key + (type === 'add' ? insertCount : -insertCount)).toString(), record);
39107
39102
  }
39108
39103
  }
39109
39104
  deleteRecords(recordIndexs) {
@@ -39270,11 +39265,7 @@
39270
39265
  }
39271
39266
  }
39272
39267
  if (!filedMapArray.length) {
39273
- filedMapArray = states.map(() => ({
39274
- asc: [],
39275
- desc: [],
39276
- normal: []
39277
- }));
39268
+ filedMapArray = states.map(() => ({ asc: [], desc: [], normal: [] }));
39278
39269
  for (let index = 0; index < states.length; index++) {
39279
39270
  this.sortedIndexMap.set(states[index].field, filedMapArray[index]);
39280
39271
  }
@@ -49024,9 +49015,27 @@
49024
49015
  return hoverMode;
49025
49016
  }
49026
49017
 
49018
+ let brushingChartInstance;
49019
+ let brushingChartInstanceCellPos = { col: -1, row: -1 };
49020
+ function setBrushingChartInstance(chartInstance, col, row) {
49021
+ brushingChartInstance = chartInstance;
49022
+ brushingChartInstanceCellPos = { col, row };
49023
+ }
49024
+ function clearBrushingChartInstance() {
49025
+ brushingChartInstance = undefined;
49026
+ brushingChartInstanceCellPos = { col: -1, row: -1 };
49027
+ }
49028
+ function getBrushingChartInstance() {
49029
+ return brushingChartInstance;
49030
+ }
49031
+ function getBrushingChartInstanceCellPos() {
49032
+ return brushingChartInstanceCellPos;
49033
+ }
49027
49034
  const chartInstanceListColumnByColumnDirection = {};
49028
49035
  const chartInstanceListRowByRowDirection = {};
49036
+ const delayRunDimensionHoverTimer = [];
49029
49037
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = false, isScatter = false) {
49038
+ clearDelayRunDimensionHoverTimers();
49030
49039
  if (!isValid$1(chartInstanceListColumnByColumnDirection[col])) {
49031
49040
  chartInstanceListColumnByColumnDirection[col] = {};
49032
49041
  }
@@ -49036,9 +49045,9 @@
49036
49045
  for (let i = rowStart; i <= rowEnd; i++) {
49037
49046
  const cellGroup = table.scenegraph.getCell(col, i);
49038
49047
  const chartNode = cellGroup?.getChildren()?.[0];
49039
- chartNode.addUpdateShapeAndBoundsTag();
49040
49048
  if (chartInstanceListColumnByColumnDirection[col][i]) ;
49041
49049
  else if (isValid$1(chartNode)) {
49050
+ chartNode.addUpdateShapeAndBoundsTag();
49042
49051
  if (chartNode.activeChartInstance) {
49043
49052
  chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
49044
49053
  }
@@ -49047,44 +49056,13 @@
49047
49056
  chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
49048
49057
  }
49049
49058
  }
49050
- setTimeout(() => {
49059
+ const timer = setTimeout(() => {
49051
49060
  if (chartInstanceListColumnByColumnDirection[col]?.[i]) {
49052
49061
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
49053
49062
  let isShowTooltip = !isScatter;
49054
49063
  if (!isScatter && typeof chartDimensionLinkage === 'object') {
49055
49064
  isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49056
- if (i === rowEnd && isShowTooltip) {
49057
- const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49058
- const { rowEnd: rowEnd1 } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
49059
- if (rowEnd1 === rowEnd) {
49060
- isShowTooltip = true;
49061
- }
49062
- else {
49063
- const { rowEnd: rowEnd2 } = table.getBodyVisibleRowRange(0, 5);
49064
- if (rowEnd2 !== rowEnd) {
49065
- isShowTooltip = true;
49066
- }
49067
- else {
49068
- isShowTooltip = false;
49069
- }
49070
- }
49071
- }
49072
- else if (i === rowStart && isShowTooltip) {
49073
- const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49074
- const { rowStart: rowStart1 } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
49075
- if (rowStart1 === rowStart) {
49076
- isShowTooltip = true;
49077
- }
49078
- else {
49079
- const { rowStart: rowStart2 } = table.getBodyVisibleRowRange(0, -5);
49080
- if (rowStart2 !== rowStart) {
49081
- isShowTooltip = true;
49082
- }
49083
- else {
49084
- isShowTooltip = false;
49085
- }
49086
- }
49087
- }
49065
+ isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table);
49088
49066
  }
49089
49067
  if (isScatter) {
49090
49068
  if (table.stateManager.hover.cellPos.col !== col || table.stateManager.hover.cellPos.row !== i) {
@@ -49097,6 +49075,7 @@
49097
49075
  }
49098
49076
  }
49099
49077
  else {
49078
+ const cellBoundry = table.getCellRelativeRect(col, i);
49100
49079
  const bodyBoundryTop = table.frozenRowCount
49101
49080
  ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom
49102
49081
  : 0;
@@ -49107,43 +49086,32 @@
49107
49086
  }
49108
49087
  chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49109
49088
  tooltip: false,
49110
- showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
49089
+ showTooltipOption: {
49090
+ x: canvasXY.x - cellBoundry.left,
49091
+ y: absolutePositionTop - cellBoundry.top,
49092
+ activeType: 'dimension'
49093
+ }
49111
49094
  });
49112
49095
  }
49113
49096
  else {
49114
49097
  chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
49115
49098
  tooltip: isShowTooltip,
49116
- showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
49099
+ showTooltipOption: {
49100
+ x: canvasXY.x - cellBoundry.left,
49101
+ y: absolutePositionTop - cellBoundry.top,
49102
+ activeType: 'dimension'
49103
+ }
49117
49104
  });
49118
49105
  }
49119
49106
  }
49120
49107
  }
49121
49108
  }, 0);
49109
+ delayRunDimensionHoverTimer.push(timer);
49122
49110
  table.scenegraph.updateNextFrame();
49123
49111
  }
49124
49112
  }
49125
- function clearChartInstanceListByColumnDirection(col, excludedRow, table) {
49126
- if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
49127
- for (const i in chartInstanceListColumnByColumnDirection[col]) {
49128
- if (isValid$1(excludedRow) && Number(i) === excludedRow) {
49129
- continue;
49130
- }
49131
- const cellGroup = table.scenegraph.getCell(col, Number(i));
49132
- const chartNode = cellGroup?.getChildren()?.[0];
49133
- chartNode.addUpdateShapeAndBoundsTag();
49134
- if (isValid$1(chartNode)) {
49135
- chartNode.deactivate(table, {
49136
- releaseChartInstance: true,
49137
- releaseColumnChartInstance: false,
49138
- releaseRowChartInstance: false
49139
- });
49140
- chartInstanceListColumnByColumnDirection[col][i] = null;
49141
- }
49142
- }
49143
- delete chartInstanceListColumnByColumnDirection[col];
49144
- }
49145
- }
49146
49113
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = false, isScatter = false) {
49114
+ clearDelayRunDimensionHoverTimers();
49147
49115
  if (!isValid$1(chartInstanceListRowByRowDirection[row])) {
49148
49116
  chartInstanceListRowByRowDirection[row] = {};
49149
49117
  }
@@ -49153,9 +49121,9 @@
49153
49121
  for (let i = colStart; i <= colEnd; i++) {
49154
49122
  const cellGroup = table.scenegraph.getCell(i, row);
49155
49123
  const chartNode = cellGroup?.getChildren()?.[0];
49156
- chartNode.addUpdateShapeAndBoundsTag();
49157
49124
  if (chartInstanceListRowByRowDirection[row][i]) ;
49158
49125
  else if (isValid$1(chartNode)) {
49126
+ chartNode.addUpdateShapeAndBoundsTag();
49159
49127
  if (chartNode.activeChartInstance) {
49160
49128
  chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance;
49161
49129
  }
@@ -49164,44 +49132,13 @@
49164
49132
  chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance;
49165
49133
  }
49166
49134
  }
49167
- setTimeout(() => {
49135
+ const timer = setTimeout(() => {
49168
49136
  if (chartInstanceListRowByRowDirection[row]?.[i]) {
49169
49137
  const chartDimensionLinkage = table.options.chartDimensionLinkage;
49170
49138
  let isShowTooltip = !isScatter;
49171
49139
  if (!isScatter && typeof chartDimensionLinkage === 'object') {
49172
49140
  isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49173
- if (i === colEnd && isShowTooltip) {
49174
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49175
- const { colEnd: colEnd1 } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
49176
- if (colEnd1 === colEnd) {
49177
- isShowTooltip = true;
49178
- }
49179
- else {
49180
- const { colEnd: colEnd2 } = table.getBodyVisibleColRange(0, 5);
49181
- if (colEnd2 !== colEnd) {
49182
- isShowTooltip = true;
49183
- }
49184
- else {
49185
- isShowTooltip = false;
49186
- }
49187
- }
49188
- }
49189
- else if (i === colStart && isShowTooltip) {
49190
- const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49191
- const { colStart: colStart1 } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
49192
- if (colStart1 === colStart) {
49193
- isShowTooltip = true;
49194
- }
49195
- else {
49196
- const { colStart: colStart2 } = table.getBodyVisibleColRange(0, -5);
49197
- if (colStart2 !== colStart) {
49198
- isShowTooltip = true;
49199
- }
49200
- else {
49201
- isShowTooltip = false;
49202
- }
49203
- }
49204
- }
49141
+ isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(i, table);
49205
49142
  }
49206
49143
  if (isScatter) {
49207
49144
  if (table.stateManager.hover.cellPos.col !== i || table.stateManager.hover.cellPos.row !== row) {
@@ -49214,6 +49151,7 @@
49214
49151
  }
49215
49152
  }
49216
49153
  else {
49154
+ const cellBoundry = table.getCellRelativeRect(i, row);
49217
49155
  const bodyBoundryLeft = table.frozenColCount
49218
49156
  ? table.getCellRelativeRect(table.frozenColCount - 1, row).right
49219
49157
  : 0;
@@ -49224,22 +49162,188 @@
49224
49162
  }
49225
49163
  chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49226
49164
  tooltip: false,
49227
- showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
49165
+ showTooltipOption: {
49166
+ x: absolutePositionLeft - cellBoundry.left,
49167
+ y: canvasXY.y - cellBoundry.top,
49168
+ activeType: 'dimension'
49169
+ }
49228
49170
  });
49229
49171
  }
49230
49172
  else {
49231
49173
  chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
49232
49174
  tooltip: isShowTooltip,
49233
- showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
49175
+ showTooltipOption: {
49176
+ x: absolutePositionLeft - cellBoundry.left,
49177
+ y: canvasXY.y - cellBoundry.top,
49178
+ activeType: 'dimension'
49179
+ }
49234
49180
  });
49235
49181
  }
49236
49182
  }
49237
49183
  }
49238
49184
  }, 0);
49185
+ delayRunDimensionHoverTimer.push(timer);
49239
49186
  table.scenegraph.updateNextFrame();
49240
49187
  }
49241
49188
  }
49242
- function clearChartInstanceListByRowDirection(row, excludedCol, table) {
49189
+ function generateChartInstanceListByViewRange(datum, table, deactivate = false) {
49190
+ clearDelayRunDimensionHoverTimers();
49191
+ const { rowStart } = table.getBodyVisibleRowRange();
49192
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
49193
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
49194
+ const { colStart } = table.getBodyVisibleColRange();
49195
+ let colEnd = table.getBodyVisibleColRange().colEnd;
49196
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
49197
+ for (let col = colStart; col <= colEnd; col++) {
49198
+ if (!isValid$1(chartInstanceListColumnByColumnDirection[col])) {
49199
+ chartInstanceListColumnByColumnDirection[col] = {};
49200
+ }
49201
+ for (let i = rowStart; i <= rowEnd; i++) {
49202
+ const cellGroup = table.scenegraph.getCell(col, i);
49203
+ const chartNode = cellGroup?.getChildren()?.[0];
49204
+ if (chartInstanceListColumnByColumnDirection[col][i]) ;
49205
+ else if (isValid$1(chartNode)) {
49206
+ chartNode.addUpdateShapeAndBoundsTag();
49207
+ if (chartNode.activeChartInstance) {
49208
+ chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
49209
+ }
49210
+ else {
49211
+ if (chartNode.attribute.spec.type === 'pie') {
49212
+ chartNode.activate(table);
49213
+ chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
49214
+ }
49215
+ }
49216
+ }
49217
+ const timer = setTimeout(() => {
49218
+ if (chartInstanceListColumnByColumnDirection[col]?.[i]) {
49219
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
49220
+ let isShowTooltip = true;
49221
+ if (typeof chartDimensionLinkage === 'object') {
49222
+ if (deactivate) {
49223
+ chartInstanceListColumnByColumnDirection[col][i].setHovered();
49224
+ chartInstanceListColumnByColumnDirection[col][i].hideTooltip();
49225
+ }
49226
+ else {
49227
+ isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
49228
+ isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeRow(i, table);
49229
+ isShowTooltip = isShowTooltip && checkIsShowTooltipForEdgeColumn(col, table);
49230
+ chartInstanceListColumnByColumnDirection[col][i].setHovered(datum);
49231
+ isShowTooltip &&
49232
+ chartInstanceListColumnByColumnDirection[col][i].showTooltip(datum, {
49233
+ activeType: 'mark'
49234
+ });
49235
+ }
49236
+ }
49237
+ }
49238
+ }, 0);
49239
+ delayRunDimensionHoverTimer.push(timer);
49240
+ table.scenegraph.updateNextFrame();
49241
+ }
49242
+ }
49243
+ }
49244
+ function checkIsShowTooltipForEdgeRow(row, table) {
49245
+ let isShowTooltip = true;
49246
+ const { rowStart } = table.getBodyVisibleRowRange();
49247
+ let rowEnd = table.getBodyVisibleRowRange().rowEnd;
49248
+ rowEnd = Math.min(table.rowCount - 1 - table.bottomFrozenRowCount, rowEnd);
49249
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
49250
+ if (row === rowEnd && isShowTooltip) {
49251
+ const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49252
+ const { rowEnd: rowEnd1 } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
49253
+ if (rowEnd1 === rowEnd) {
49254
+ isShowTooltip = true;
49255
+ }
49256
+ else {
49257
+ const { rowEnd: rowEnd2 } = table.getBodyVisibleRowRange(0, 5);
49258
+ if (rowEnd2 !== rowEnd) {
49259
+ isShowTooltip = true;
49260
+ }
49261
+ else {
49262
+ isShowTooltip = false;
49263
+ }
49264
+ }
49265
+ }
49266
+ else if (row === rowStart && isShowTooltip) {
49267
+ const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow ?? 0;
49268
+ const { rowStart: rowStart1 } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
49269
+ if (rowStart1 === rowStart) {
49270
+ isShowTooltip = true;
49271
+ }
49272
+ else {
49273
+ const { rowStart: rowStart2 } = table.getBodyVisibleRowRange(0, -5);
49274
+ if (rowStart2 !== rowStart) {
49275
+ isShowTooltip = true;
49276
+ }
49277
+ else {
49278
+ isShowTooltip = false;
49279
+ }
49280
+ }
49281
+ }
49282
+ return isShowTooltip;
49283
+ }
49284
+ function checkIsShowTooltipForEdgeColumn(col, table) {
49285
+ let isShowTooltip = true;
49286
+ const { colStart } = table.getBodyVisibleColRange();
49287
+ let colEnd = table.getBodyVisibleColRange().colEnd;
49288
+ colEnd = Math.min(table.colCount - 1 - table.rightFrozenColCount, colEnd);
49289
+ const chartDimensionLinkage = table.options.chartDimensionLinkage;
49290
+ if (col === colEnd && isShowTooltip) {
49291
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49292
+ const { colEnd: colEnd1 } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
49293
+ if (colEnd1 === colEnd) {
49294
+ isShowTooltip = true;
49295
+ }
49296
+ else {
49297
+ const { colEnd: colEnd2 } = table.getBodyVisibleColRange(0, 5);
49298
+ if (colEnd2 !== colEnd) {
49299
+ isShowTooltip = true;
49300
+ }
49301
+ else {
49302
+ isShowTooltip = false;
49303
+ }
49304
+ }
49305
+ }
49306
+ else if (col === colStart && isShowTooltip) {
49307
+ const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
49308
+ const { colStart: colStart1 } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
49309
+ if (colStart1 === colStart) {
49310
+ isShowTooltip = true;
49311
+ }
49312
+ else {
49313
+ const { colStart: colStart2 } = table.getBodyVisibleColRange(0, -5);
49314
+ if (colStart2 !== colStart) {
49315
+ isShowTooltip = true;
49316
+ }
49317
+ else {
49318
+ isShowTooltip = false;
49319
+ }
49320
+ }
49321
+ }
49322
+ return isShowTooltip;
49323
+ }
49324
+ function clearChartInstanceListByColumnDirection(col, excludedRow, table, forceRelease = false) {
49325
+ if (isValid$1(chartInstanceListColumnByColumnDirection[col])) {
49326
+ for (const i in chartInstanceListColumnByColumnDirection[col]) {
49327
+ if (isValid$1(excludedRow) && Number(i) === excludedRow) {
49328
+ continue;
49329
+ }
49330
+ const cellGroup = table.scenegraph.getCell(col, Number(i));
49331
+ const chartNode = cellGroup?.getChildren()?.[0];
49332
+ if (isValid$1(chartNode)) {
49333
+ chartNode.addUpdateShapeAndBoundsTag();
49334
+ chartNode.deactivate(table, {
49335
+ forceRelease: forceRelease,
49336
+ releaseChartInstance: true,
49337
+ releaseColumnChartInstance: false,
49338
+ releaseRowChartInstance: false
49339
+ });
49340
+ chartInstanceListColumnByColumnDirection[col][i] = null;
49341
+ }
49342
+ }
49343
+ delete chartInstanceListColumnByColumnDirection[col];
49344
+ }
49345
+ }
49346
+ function clearChartInstanceListByRowDirection(row, excludedCol, table, forceRelease = false) {
49243
49347
  if (isValid$1(chartInstanceListRowByRowDirection[row])) {
49244
49348
  for (const i in chartInstanceListRowByRowDirection[row]) {
49245
49349
  if (isValid$1(excludedCol) && Number(i) === excludedCol) {
@@ -49247,9 +49351,10 @@
49247
49351
  }
49248
49352
  const cellGroup = table.scenegraph.getCell(Number(i), row);
49249
49353
  const chartNode = cellGroup?.getChildren()?.[0];
49250
- chartNode.addUpdateShapeAndBoundsTag();
49251
49354
  if (isValid$1(chartNode)) {
49355
+ chartNode.addUpdateShapeAndBoundsTag();
49252
49356
  chartNode.deactivate(table, {
49357
+ forceRelease: forceRelease,
49253
49358
  releaseChartInstance: true,
49254
49359
  releaseColumnChartInstance: false,
49255
49360
  releaseRowChartInstance: false
@@ -49260,6 +49365,56 @@
49260
49365
  }
49261
49366
  delete chartInstanceListRowByRowDirection[row];
49262
49367
  }
49368
+ function clearDelayRunDimensionHoverTimers() {
49369
+ for (const timer of delayRunDimensionHoverTimer) {
49370
+ clearTimeout(timer);
49371
+ }
49372
+ delayRunDimensionHoverTimer.length = 0;
49373
+ }
49374
+ function clearAllChartInstanceList(table, forceRelease = false) {
49375
+ clearDelayRunDimensionHoverTimers();
49376
+ for (const col in chartInstanceListColumnByColumnDirection) {
49377
+ clearChartInstanceListByColumnDirection(Number(col), undefined, table, forceRelease);
49378
+ }
49379
+ for (const row in chartInstanceListRowByRowDirection) {
49380
+ clearChartInstanceListByRowDirection(Number(row), undefined, table, forceRelease);
49381
+ }
49382
+ }
49383
+ function disableDimensionHoverToAllChartInstances() {
49384
+ clearDelayRunDimensionHoverTimers();
49385
+ for (const col in chartInstanceListColumnByColumnDirection) {
49386
+ for (const row in chartInstanceListColumnByColumnDirection[col]) {
49387
+ chartInstanceListColumnByColumnDirection[col][row].disableDimensionHoverEvent(true);
49388
+ chartInstanceListColumnByColumnDirection[col][row].disableCrossHair(true);
49389
+ chartInstanceListColumnByColumnDirection[col][row].disableTooltip(true);
49390
+ chartInstanceListColumnByColumnDirection[col][row].hideTooltip();
49391
+ }
49392
+ }
49393
+ for (const row in chartInstanceListRowByRowDirection) {
49394
+ for (const col in chartInstanceListRowByRowDirection[row]) {
49395
+ chartInstanceListRowByRowDirection[row][col].disableDimensionHoverEvent(true);
49396
+ chartInstanceListRowByRowDirection[row][col].disableCrossHair(true);
49397
+ chartInstanceListRowByRowDirection[row][col].disableTooltip(true);
49398
+ chartInstanceListRowByRowDirection[row][col].hideTooltip();
49399
+ }
49400
+ }
49401
+ }
49402
+ function enableDimensionHoverToAllChartInstances() {
49403
+ for (const col in chartInstanceListColumnByColumnDirection) {
49404
+ for (const row in chartInstanceListColumnByColumnDirection[col]) {
49405
+ chartInstanceListColumnByColumnDirection[col][row].disableDimensionHoverEvent(false);
49406
+ chartInstanceListColumnByColumnDirection[col][row].disableCrossHair(false);
49407
+ chartInstanceListColumnByColumnDirection[col][row].disableTooltip(false);
49408
+ }
49409
+ }
49410
+ for (const row in chartInstanceListRowByRowDirection) {
49411
+ for (const col in chartInstanceListRowByRowDirection[row]) {
49412
+ chartInstanceListRowByRowDirection[row][col].disableDimensionHoverEvent(false);
49413
+ chartInstanceListRowByRowDirection[row][col].disableCrossHair(false);
49414
+ chartInstanceListRowByRowDirection[row][col].disableTooltip(false);
49415
+ }
49416
+ }
49417
+ }
49263
49418
 
49264
49419
  function isValidAlignDomain(domain) {
49265
49420
  return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -50219,6 +50374,7 @@
50219
50374
  type = 'chart';
50220
50375
  chartInstance;
50221
50376
  activeChartInstance;
50377
+ activeChartInstanceLastViewBox = null;
50222
50378
  activeChartInstanceHoverOnMark = null;
50223
50379
  justShowMarkTooltip = undefined;
50224
50380
  justShowMarkTooltipTimer = Date.now();
@@ -50263,7 +50419,6 @@
50263
50419
  y1: y1 - table.scrollTop,
50264
50420
  y2: y2 - table.scrollTop
50265
50421
  });
50266
- this.activeChartInstance?.release();
50267
50422
  this.attribute.ClassType.globalConfig.uniqueTooltip = false;
50268
50423
  this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
50269
50424
  renderCanvas: this.attribute.canvas,
@@ -50316,7 +50471,7 @@
50316
50471
  }
50317
50472
  }
50318
50473
  },
50319
- componentShowContent: table.options.chartDimensionLinkage &&
50474
+ componentShowContent: table.options.chartDimensionLinkage?.showTooltip &&
50320
50475
  this.attribute.spec.type !== 'scatter'
50321
50476
  ? {
50322
50477
  tooltip: {
@@ -50337,20 +50492,49 @@
50337
50492
  table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
50338
50493
  this.activeChartInstance.on('click', (params) => {
50339
50494
  if (this.attribute.spec.select?.enable === false) {
50340
- table.scenegraph.updateChartState(null);
50495
+ table.scenegraph.updateChartState(null, undefined);
50341
50496
  }
50342
50497
  else if (Chart.temp) {
50343
- table.scenegraph.updateChartState(params?.datum);
50498
+ table.scenegraph.updateChartState(params?.datum, 'click');
50499
+ }
50500
+ });
50501
+ let brushChangeThrottle;
50502
+ if (table.options.chartDimensionLinkage?.listenBrushChange) {
50503
+ brushChangeThrottle = cancellableThrottle(table.scenegraph.updateChartState.bind(table.scenegraph), table.options.chartDimensionLinkage?.brushChangeDelay ?? 100);
50504
+ this.activeChartInstance.on('brushChange', (params) => {
50505
+ brushChangeThrottle.throttled(params?.value?.inBrushData, 'brush');
50506
+ });
50507
+ }
50508
+ this.activeChartInstance.on('brushStart', (params) => {
50509
+ const brushingChartInstance = getBrushingChartInstance();
50510
+ if (brushingChartInstance !== this.activeChartInstance) {
50511
+ if (brushingChartInstance) {
50512
+ brushingChartInstance.getChart().getComponentsByKey('brush')[0].clearBrushStateAndMask();
50513
+ }
50514
+ setBrushingChartInstance(this.activeChartInstance, col, row);
50344
50515
  }
50345
50516
  });
50346
50517
  this.activeChartInstance.on('brushEnd', (params) => {
50347
- table.scenegraph.updateChartState(params?.value?.inBrushData);
50518
+ brushChangeThrottle?.cancel();
50519
+ table.scenegraph.updateChartState(params?.value?.inBrushData, 'brush');
50348
50520
  Chart.temp = 0;
50349
50521
  setTimeout(() => {
50350
50522
  Chart.temp = 1;
50351
50523
  }, 0);
50352
50524
  });
50353
- if (table.options.chartDimensionLinkage) {
50525
+ if (table.options.chartDimensionLinkage?.showTooltip) {
50526
+ if (this.attribute.spec.type === 'pie') {
50527
+ this.activeChartInstance.on('pointerover', { markName: 'pie' }, (params) => {
50528
+ const categoryField = this.attribute.spec.categoryField;
50529
+ const datum = { [categoryField]: params?.datum?.[categoryField] };
50530
+ generateChartInstanceListByViewRange(datum, table, false);
50531
+ });
50532
+ this.activeChartInstance.on('pointerout', { markName: 'pie' }, (params) => {
50533
+ const categoryField = this.attribute.spec.categoryField;
50534
+ const datum = { [categoryField]: params?.datum?.[categoryField] };
50535
+ generateChartInstanceListByViewRange(datum, table, true);
50536
+ });
50537
+ }
50354
50538
  this.activeChartInstance.on('dimensionHover', (params) => {
50355
50539
  const dimensionInfo = params?.dimensionInfo[0];
50356
50540
  const canvasXY = params?.event?.canvas;
@@ -50488,21 +50672,23 @@
50488
50672
  table._bindChartEvent?.(this.activeChartInstance);
50489
50673
  }
50490
50674
  static temp = 1;
50491
- deactivate(table, { releaseChartInstance = true, releaseColumnChartInstance = true, releaseRowChartInstance = true } = {}) {
50675
+ deactivate(table, { forceRelease = false, releaseChartInstance = true, releaseColumnChartInstance = true, releaseRowChartInstance = true, releaseAllChartInstance = false } = {}) {
50492
50676
  this.activeChartInstanceHoverOnMark = null;
50493
50677
  this.justShowMarkTooltip = undefined;
50494
50678
  this.justShowMarkTooltipTimer = Date.now();
50495
50679
  clearTimeout(this.delayRunDimensionHoverTimer);
50496
50680
  this.delayRunDimensionHoverTimer = undefined;
50497
50681
  if (releaseChartInstance) {
50498
- this.activeChartInstance?.updateViewBox({
50499
- x1: -1000,
50500
- x2: -800,
50501
- y1: -1000,
50502
- y2: -800
50503
- }, false, false);
50504
- this.activeChartInstance?.release();
50505
- this.activeChartInstance = null;
50682
+ if (forceRelease || !getBrushingChartInstance() || getBrushingChartInstance() !== this.activeChartInstance) {
50683
+ this.activeChartInstance?.updateViewBox({
50684
+ x1: -1000,
50685
+ x2: -800,
50686
+ y1: -1000,
50687
+ y2: -800
50688
+ }, false, false);
50689
+ this.activeChartInstance?.release();
50690
+ this.activeChartInstance = null;
50691
+ }
50506
50692
  const { col, row } = this.parent;
50507
50693
  table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) &&
50508
50694
  table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild?.hideLabelHoverOnAxis?.();
@@ -50522,11 +50708,16 @@
50522
50708
  table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild?.hideLabelHoverOnAxis?.();
50523
50709
  }
50524
50710
  }
50525
- if (releaseColumnChartInstance) {
50526
- clearChartInstanceListByColumnDirection(this.parent.col, this.attribute.spec.type === 'scatter' ? this.parent.row : undefined, table);
50711
+ if (releaseAllChartInstance) {
50712
+ clearAllChartInstanceList(table, forceRelease);
50527
50713
  }
50528
- if (releaseRowChartInstance) {
50529
- clearChartInstanceListByRowDirection(this.parent.row, this.attribute.spec.type === 'scatter' ? this.parent.col : undefined, table);
50714
+ else {
50715
+ if (releaseColumnChartInstance) {
50716
+ clearChartInstanceListByColumnDirection(this.parent.col, this.attribute.spec.type === 'scatter' ? this.parent.row : undefined, table, forceRelease);
50717
+ }
50718
+ if (releaseRowChartInstance) {
50719
+ clearChartInstanceListByRowDirection(this.parent.row, this.attribute.spec.type === 'scatter' ? this.parent.col : undefined, table, forceRelease);
50720
+ }
50530
50721
  }
50531
50722
  }
50532
50723
  updateData(data) {
@@ -50537,12 +50728,19 @@
50537
50728
  const padding = this.attribute.cellPadding;
50538
50729
  const table = this.stage.table;
50539
50730
  const { x1, y1, x2, y2 } = cellGroup.globalAABBBounds;
50540
- return {
50731
+ const viewBox = {
50541
50732
  x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
50542
50733
  x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
50543
50734
  y1: Math.ceil(y1 + padding[0] + table.scrollTop + (table.options.viewBox?.y1 ?? 0)),
50544
50735
  y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (table.options.viewBox?.y1 ?? 0))
50545
50736
  };
50737
+ if (this.activeChartInstance) {
50738
+ this.activeChartInstanceLastViewBox = viewBox;
50739
+ }
50740
+ else {
50741
+ this.activeChartInstanceLastViewBox = null;
50742
+ }
50743
+ return viewBox;
50546
50744
  }
50547
50745
  }
50548
50746
  function getTableBounds(col, row, table) {
@@ -50811,7 +51009,6 @@
50811
51009
  drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
50812
51010
  const groupAttribute = getTheme(chart, params?.theme).group;
50813
51011
  const { dataId, data, spec } = chart.attribute;
50814
- chart.getViewBox();
50815
51012
  const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
50816
51013
  const { table } = chart.getRootNode();
50817
51014
  const { cacheCanvas, activeChartInstance } = chart;
@@ -50834,13 +51031,20 @@
50834
51031
  activeChartInstance.updateSpecSync(spec, false, { reuse: false, morph: false });
50835
51032
  }
50836
51033
  }
51034
+ const lastViewBox = chart.activeChartInstanceLastViewBox;
50837
51035
  const viewBox = chart.getViewBox();
50838
- activeChartInstance.updateViewBox({
50839
- x1: 0,
50840
- x2: viewBox.x2 - viewBox.x1,
50841
- y1: 0,
50842
- y2: viewBox.y2 - viewBox.y1
50843
- }, false, false);
51036
+ if (!(lastViewBox &&
51037
+ viewBox.x1 === lastViewBox.x1 &&
51038
+ viewBox.x2 === lastViewBox.x2 &&
51039
+ viewBox.y1 === lastViewBox.y1 &&
51040
+ viewBox.y2 === lastViewBox.y2)) {
51041
+ activeChartInstance.updateViewBox({
51042
+ x1: 0,
51043
+ x2: viewBox.x2 - viewBox.x1,
51044
+ y1: 0,
51045
+ y2: viewBox.y2 - viewBox.y1
51046
+ }, false, false);
51047
+ }
50844
51048
  const chartStage = activeChartInstance.getStage();
50845
51049
  chartStage.needRender = true;
50846
51050
  const matrix = chart.globalTransMatrix.clone();
@@ -56956,9 +57160,10 @@
56956
57160
  updateTableAxes(scenegraph.rightFrozenGroup, scenegraph.table);
56957
57161
  updateTableAxes(scenegraph.bottomFrozenGroup, scenegraph.table);
56958
57162
  }
56959
- function updateChartState(scenegraph, datum) {
57163
+ function updateChartState(scenegraph, datum, selectedDataMode) {
56960
57164
  const table = scenegraph.table;
56961
57165
  if (table.isPivotChart()) {
57166
+ table._selectedDataMode = selectedDataMode;
56962
57167
  const preSelectItemsCount = table._selectedDataItemsInChart.length;
56963
57168
  if ((datum === null || datum === undefined || datum?.length === 0 || Object.keys(datum).length === 0) &&
56964
57169
  preSelectItemsCount === 0) {
@@ -58225,38 +58430,70 @@
58225
58430
  resetResidentHoverIcon(col, row) {
58226
58431
  resetResidentHoverIcon(col, row, this);
58227
58432
  }
58228
- deactivateChart(col, row) {
58433
+ deactivateChart(col, row, forceRelease = false) {
58229
58434
  if (col === -1 || row === -1) {
58435
+ if (forceRelease) {
58436
+ const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos();
58437
+ const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
58438
+ if (cellGroup?.firstChild?.deactivate) {
58439
+ clearBrushingChartInstance();
58440
+ cellGroup?.firstChild?.deactivate?.(this.table, {
58441
+ forceRelease: true,
58442
+ releaseChartInstance: true,
58443
+ releaseColumnChartInstance: true,
58444
+ releaseRowChartInstance: true,
58445
+ releaseAllChartInstance: true
58446
+ });
58447
+ }
58448
+ }
58230
58449
  return;
58231
58450
  }
58232
58451
  const cellGroup = this.getCell(col, row);
58233
58452
  if (cellGroup?.firstChild?.deactivate) {
58453
+ if (forceRelease) {
58454
+ clearBrushingChartInstance();
58455
+ cellGroup?.firstChild?.deactivate?.(this.table, {
58456
+ forceRelease: true,
58457
+ releaseChartInstance: true,
58458
+ releaseColumnChartInstance: true,
58459
+ releaseRowChartInstance: true,
58460
+ releaseAllChartInstance: true
58461
+ });
58462
+ return;
58463
+ }
58234
58464
  const chartNode = cellGroup?.firstChild;
58235
58465
  const chartType = chartNode.attribute.spec.type;
58236
- cellGroup?.firstChild?.deactivate?.(this.table, this.table.options.chartDimensionLinkage
58466
+ cellGroup?.firstChild?.deactivate?.(this.table, this.table.options.chartDimensionLinkage?.showTooltip
58237
58467
  ? {
58238
- releaseChartInstance: chartType === 'scatter'
58239
- ? (col !== this.table.stateManager.hover.cellPos.col &&
58240
- row !== this.table.stateManager.hover.cellPos.row) ||
58468
+ releaseChartInstance: chartType === 'pie'
58469
+ ? false
58470
+ : chartType === 'scatter'
58471
+ ? (col !== this.table.stateManager.hover.cellPos.col &&
58472
+ row !== this.table.stateManager.hover.cellPos.row) ||
58473
+ this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58474
+ this.table.stateManager.hover.cellPos.row >
58475
+ this.table.rowCount - 1 - this.table.bottomFrozenRowCount ||
58476
+ this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58477
+ this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58478
+ : this.table.options.indicatorsAsCol
58479
+ ? row !== this.table.stateManager.hover.cellPos.row ||
58480
+ this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58481
+ this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58482
+ : col !== this.table.stateManager.hover.cellPos.col ||
58483
+ this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58484
+ this.table.stateManager.hover.cellPos.row >
58485
+ this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58486
+ releaseColumnChartInstance: chartType === 'pie'
58487
+ ? false
58488
+ : col !== this.table.stateManager.hover.cellPos.col ||
58241
58489
  this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58242
58490
  this.table.stateManager.hover.cellPos.row >
58243
- this.table.rowCount - 1 - this.table.bottomFrozenRowCount ||
58491
+ this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58492
+ releaseRowChartInstance: chartType === 'pie'
58493
+ ? false
58494
+ : row !== this.table.stateManager.hover.cellPos.row ||
58244
58495
  this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58245
58496
  this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58246
- : this.table.options.indicatorsAsCol
58247
- ? row !== this.table.stateManager.hover.cellPos.row ||
58248
- this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58249
- this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58250
- : col !== this.table.stateManager.hover.cellPos.col ||
58251
- this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58252
- this.table.stateManager.hover.cellPos.row >
58253
- this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58254
- releaseColumnChartInstance: col !== this.table.stateManager.hover.cellPos.col ||
58255
- this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount ||
58256
- this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount,
58257
- releaseRowChartInstance: row !== this.table.stateManager.hover.cellPos.row ||
58258
- this.table.stateManager.hover.cellPos.col < this.table.frozenColCount ||
58259
- this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount
58260
58497
  }
58261
58498
  : undefined);
58262
58499
  }
@@ -58313,8 +58550,17 @@
58313
58550
  updateChartSizeForResizeRowHeight(row) {
58314
58551
  updateChartSizeForResizeRowHeight(this, row);
58315
58552
  }
58316
- updateChartState(datum) {
58317
- this.table.isPivotChart() && updateChartState(this, datum);
58553
+ updateChartState(datum, selectedDataMode) {
58554
+ if (this.table.isPivotChart()) {
58555
+ if (datum === null || datum === undefined || datum?.length === 0 || Object.keys(datum).length === 0) {
58556
+ const brushingChartInstance = getBrushingChartInstance();
58557
+ if (brushingChartInstance) {
58558
+ brushingChartInstance.getChart().getComponentsByKey('brush')[0].clearBrushStateAndMask();
58559
+ }
58560
+ this.table.options.chartDimensionLinkage?.clearChartState?.();
58561
+ }
58562
+ updateChartState(this, datum, selectedDataMode);
58563
+ }
58318
58564
  }
58319
58565
  updateCheckboxCellState(col, row, checked) {
58320
58566
  if (this.table.transpose) {
@@ -63601,7 +63847,7 @@
63601
63847
  return;
63602
63848
  }
63603
63849
  if (table.isPivotChart() && eventArgsSet?.eventArgs?.target.type !== 'chart') {
63604
- table.scenegraph.updateChartState(null);
63850
+ table.scenegraph.updateChartState(null, undefined);
63605
63851
  }
63606
63852
  if (eventArgsSet.eventArgs?.target !== stateManager.residentHoverIcon?.icon) {
63607
63853
  stateManager.hideMenu();
@@ -63670,7 +63916,7 @@
63670
63916
  else {
63671
63917
  if (!eventManager.checkCellFillhandle(eventArgsSet) &&
63672
63918
  (eventManager.checkColumnResize(eventArgsSet, true) || eventManager.checkRowResize(eventArgsSet, true))) {
63673
- table.scenegraph.updateChartState(null);
63919
+ table.scenegraph.updateChartState(null, undefined);
63674
63920
  stateManager.updateInteractionState(InteractionState.grabing);
63675
63921
  return;
63676
63922
  }
@@ -63915,7 +64161,7 @@
63915
64161
  !eventManager.checkCellFillhandle(eventArgsSet) &&
63916
64162
  !stateManager.columnResize.resizing &&
63917
64163
  eventManager.checkColumnResize(eventArgsSet, true)) {
63918
- table.scenegraph.updateChartState(null);
64164
+ table.scenegraph.updateChartState(null, undefined);
63919
64165
  stateManager.updateInteractionState(InteractionState.grabing);
63920
64166
  const { eventArgs } = eventArgsSet;
63921
64167
  if (!eventArgs?.targetCell) {
@@ -63962,7 +64208,7 @@
63962
64208
  }
63963
64209
  stateManager.endSelectCells(true, isHasSelected);
63964
64210
  stateManager.updateCursor();
63965
- table.scenegraph.updateChartState(null);
64211
+ table.scenegraph.updateChartState(null, undefined);
63966
64212
  }
63967
64213
  else if (table.eventManager.isDraging && stateManager.isSelecting()) {
63968
64214
  stateManager.endSelectCells();
@@ -64153,6 +64399,10 @@
64153
64399
  const legend = e.path.find(node => node.name === 'legend');
64154
64400
  if (!legend) {
64155
64401
  table.editorManager?.completeEdit();
64402
+ const { cellPos } = table.stateManager.hover;
64403
+ const prevHoverCellCol = cellPos.col;
64404
+ const prevHoverCellRow = cellPos.row;
64405
+ table.scenegraph.deactivateChart(prevHoverCellCol, prevHoverCellRow, true);
64156
64406
  if (table.eventManager._enableTableScroll) {
64157
64407
  handleWhell(e, stateManager);
64158
64408
  }
@@ -65505,7 +65755,6 @@
65505
65755
  cutOperationTime = 0;
65506
65756
  lastClipboardContent = '';
65507
65757
  cutCellRange = null;
65508
- cutRanges = null;
65509
65758
  copySourceRange = null;
65510
65759
  constructor(table) {
65511
65760
  this.table = table;
@@ -66025,10 +66274,6 @@
66025
66274
  this.handleCopy(e, true);
66026
66275
  this.cutWaitPaste = true;
66027
66276
  this.cutCellRange = this.table.getSelectedCellInfos();
66028
- this.cutRanges = this.table.stateManager.select.ranges?.map(r => ({
66029
- start: { col: r.start.col, row: r.start.row },
66030
- end: { col: r.end.col, row: r.end.row }
66031
- }));
66032
66277
  if (this.clipboardCheckTimer) {
66033
66278
  clearTimeout(this.clipboardCheckTimer);
66034
66279
  }
@@ -66036,7 +66281,6 @@
66036
66281
  if (this.cutWaitPaste) {
66037
66282
  this.cutWaitPaste = false;
66038
66283
  this.cutCellRange = null;
66039
- this.cutRanges = null;
66040
66284
  this.clipboardCheckTimer = null;
66041
66285
  }
66042
66286
  }, 30000);
@@ -66056,7 +66300,6 @@
66056
66300
  if (this.cutWaitPaste) {
66057
66301
  this.cutWaitPaste = false;
66058
66302
  this.cutCellRange = null;
66059
- this.cutRanges = null;
66060
66303
  if (this.clipboardCheckTimer) {
66061
66304
  clearTimeout(this.clipboardCheckTimer);
66062
66305
  this.clipboardCheckTimer = null;
@@ -66172,11 +66415,17 @@
66172
66415
  }
66173
66416
  clearCutArea(table) {
66174
66417
  try {
66175
- const ranges = this.cutRanges;
66176
- if (!ranges || ranges.length === 0) {
66418
+ const selectCells = this.cutCellRange;
66419
+ if (!selectCells || selectCells.length === 0) {
66177
66420
  return;
66178
66421
  }
66179
- table.changeCellValuesByIds(ranges, '');
66422
+ for (let i = 0; i < selectCells.length; i++) {
66423
+ for (let j = 0; j < selectCells[i].length; j++) {
66424
+ if (selectCells[i][j]) {
66425
+ table.changeCellValue(selectCells[i][j].col, selectCells[i][j].row, undefined);
66426
+ }
66427
+ }
66428
+ }
66180
66429
  }
66181
66430
  catch (error) {
66182
66431
  }
@@ -69698,15 +69947,6 @@
69698
69947
  this.customCellStyle = customCellStyle;
69699
69948
  this.customCellStyleArrangement = customCellStyleArrangement;
69700
69949
  }
69701
- clearCustomCellStyleArrangement() {
69702
- this.customCellStyleArrangement = [];
69703
- }
69704
- addCustomCellStyleArrangement(cellPosition, customStyleId) {
69705
- this.customCellStyleArrangement.push({
69706
- cellPosition,
69707
- customStyleId
69708
- });
69709
- }
69710
69950
  getCustomCellStyle(col, row) {
69711
69951
  const customStyleIds = this.getCustomCellStyleIds(col, row);
69712
69952
  if (customStyleIds.length) {
@@ -70235,7 +70475,7 @@
70235
70475
  return TABLE_EVENT_TYPE;
70236
70476
  }
70237
70477
  options;
70238
- version = "1.22.11-alpha.5";
70478
+ version = "1.22.11-alpha.6";
70239
70479
  pagination;
70240
70480
  id = `VTable${Date.now()}`;
70241
70481
  headerStyleCache;
@@ -76273,10 +76513,9 @@
76273
76513
  return { addRecordRule };
76274
76514
  }
76275
76515
 
76276
- function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
76516
+ function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
76277
76517
  if ((workOnEditableCell && table.isHasEditorDefine(col, row)) || workOnEditableCell === false) {
76278
- const recordShowIndex = table.getRecordShowIndexByCell(col, row);
76279
- const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
76518
+ const recordIndex = table.getRecordShowIndexByCell(col, row);
76280
76519
  const { field } = table.internalProps.layoutMap.getBody(col, row);
76281
76520
  const beforeChangeValue = table.getCellRawValue(col, row);
76282
76521
  const oldValue = table.getCellOriginValue(col, row);
@@ -76284,7 +76523,7 @@
76284
76523
  table.internalProps.layoutMap.updateColumnTitle(col, row, value);
76285
76524
  }
76286
76525
  else {
76287
- table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
76526
+ table.dataSource.changeFieldValue(value, recordIndex, field, col, row, table);
76288
76527
  }
76289
76528
  const range = table.getCellRange(col, row);
76290
76529
  const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
@@ -76337,24 +76576,18 @@
76337
76576
  }
76338
76577
  const changedValue = table.getCellOriginValue(col, row);
76339
76578
  if (oldValue !== changedValue && triggerEvent) {
76340
- const changeValue = {
76579
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
76341
76580
  col,
76342
76581
  row,
76343
- recordIndex,
76344
- field,
76345
76582
  rawValue: beforeChangeValue,
76346
76583
  currentValue: oldValue,
76347
76584
  changedValue
76348
- };
76349
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
76350
- if (!silentChangeCellValuesEvent) {
76351
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
76352
- }
76585
+ });
76353
76586
  }
76354
76587
  table.scenegraph.updateNextFrame();
76355
76588
  }
76356
76589
  }
76357
- async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
76590
+ async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
76358
76591
  const changedCellResults = [];
76359
76592
  let pasteColEnd = startCol;
76360
76593
  let pasteRowEnd = startRow;
@@ -76381,7 +76614,6 @@
76381
76614
  oldRowValues.push(oldValue);
76382
76615
  }
76383
76616
  }
76384
- const resultChangeValues = [];
76385
76617
  for (let i = 0; i < values.length; i++) {
76386
76618
  if (startRow + i > table.rowCount - 1) {
76387
76619
  break;
@@ -76421,8 +76653,7 @@
76421
76653
  if (isCanChange) {
76422
76654
  changedCellResults[i][j] = true;
76423
76655
  const value = rowValues[j];
76424
- const recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
76425
- const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
76656
+ const recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
76426
76657
  const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);
76427
76658
  const beforeChangeValue = beforeChangeValues[i][j];
76428
76659
  const oldValue = oldValues[i][j];
@@ -76430,21 +76661,17 @@
76430
76661
  table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value);
76431
76662
  }
76432
76663
  else {
76433
- table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
76664
+ table.dataSource.changeFieldValue(value, recordIndex, field, startCol + j, startRow + i, table);
76434
76665
  }
76435
76666
  const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
76436
76667
  if (oldValue !== changedValue && triggerEvent) {
76437
- const changeValue = {
76668
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
76438
76669
  col: startCol + j,
76439
76670
  row: startRow + i,
76440
- recordIndex,
76441
- field,
76442
76671
  rawValue: beforeChangeValue,
76443
76672
  currentValue: oldValue,
76444
76673
  changedValue
76445
- };
76446
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
76447
- resultChangeValues.push(changeValue);
76674
+ });
76448
76675
  }
76449
76676
  }
76450
76677
  else {
@@ -76453,9 +76680,6 @@
76453
76680
  }
76454
76681
  pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
76455
76682
  }
76456
- if (!silentChangeCellValuesEvent) {
76457
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
76458
- }
76459
76683
  const startRange = table.getCellRange(startCol, startRow);
76460
76684
  const range = table.getCellRange(pasteColEnd, pasteRowEnd);
76461
76685
  const aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
@@ -76528,68 +76752,6 @@
76528
76752
  table.scenegraph.updateNextFrame();
76529
76753
  return changedCellResults;
76530
76754
  }
76531
- async function listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
76532
- const resultChangeValues = [];
76533
- const processed = new Set();
76534
- const nextValue = (value ?? '');
76535
- for (let i = 0; i < (ranges?.length ?? 0); i++) {
76536
- const range = ranges[i];
76537
- const startCol = Math.min(range.start.col, range.end.col);
76538
- const endCol = Math.max(range.start.col, range.end.col);
76539
- const startRow = Math.min(range.start.row, range.end.row);
76540
- const endRow = Math.max(range.start.row, range.end.row);
76541
- if (startCol > endCol || startRow > endRow) {
76542
- continue;
76543
- }
76544
- const values = [];
76545
- const oldValues = [];
76546
- for (let row = startRow; row <= endRow; row++) {
76547
- const rowValues = [];
76548
- const rowOldValues = [];
76549
- for (let col = startCol; col <= endCol; col++) {
76550
- rowValues.push(nextValue);
76551
- rowOldValues.push(table.getCellOriginValue(col, row));
76552
- }
76553
- values.push(rowValues);
76554
- oldValues.push(rowOldValues);
76555
- }
76556
- const changedCellResults = await listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, true);
76557
- for (let r = 0; r < values.length; r++) {
76558
- for (let c = 0; c < values[r].length; c++) {
76559
- const col = startCol + c;
76560
- const row = startRow + r;
76561
- const key = `${col},${row}`;
76562
- if (processed.has(key)) {
76563
- continue;
76564
- }
76565
- processed.add(key);
76566
- if (!triggerEvent || !changedCellResults?.[r]?.[c]) {
76567
- continue;
76568
- }
76569
- const oldValue = oldValues[r][c];
76570
- const changedValue = table.getCellOriginValue(col, row);
76571
- if (oldValue === changedValue) {
76572
- continue;
76573
- }
76574
- const recordShowIndex = table.getRecordShowIndexByCell(col, row);
76575
- const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
76576
- const { field } = table.internalProps.layoutMap.getBody(col, row);
76577
- resultChangeValues.push({
76578
- col,
76579
- row,
76580
- recordIndex,
76581
- field,
76582
- rawValue: oldValue,
76583
- currentValue: oldValue,
76584
- changedValue
76585
- });
76586
- }
76587
- }
76588
- }
76589
- if (!silentChangeCellValuesEvent && triggerEvent) {
76590
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
76591
- }
76592
- }
76593
76755
  function getCellUpdateType(col, row, table, oldCellUpdateType) {
76594
76756
  if (oldCellUpdateType === 'group') {
76595
76757
  return oldCellUpdateType;
@@ -78440,182 +78602,17 @@
78440
78602
  }
78441
78603
  return isValid$1(editorDefine);
78442
78604
  }
78443
- changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
78444
- return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
78605
+ changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true) {
78606
+ return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
78445
78607
  }
78446
- changeCellValues(startCol, startRow, values, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
78447
- return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
78608
+ changeCellValues(startCol, startRow, values, workOnEditableCell = false, triggerEvent = true) {
78609
+ return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this);
78448
78610
  }
78449
- changeCellValuesByIds(ranges, value, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
78450
- return listTableChangeCellValuesByIds(ranges, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
78451
- }
78452
- changeSourceCellValue(recordIndex, field, value) {
78453
- const tableIndex = this.getTableIndexByRecordIndex(recordIndex);
78454
- const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
78455
- if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) {
78456
- return;
78457
- }
78458
- this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
78459
- const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row);
78460
- const oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
78461
- const changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
78462
- if (oldValue !== changedValue) {
78463
- const changeValue = {
78464
- col: cellAddr.col,
78465
- row: cellAddr.row,
78466
- recordIndex,
78467
- field,
78468
- rawValue: beforeChangeValue,
78469
- currentValue: oldValue,
78470
- changedValue
78471
- };
78472
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
78473
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
78474
- }
78475
- }
78476
- changeCellValueByRecord(recordIndex, field, value, options) {
78477
- const triggerEvent = options?.triggerEvent ?? true;
78478
- const silentChangeCellValuesEvent = options?.silentChangeCellValuesEvent;
78479
- const autoRefresh = options?.autoRefresh ?? true;
78480
- const records = this.dataSource.dataSourceObj?.records;
78481
- let record;
78482
- let oldValue;
78483
- if (Array.isArray(records) && (typeof field === 'string' || typeof field === 'number')) {
78484
- record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex];
78485
- oldValue = record?.[field];
78486
- }
78487
- this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this);
78488
- if (!triggerEvent) {
78489
- return;
78490
- }
78491
- const changedValue = record && (typeof field === 'string' || typeof field === 'number') ? record?.[field] : value;
78492
- if (oldValue !== changedValue) {
78493
- const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
78494
- const changeValue = {
78495
- col: cellAddr?.col ?? -1,
78496
- row: cellAddr?.row ?? -1,
78497
- recordIndex,
78498
- field,
78499
- rawValue: oldValue,
78500
- currentValue: oldValue,
78501
- changedValue
78502
- };
78503
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
78504
- if (!silentChangeCellValuesEvent) {
78505
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
78506
- }
78507
- }
78508
- if (autoRefresh) {
78509
- this.refreshAfterSourceChange();
78510
- }
78511
- }
78512
- changeCellValueBySource(recordIndex, field, value, triggerEvent = true, silentChangeCellValuesEvent) {
78513
- return this.changeCellValueByRecord(recordIndex, field, value, {
78514
- triggerEvent,
78515
- silentChangeCellValuesEvent,
78516
- autoRefresh: true
78517
- });
78518
- }
78519
- changeCellValuesByRecords(changeValues, options) {
78520
- const triggerEvent = options?.triggerEvent ?? true;
78521
- const silentChangeCellValuesEvent = options?.silentChangeCellValuesEvent;
78522
- const autoRefresh = options?.autoRefresh ?? true;
78523
- const resultChangeValues = [];
78524
- for (let i = 0; i < changeValues.length; i++) {
78525
- const { recordIndex, field, value } = changeValues[i];
78526
- const records = this.dataSource.dataSourceObj?.records;
78527
- let record;
78528
- let oldValue;
78529
- if (Array.isArray(records) && (typeof field === 'string' || typeof field === 'number')) {
78530
- record = Array.isArray(recordIndex) ? getValueFromDeepArray(records, recordIndex) : records[recordIndex];
78531
- oldValue = record?.[field];
78532
- }
78533
- this.dataSource.changeFieldValueByRecordIndex(value, recordIndex, field, this);
78534
- if (triggerEvent) {
78535
- const changedValue = record && (typeof field === 'string' || typeof field === 'number') ? record?.[field] : value;
78536
- if (oldValue !== changedValue) {
78537
- const changeValue = {
78538
- col: (this.getCellAddrByFieldRecord(field, recordIndex)?.col ?? -1),
78539
- row: (this.getCellAddrByFieldRecord(field, recordIndex)?.row ?? -1),
78540
- recordIndex,
78541
- field,
78542
- rawValue: oldValue,
78543
- currentValue: oldValue,
78544
- changedValue
78545
- };
78546
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
78547
- resultChangeValues.push(changeValue);
78548
- }
78549
- }
78550
- }
78551
- if (!silentChangeCellValuesEvent && resultChangeValues.length && triggerEvent) {
78552
- this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
78553
- }
78554
- if (autoRefresh) {
78555
- this.refreshAfterSourceChange();
78556
- }
78557
- }
78558
- changeCellValuesBySource(changeValues, triggerEvent = true, silentChangeCellValuesEvent) {
78559
- return this.changeCellValuesByRecords(changeValues, {
78560
- triggerEvent,
78561
- silentChangeCellValuesEvent,
78562
- autoRefresh: true
78563
- });
78564
- }
78565
- refreshAfterSourceChange(options) {
78566
- const reapplyFilter = options?.reapplyFilter ?? true;
78567
- const reapplySort = options?.reapplySort ?? true;
78568
- const clearRowHeightCache = options?.clearRowHeightCache ?? true;
78569
- this.scenegraph.clearCells();
78570
- if (this.sortState && reapplySort) {
78571
- this.dataSource.clearSortedIndexMap?.();
78572
- this.dataSource.sortedIndexMap?.clear?.();
78573
- }
78574
- if (reapplyFilter) {
78575
- if (this.sortState && reapplySort) {
78576
- this.dataSource.updateFilterRulesForSorted(this.dataSource.dataConfig?.filterRules);
78577
- sortRecords(this);
78578
- }
78579
- else {
78580
- this.dataSource.updateFilterRules(this.dataSource.dataConfig?.filterRules);
78581
- }
78582
- }
78583
- else if (this.sortState && reapplySort) {
78584
- sortRecords(this);
78585
- }
78586
- const traverseColumns = (columns) => {
78587
- for (let i = 0; i < (columns?.length ?? 0); i++) {
78588
- const column = columns[i];
78589
- const aggregators = column?.vtable_aggregator;
78590
- if (aggregators) {
78591
- if (Array.isArray(aggregators)) {
78592
- for (let j = 0; j < aggregators.length; j++) {
78593
- aggregators[j]?.recalculate?.();
78594
- }
78595
- }
78596
- else {
78597
- aggregators?.recalculate?.();
78598
- }
78599
- }
78600
- if (column?.columns) {
78601
- traverseColumns(column.columns);
78602
- }
78603
- }
78604
- };
78605
- traverseColumns(this.internalProps.columns);
78606
- this.refreshRowColCount();
78607
- this.internalProps.layoutMap.clearCellRangeMap();
78608
- this.internalProps.useOneRowHeightFillAll = false;
78609
- this.stateManager.initCheckedState(this.records);
78610
- this.scenegraph.createSceneGraph(!clearRowHeightCache);
78611
- this.internalProps.emptyTip?.resetVisible();
78612
- this.resize();
78613
- }
78614
- addRecord(record, recordIndex, triggerEvent = true) {
78611
+ addRecord(record, recordIndex) {
78615
78612
  const success = listTableAddRecord(record, recordIndex, this);
78616
78613
  adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, [record]);
78617
78614
  this.internalProps.emptyTip?.resetVisible();
78618
- if (triggerEvent && success) {
78615
+ if (success) {
78619
78616
  this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
78620
78617
  records: [record],
78621
78618
  recordIndex,
@@ -78623,13 +78620,13 @@
78623
78620
  });
78624
78621
  }
78625
78622
  }
78626
- addRecords(records, recordIndex, triggerEvent = true) {
78623
+ addRecords(records, recordIndex) {
78627
78624
  const success = listTableAddRecords(records, recordIndex, this);
78628
78625
  if (typeof recordIndex === 'number') {
78629
78626
  adjustHeightResizedRowMapWithAddRecordIndex(this, recordIndex, records);
78630
78627
  }
78631
78628
  this.internalProps.emptyTip?.resetVisible();
78632
- if (triggerEvent && success) {
78629
+ if (success) {
78633
78630
  this.fireListeners(TABLE_EVENT_TYPE.ADD_RECORD, {
78634
78631
  records,
78635
78632
  recordIndex,
@@ -78637,20 +78634,7 @@
78637
78634
  });
78638
78635
  }
78639
78636
  }
78640
- deleteRecords(recordIndexs, triggerEvent = true) {
78641
- const deletedRecords = [];
78642
- if (recordIndexs?.length > 0) {
78643
- recordIndexs.forEach(index => {
78644
- let record = null;
78645
- if (typeof index === 'number') {
78646
- record = this.dataSource.get(index);
78647
- }
78648
- else {
78649
- record = [];
78650
- }
78651
- deletedRecords.push(record);
78652
- });
78653
- }
78637
+ deleteRecords(recordIndexs) {
78654
78638
  listTableDeleteRecords(recordIndexs, this);
78655
78639
  adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs);
78656
78640
  this.internalProps.emptyTip?.resetVisible();
@@ -78658,26 +78642,21 @@
78658
78642
  for (let i = 0; i < recordIndexs.length; i++) {
78659
78643
  rowIndexs.push(this.getBodyRowIndexByRecordIndex(recordIndexs[i]) + this.columnHeaderLevelCount);
78660
78644
  }
78661
- if (triggerEvent) {
78662
- this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
78663
- recordIndexs,
78664
- records: deletedRecords,
78665
- rowIndexs,
78666
- deletedCount: Array.isArray(recordIndexs[0])
78667
- ? recordIndexs.length
78668
- : recordIndexs.length
78669
- });
78670
- }
78645
+ this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
78646
+ recordIndexs,
78647
+ rowIndexs,
78648
+ deletedCount: Array.isArray(recordIndexs[0])
78649
+ ? recordIndexs.length
78650
+ : recordIndexs.length
78651
+ });
78671
78652
  }
78672
- updateRecords(records, recordIndexs, triggerEvent = true) {
78653
+ updateRecords(records, recordIndexs) {
78673
78654
  listTableUpdateRecords(records, recordIndexs, this);
78674
- if (triggerEvent) {
78675
- this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
78676
- records,
78677
- recordIndexs,
78678
- updateCount: records.length
78679
- });
78680
- }
78655
+ this.fireListeners(TABLE_EVENT_TYPE.UPDATE_RECORD, {
78656
+ records,
78657
+ recordIndexs,
78658
+ updateCount: records.length
78659
+ });
78681
78660
  }
78682
78661
  _hasCustomRenderOrLayout() {
78683
78662
  const { headerObjects } = this.internalProps.layoutMap;
@@ -87574,53 +87553,93 @@
87574
87553
  return null;
87575
87554
  }
87576
87555
  _generateChartState() {
87556
+ const select_filter = (datum) => {
87557
+ if (this._table._selectedDataItemsInChart.length >= 1) {
87558
+ const match = this._table._selectedDataItemsInChart.find(item => {
87559
+ for (const itemKey in item) {
87560
+ if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87561
+ return false;
87562
+ }
87563
+ }
87564
+ return true;
87565
+ });
87566
+ return !!match;
87567
+ }
87568
+ else if (this._table._selectedDimensionInChart?.length) {
87569
+ const match = this._table._selectedDimensionInChart.every(item => {
87570
+ if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87571
+ return false;
87572
+ }
87573
+ return true;
87574
+ });
87575
+ return !!match;
87576
+ }
87577
+ return false;
87578
+ };
87579
+ const selected_reverse = (datum) => {
87580
+ if (this._table._selectedDataItemsInChart.length >= 1) {
87581
+ const match = this._table._selectedDataItemsInChart.find(item => {
87582
+ for (const itemKey in item) {
87583
+ if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87584
+ return false;
87585
+ }
87586
+ }
87587
+ return true;
87588
+ });
87589
+ return !match;
87590
+ }
87591
+ else if (this._table._selectedDimensionInChart?.length) {
87592
+ const match = this._table._selectedDimensionInChart.every(item => {
87593
+ if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87594
+ return false;
87595
+ }
87596
+ return true;
87597
+ });
87598
+ return !match;
87599
+ }
87600
+ return false;
87601
+ };
87577
87602
  const state = {
87578
87603
  vtable_selected: {
87579
87604
  filter: (datum) => {
87580
- if (this._table._selectedDataItemsInChart.length >= 1) {
87581
- const match = this._table._selectedDataItemsInChart.find(item => {
87582
- for (const itemKey in item) {
87583
- if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87584
- return false;
87585
- }
87586
- }
87587
- return true;
87588
- });
87589
- return !!match;
87605
+ if (this._table.options.chartDimensionLinkage?.selectedStateFilter) {
87606
+ return this._table.options.chartDimensionLinkage.selectedStateFilter(datum);
87590
87607
  }
87591
- else if (this._table._selectedDimensionInChart?.length) {
87592
- const match = this._table._selectedDimensionInChart.every(item => {
87593
- if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87594
- return false;
87595
- }
87596
- return true;
87597
- });
87598
- return !!match;
87608
+ if (this._table._selectedDataMode === 'click') {
87609
+ return select_filter(datum);
87599
87610
  }
87600
87611
  return false;
87601
87612
  }
87602
87613
  },
87603
87614
  vtable_selected_reverse: {
87604
87615
  filter: (datum) => {
87605
- if (this._table._selectedDataItemsInChart.length >= 1) {
87606
- const match = this._table._selectedDataItemsInChart.find(item => {
87607
- for (const itemKey in item) {
87608
- if (typeof item[itemKey] !== 'object' && item[itemKey] !== datum[itemKey]) {
87609
- return false;
87610
- }
87611
- }
87612
- return true;
87613
- });
87614
- return !match;
87616
+ if (this._table.options.chartDimensionLinkage?.selectedReverseStateFilter) {
87617
+ return this._table.options.chartDimensionLinkage.selectedReverseStateFilter(datum);
87615
87618
  }
87616
- else if (this._table._selectedDimensionInChart?.length) {
87617
- const match = this._table._selectedDimensionInChart.every(item => {
87618
- if (typeof item.value !== 'object' && datum[item.key] !== item.value) {
87619
- return false;
87620
- }
87621
- return true;
87622
- });
87623
- return !match;
87619
+ if (this._table._selectedDataMode === 'click') {
87620
+ return selected_reverse(datum);
87621
+ }
87622
+ return false;
87623
+ }
87624
+ },
87625
+ inBrush: {
87626
+ filter: (datum) => {
87627
+ if (this._table.options.chartDimensionLinkage?.inBrushStateFilter) {
87628
+ return this._table.options.chartDimensionLinkage.inBrushStateFilter(datum);
87629
+ }
87630
+ if (this._table._selectedDataMode === 'brush') {
87631
+ return select_filter(datum);
87632
+ }
87633
+ return false;
87634
+ }
87635
+ },
87636
+ outOfBrush: {
87637
+ filter: (datum) => {
87638
+ if (this._table.options.chartDimensionLinkage?.outOfBrushStateFilter) {
87639
+ return this._table.options.chartDimensionLinkage.outOfBrushStateFilter(datum);
87640
+ }
87641
+ if (this._table._selectedDataMode === 'brush') {
87642
+ return selected_reverse(datum);
87624
87643
  }
87625
87644
  return false;
87626
87645
  }
@@ -91892,6 +91911,7 @@
91892
91911
  pivotSortState;
91893
91912
  dataset;
91894
91913
  _selectedDataItemsInChart = [];
91914
+ _selectedDataMode = 'click';
91895
91915
  _selectedDimensionInChart = [];
91896
91916
  _chartEventMap = {};
91897
91917
  _axes;
@@ -93081,6 +93101,12 @@
93081
93101
  const headerNodes = layoutMap.getCellHeaderPathsWithTreeNode(col, row);
93082
93102
  return headerNodes;
93083
93103
  }
93104
+ disableDimensionHoverToAllChartInstances() {
93105
+ disableDimensionHoverToAllChartInstances();
93106
+ }
93107
+ enableDimensionHoverToAllChartInstances() {
93108
+ enableDimensionHoverToAllChartInstances();
93109
+ }
93084
93110
  }
93085
93111
 
93086
93112
  class Circle extends Circle$1 {
@@ -93642,7 +93668,7 @@
93642
93668
  }
93643
93669
 
93644
93670
  registerForVrender();
93645
- const version = "1.22.11-alpha.5";
93671
+ const version = "1.22.11-alpha.6";
93646
93672
  function getIcons() {
93647
93673
  return get$2();
93648
93674
  }