@visactor/vtable 0.9.3-alpha.7 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/cjs/ListTable.js +6 -5
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotTable.js +2 -2
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/components/axis/axis.d.ts +1 -0
  6. package/cjs/components/axis/axis.js +10 -1
  7. package/cjs/components/axis/axis.js.map +1 -1
  8. package/cjs/components/legend/legend.js +5 -3
  9. package/cjs/components/legend/legend.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +4 -2
  11. package/cjs/core/BaseTable.js +33 -16
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/event/drill.d.ts +2 -0
  14. package/cjs/event/drill.js +15 -2
  15. package/cjs/event/drill.js.map +1 -1
  16. package/cjs/event/event.js +2 -1
  17. package/cjs/event/event.js.map +1 -1
  18. package/cjs/event/pivot-chart/axis-click.js +3 -2
  19. package/cjs/event/pivot-chart/axis-click.js.map +1 -1
  20. package/cjs/index.d.ts +1 -1
  21. package/cjs/index.js +1 -1
  22. package/cjs/index.js.map +1 -1
  23. package/cjs/layout/chart-helper/get-axis-config.js +5 -5
  24. package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
  25. package/cjs/layout/chart-helper/get-chart-spec.js +2 -2
  26. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  27. package/cjs/layout/pivot-layout.js +4 -2
  28. package/cjs/layout/pivot-layout.js.map +1 -1
  29. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  30. package/cjs/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
  31. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +66 -0
  32. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
  33. package/cjs/scenegraph/graphic/contributions/chart-render.js +9 -35
  34. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  35. package/cjs/scenegraph/group-creater/cell-helper.js +2 -1
  36. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
  38. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  39. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  40. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  41. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  42. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  43. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  44. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  45. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  46. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  47. package/cjs/scenegraph/group-creater/column-helper.js +3 -3
  48. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  49. package/cjs/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
  50. package/cjs/scenegraph/group-creater/init-scenegraph.js +61 -0
  51. package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -0
  52. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +7 -2
  53. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  54. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +1 -0
  55. package/cjs/scenegraph/group-creater/progress/proxy.js +9 -5
  56. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +35 -44
  58. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  59. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +3 -17
  60. package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  61. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
  62. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js +37 -0
  63. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
  64. package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  65. package/cjs/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
  66. package/cjs/scenegraph/group-creater/progress/update-position/util.js +70 -0
  67. package/cjs/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
  68. package/cjs/scenegraph/layout/frozen.d.ts +2 -0
  69. package/cjs/scenegraph/layout/frozen.js +139 -6
  70. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  71. package/cjs/scenegraph/layout/update-height.js +2 -1
  72. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  73. package/cjs/scenegraph/layout/update-width.js +39 -64
  74. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  75. package/cjs/scenegraph/refresh-node/update-chart.js +8 -6
  76. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  77. package/cjs/scenegraph/scenegraph.d.ts +9 -4
  78. package/cjs/scenegraph/scenegraph.js +35 -97
  79. package/cjs/scenegraph/scenegraph.js.map +1 -1
  80. package/cjs/scenegraph/style/corner-cell.d.ts +2 -2
  81. package/cjs/scenegraph/style/corner-cell.js +8 -9
  82. package/cjs/scenegraph/style/corner-cell.js.map +1 -1
  83. package/cjs/state/hover/update-position.js +1 -1
  84. package/cjs/state/hover/update-position.js.map +1 -1
  85. package/cjs/ts-types/base-table.d.ts +7 -0
  86. package/cjs/ts-types/base-table.js.map +1 -1
  87. package/cjs/ts-types/table-engine.d.ts +1 -1
  88. package/cjs/ts-types/table-engine.js.map +1 -1
  89. package/dist/vtable.js +1086 -689
  90. package/dist/vtable.min.js +3 -3
  91. package/es/ListTable.js +6 -5
  92. package/es/ListTable.js.map +1 -1
  93. package/es/PivotTable.js +2 -2
  94. package/es/PivotTable.js.map +1 -1
  95. package/es/components/axis/axis.d.ts +1 -0
  96. package/es/components/axis/axis.js +10 -1
  97. package/es/components/axis/axis.js.map +1 -1
  98. package/es/components/legend/legend.js +5 -3
  99. package/es/components/legend/legend.js.map +1 -1
  100. package/es/core/BaseTable.d.ts +4 -2
  101. package/es/core/BaseTable.js +27 -9
  102. package/es/core/BaseTable.js.map +1 -1
  103. package/es/event/drill.d.ts +2 -0
  104. package/es/event/drill.js +13 -0
  105. package/es/event/drill.js.map +1 -1
  106. package/es/event/event.js +3 -3
  107. package/es/event/event.js.map +1 -1
  108. package/es/event/pivot-chart/axis-click.js +3 -2
  109. package/es/event/pivot-chart/axis-click.js.map +1 -1
  110. package/es/index.d.ts +1 -1
  111. package/es/index.js +1 -1
  112. package/es/index.js.map +1 -1
  113. package/es/layout/chart-helper/get-axis-config.js +5 -5
  114. package/es/layout/chart-helper/get-axis-config.js.map +1 -1
  115. package/es/layout/chart-helper/get-chart-spec.js +2 -2
  116. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  117. package/es/layout/pivot-layout.js +4 -2
  118. package/es/layout/pivot-layout.js.map +1 -1
  119. package/es/scenegraph/graphic/chart.js.map +1 -1
  120. package/es/scenegraph/graphic/contributions/chart-render-helper.d.ts +8 -0
  121. package/es/scenegraph/graphic/contributions/chart-render-helper.js +61 -0
  122. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -0
  123. package/es/scenegraph/graphic/contributions/chart-render.js +9 -34
  124. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  125. package/es/scenegraph/group-creater/cell-helper.js +2 -1
  126. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  127. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
  128. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  129. package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
  130. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  131. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
  132. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  133. package/es/scenegraph/group-creater/cell-type/text-cell.js +1 -1
  134. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  135. package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
  136. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  137. package/es/scenegraph/group-creater/column-helper.js +3 -3
  138. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  139. package/es/scenegraph/group-creater/init-scenegraph.d.ts +2 -0
  140. package/es/scenegraph/group-creater/init-scenegraph.js +55 -0
  141. package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -0
  142. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +6 -2
  143. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  144. package/es/scenegraph/group-creater/progress/proxy.d.ts +1 -0
  145. package/es/scenegraph/group-creater/progress/proxy.js +10 -3
  146. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  147. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js +36 -44
  148. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-x.js.map +1 -1
  149. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +2 -17
  150. package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
  151. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.d.ts +2 -0
  152. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js +29 -0
  153. package/es/scenegraph/group-creater/progress/update-position/update-auto-column.js.map +1 -0
  154. package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
  155. package/es/scenegraph/group-creater/progress/update-position/util.d.ts +8 -0
  156. package/es/scenegraph/group-creater/progress/update-position/util.js +60 -0
  157. package/es/scenegraph/group-creater/progress/update-position/util.js.map +1 -0
  158. package/es/scenegraph/layout/frozen.d.ts +2 -0
  159. package/es/scenegraph/layout/frozen.js +137 -3
  160. package/es/scenegraph/layout/frozen.js.map +1 -1
  161. package/es/scenegraph/layout/update-height.js +2 -1
  162. package/es/scenegraph/layout/update-height.js.map +1 -1
  163. package/es/scenegraph/layout/update-width.js +39 -64
  164. package/es/scenegraph/layout/update-width.js.map +1 -1
  165. package/es/scenegraph/refresh-node/update-chart.js +9 -5
  166. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  167. package/es/scenegraph/scenegraph.d.ts +9 -4
  168. package/es/scenegraph/scenegraph.js +35 -100
  169. package/es/scenegraph/scenegraph.js.map +1 -1
  170. package/es/scenegraph/style/corner-cell.d.ts +2 -2
  171. package/es/scenegraph/style/corner-cell.js +4 -7
  172. package/es/scenegraph/style/corner-cell.js.map +1 -1
  173. package/es/state/hover/update-position.js +1 -1
  174. package/es/state/hover/update-position.js.map +1 -1
  175. package/es/ts-types/base-table.d.ts +7 -0
  176. package/es/ts-types/base-table.js.map +1 -1
  177. package/es/ts-types/table-engine.d.ts +1 -1
  178. package/es/ts-types/table-engine.js.map +1 -1
  179. package/package.json +2 -2
package/dist/vtable.js CHANGED
@@ -28300,153 +28300,6 @@
28300
28300
  params[params.W = 1] = "W", params[params.H = 2] = "H", params[params.WH = 3] = "WH";
28301
28301
  }(params || (params = {}));
28302
28302
 
28303
- class Group extends Group$1 {
28304
- role;
28305
- col;
28306
- row;
28307
- mergeCol;
28308
- mergeRow;
28309
- rowNumber;
28310
- colHeight;
28311
- border;
28312
- needUpdate;
28313
- clear() {
28314
- this.removeAllChild();
28315
- }
28316
- getChildByName(name, deep) {
28317
- let result = null;
28318
- this.forEachChildren((child) => {
28319
- if (child.name === name) {
28320
- result = child;
28321
- return true;
28322
- }
28323
- return false;
28324
- });
28325
- if (deep) {
28326
- this.forEachChildren((child) => {
28327
- if (child.getChildByName) {
28328
- const target = child.getChildByName(name, true);
28329
- if (target) {
28330
- result = target;
28331
- return true;
28332
- }
28333
- }
28334
- return false;
28335
- });
28336
- }
28337
- return result;
28338
- }
28339
- get width() {
28340
- let width = this.AABBBounds.width();
28341
- if (width === Infinity || width === -Infinity) {
28342
- width = 0;
28343
- }
28344
- return Math.max(width, this.attribute.width ?? 0);
28345
- }
28346
- get height() {
28347
- let height = this.AABBBounds.height();
28348
- if (height === Infinity || height === -Infinity) {
28349
- height = 0;
28350
- }
28351
- return Math.max(height, this.attribute.height ?? 0);
28352
- }
28353
- setDeltaWidth(deltaX) {
28354
- this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);
28355
- if (this.border) {
28356
- this.border.setAttribute('width', this.border.attribute.width + deltaX);
28357
- }
28358
- }
28359
- setDeltaHeight(deltaY) {
28360
- this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);
28361
- if (this.border) {
28362
- this.border.setAttribute('height', this.border.attribute.height + deltaY);
28363
- }
28364
- }
28365
- setDeltaX(deltaX) {
28366
- this.setAttribute('x', this.attribute.x + deltaX);
28367
- }
28368
- setDeltaY(deltaY) {
28369
- this.setAttribute('y', this.attribute.y + deltaY);
28370
- }
28371
- forEachChildrenSkipChild(cb, skipChildName = 'border-rect', reverse = false) {
28372
- if (reverse) {
28373
- let child = this._lastChild;
28374
- let i = 0;
28375
- while (child) {
28376
- if (child.name !== skipChildName) {
28377
- const breakTag = cb(child, i++);
28378
- if (breakTag) {
28379
- return;
28380
- }
28381
- }
28382
- child = child._prev;
28383
- }
28384
- }
28385
- else {
28386
- let child = this._firstChild;
28387
- let i = 0;
28388
- while (child) {
28389
- if (child.name !== skipChildName) {
28390
- const breakTag = cb(child, i++);
28391
- if (breakTag) {
28392
- return;
28393
- }
28394
- }
28395
- child = child._next;
28396
- }
28397
- }
28398
- }
28399
- getColGroup(col) {
28400
- let c = this._firstChild;
28401
- if (!c) {
28402
- return null;
28403
- }
28404
- for (let i = 0; i < this.childrenCount; i++) {
28405
- if (c.col === col) {
28406
- return c;
28407
- }
28408
- c = c._next;
28409
- }
28410
- return null;
28411
- }
28412
- getRowGroup(row) {
28413
- let c = this._firstChild;
28414
- if (!c) {
28415
- return null;
28416
- }
28417
- for (let i = 0; i < this.childrenCount; i++) {
28418
- if (c.row === row) {
28419
- return c;
28420
- }
28421
- c = c._next;
28422
- }
28423
- return null;
28424
- }
28425
- getChildAt(index) {
28426
- const child = super.getChildAt(index);
28427
- if (child && child.name === 'border-rect') {
28428
- return child._next;
28429
- }
28430
- return child;
28431
- }
28432
- updateColumnRowNumber(row) {
28433
- if (!this.rowNumber) {
28434
- this.rowNumber = row;
28435
- }
28436
- else {
28437
- this.rowNumber = Math.max(this.rowNumber, row);
28438
- }
28439
- }
28440
- updateColumnHeight(cellHeight) {
28441
- if (!this.colHeight) {
28442
- this.colHeight = cellHeight;
28443
- }
28444
- else {
28445
- this.colHeight += cellHeight;
28446
- }
28447
- }
28448
- }
28449
-
28450
28303
  function getCellMergeInfo(table, col, row) {
28451
28304
  if (!table.isHeader(col, row) && table.getBodyColumnDefine(col, row)?.mergeCell !== true) {
28452
28305
  return false;
@@ -36651,6 +36504,19 @@
36651
36504
  attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
36652
36505
  this.component = new LineAxis(merge$2({}, axisStylrAttrs, attrs));
36653
36506
  this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
36507
+ this.component.originAxis = this;
36508
+ }
36509
+ resize(width, height) {
36510
+ this.width = width;
36511
+ this.height = height;
36512
+ this.updateScaleRange();
36513
+ this.computeData();
36514
+ const axisStylrAttrs = getAxisAttributes(this.option);
36515
+ const attrs = this.getUpdateAttribute();
36516
+ attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
36517
+ this.component.setAttributes(merge$2({}, axisStylrAttrs, attrs));
36518
+ this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
36519
+ this.overlap();
36654
36520
  }
36655
36521
  overlap() {
36656
36522
  doOverlap(this.component, this);
@@ -38234,55 +38100,202 @@
38234
38100
  return extend(builtins, icons);
38235
38101
  }
38236
38102
 
38237
- function calcKeepAspectRatioSize(width, height, maxWidth, maxHeight) {
38238
- let newWidth = width;
38239
- let newHeight = height;
38240
- if (newWidth > maxWidth) {
38241
- newWidth = maxWidth;
38242
- newHeight = (newWidth * height) / width;
38103
+ class Group extends Group$1 {
38104
+ role;
38105
+ col;
38106
+ row;
38107
+ mergeCol;
38108
+ mergeRow;
38109
+ rowNumber;
38110
+ colHeight;
38111
+ border;
38112
+ needUpdate;
38113
+ clear() {
38114
+ this.removeAllChild();
38243
38115
  }
38244
- if (newHeight > maxHeight) {
38245
- newHeight = maxHeight;
38246
- newWidth = (newHeight * width) / height;
38116
+ getChildByName(name, deep) {
38117
+ let result = null;
38118
+ this.forEachChildren((child) => {
38119
+ if (child.name === name) {
38120
+ result = child;
38121
+ return true;
38122
+ }
38123
+ return false;
38124
+ });
38125
+ if (deep) {
38126
+ this.forEachChildren((child) => {
38127
+ if (child.getChildByName) {
38128
+ const target = child.getChildByName(name, true);
38129
+ if (target) {
38130
+ result = target;
38131
+ return true;
38132
+ }
38133
+ }
38134
+ return false;
38135
+ });
38136
+ }
38137
+ return result;
38247
38138
  }
38248
- return {
38249
- width: newWidth,
38250
- height: newHeight
38251
- };
38252
- }
38253
-
38254
- function calcStartPosition(left, top, width, height, contentWidth, contentHeight, textAlign = 'left', textBaseline = 'middle', margin = [0, 0, 0, 0], paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0) {
38255
- const right = left + width;
38256
- const bottom = top + height;
38257
- let x = left + margin[3] + paddingLeft;
38258
- if (textAlign === 'right' || textAlign === 'end') {
38259
- x = right - contentWidth - margin[1] - paddingRight;
38139
+ get width() {
38140
+ let width = this.AABBBounds.width();
38141
+ if (width === Infinity || width === -Infinity) {
38142
+ width = 0;
38143
+ }
38144
+ return Math.max(width, this.attribute.width ?? 0);
38260
38145
  }
38261
- else if (textAlign === 'center') {
38262
- x = left + (width - contentWidth + paddingLeft - paddingRight) / 2;
38146
+ get height() {
38147
+ let height = this.AABBBounds.height();
38148
+ if (height === Infinity || height === -Infinity) {
38149
+ height = 0;
38150
+ }
38151
+ return Math.max(height, this.attribute.height ?? 0);
38263
38152
  }
38264
- let y = top + margin[0] + paddingTop;
38265
- if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {
38266
- y = bottom - contentHeight - margin[2] - paddingBottom;
38153
+ setDeltaWidth(deltaX) {
38154
+ this.setAttribute('width', (this.attribute.width ?? 0) + deltaX);
38155
+ if (this.border) {
38156
+ this.border.setAttribute('width', this.border.attribute.width + deltaX);
38157
+ }
38267
38158
  }
38268
- else if (textBaseline === 'middle') {
38269
- y = top + (height - contentHeight + paddingTop - paddingBottom) / 2;
38159
+ setDeltaHeight(deltaY) {
38160
+ this.setAttribute('height', (this.attribute.height ?? 0) + deltaY);
38161
+ if (this.border) {
38162
+ this.border.setAttribute('height', this.border.attribute.height + deltaY);
38163
+ }
38270
38164
  }
38271
- return { x, y };
38272
- }
38273
-
38274
- function getProp(name, cellStyle, col, row, _table) {
38275
- const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
38276
- if (typeof prop === 'function') {
38277
- const arg = {
38278
- col,
38279
- row,
38280
- table: _table,
38281
- value: _table.getCellValue(col, row),
38282
- dataValue: _table.getCellOriginValue(col, row),
38283
- cellHeaderPaths: _table.getCellHeaderPaths(col, row)
38284
- };
38285
- return prop(arg);
38165
+ setDeltaX(deltaX) {
38166
+ this.setAttribute('x', this.attribute.x + deltaX);
38167
+ }
38168
+ setDeltaY(deltaY) {
38169
+ this.setAttribute('y', this.attribute.y + deltaY);
38170
+ }
38171
+ forEachChildrenSkipChild(cb, skipChildName = 'border-rect', reverse = false) {
38172
+ if (reverse) {
38173
+ let child = this._lastChild;
38174
+ let i = 0;
38175
+ while (child) {
38176
+ if (child.name !== skipChildName) {
38177
+ const breakTag = cb(child, i++);
38178
+ if (breakTag) {
38179
+ return;
38180
+ }
38181
+ }
38182
+ child = child._prev;
38183
+ }
38184
+ }
38185
+ else {
38186
+ let child = this._firstChild;
38187
+ let i = 0;
38188
+ while (child) {
38189
+ if (child.name !== skipChildName) {
38190
+ const breakTag = cb(child, i++);
38191
+ if (breakTag) {
38192
+ return;
38193
+ }
38194
+ }
38195
+ child = child._next;
38196
+ }
38197
+ }
38198
+ }
38199
+ getColGroup(col) {
38200
+ let c = this._firstChild;
38201
+ if (!c) {
38202
+ return null;
38203
+ }
38204
+ for (let i = 0; i < this.childrenCount; i++) {
38205
+ if (c.col === col) {
38206
+ return c;
38207
+ }
38208
+ c = c._next;
38209
+ }
38210
+ return null;
38211
+ }
38212
+ getRowGroup(row) {
38213
+ let c = this._firstChild;
38214
+ if (!c) {
38215
+ return null;
38216
+ }
38217
+ for (let i = 0; i < this.childrenCount; i++) {
38218
+ if (c.row === row) {
38219
+ return c;
38220
+ }
38221
+ c = c._next;
38222
+ }
38223
+ return null;
38224
+ }
38225
+ getChildAt(index) {
38226
+ const child = super.getChildAt(index);
38227
+ if (child && child.name === 'border-rect') {
38228
+ return child._next;
38229
+ }
38230
+ return child;
38231
+ }
38232
+ updateColumnRowNumber(row) {
38233
+ if (!this.rowNumber) {
38234
+ this.rowNumber = row;
38235
+ }
38236
+ else {
38237
+ this.rowNumber = Math.max(this.rowNumber, row);
38238
+ }
38239
+ }
38240
+ updateColumnHeight(cellHeight) {
38241
+ if (!this.colHeight) {
38242
+ this.colHeight = cellHeight;
38243
+ }
38244
+ else {
38245
+ this.colHeight += cellHeight;
38246
+ }
38247
+ }
38248
+ }
38249
+
38250
+ function calcKeepAspectRatioSize(width, height, maxWidth, maxHeight) {
38251
+ let newWidth = width;
38252
+ let newHeight = height;
38253
+ if (newWidth > maxWidth) {
38254
+ newWidth = maxWidth;
38255
+ newHeight = (newWidth * height) / width;
38256
+ }
38257
+ if (newHeight > maxHeight) {
38258
+ newHeight = maxHeight;
38259
+ newWidth = (newHeight * width) / height;
38260
+ }
38261
+ return {
38262
+ width: newWidth,
38263
+ height: newHeight
38264
+ };
38265
+ }
38266
+
38267
+ function calcStartPosition(left, top, width, height, contentWidth, contentHeight, textAlign = 'left', textBaseline = 'middle', margin = [0, 0, 0, 0], paddingLeft = 0, paddingRight = 0, paddingTop = 0, paddingBottom = 0) {
38268
+ const right = left + width;
38269
+ const bottom = top + height;
38270
+ let x = left + margin[3] + paddingLeft;
38271
+ if (textAlign === 'right' || textAlign === 'end') {
38272
+ x = right - contentWidth - margin[1] - paddingRight;
38273
+ }
38274
+ else if (textAlign === 'center') {
38275
+ x = left + (width - contentWidth + paddingLeft - paddingRight) / 2;
38276
+ }
38277
+ let y = top + margin[0] + paddingTop;
38278
+ if (textBaseline === 'bottom' || textBaseline === 'alphabetic' || textBaseline === 'ideographic') {
38279
+ y = bottom - contentHeight - margin[2] - paddingBottom;
38280
+ }
38281
+ else if (textBaseline === 'middle') {
38282
+ y = top + (height - contentHeight + paddingTop - paddingBottom) / 2;
38283
+ }
38284
+ return { x, y };
38285
+ }
38286
+
38287
+ function getProp(name, cellStyle, col, row, _table) {
38288
+ const prop = cellStyle && isValid$1(cellStyle[name]) ? cellStyle[name] : null;
38289
+ if (typeof prop === 'function') {
38290
+ const arg = {
38291
+ col,
38292
+ row,
38293
+ table: _table,
38294
+ value: _table.getCellValue(col, row),
38295
+ dataValue: _table.getCellOriginValue(col, row),
38296
+ cellHeaderPaths: _table.getCellHeaderPaths(col, row)
38297
+ };
38298
+ return prop(arg);
38286
38299
  }
38287
38300
  return prop;
38288
38301
  }
@@ -38332,7 +38345,7 @@
38332
38345
  cellGroup.role = 'cell';
38333
38346
  cellGroup.col = col;
38334
38347
  cellGroup.row = row;
38335
- columnGroup.addChild(cellGroup);
38348
+ columnGroup?.addChild(cellGroup);
38336
38349
  const value = table.getCellValue(col, row);
38337
38350
  const image = createImage({
38338
38351
  x: padding[3],
@@ -38903,7 +38916,7 @@
38903
38916
  cellGroup.role = 'cell';
38904
38917
  cellGroup.col = col;
38905
38918
  cellGroup.row = row;
38906
- columnGroup.addChild(cellGroup);
38919
+ columnGroup?.addChild(cellGroup);
38907
38920
  }
38908
38921
  const chartGroup = createSparkLine(col, row, width, height, padding, table);
38909
38922
  if (chartGroup) {
@@ -40420,6 +40433,9 @@
40420
40433
  else if (type === 'image' || type === 'video') {
40421
40434
  updateImageCellContentWhileResize(cell, col, row, scene.table);
40422
40435
  }
40436
+ else if (cell.firstChild?.name === 'axis') {
40437
+ cell.firstChild?.originAxis.resize(cell.attribute.width, cell.attribute.height);
40438
+ }
40423
40439
  else {
40424
40440
  const style = scene.table._getCellStyle(col, row);
40425
40441
  updateCellContentHeight(cell, distHeight, detaY, scene.table.heightMode === 'autoHeight', getQuadProps(style.padding), style.textAlign, style.textBaseline);
@@ -40453,111 +40469,21 @@
40453
40469
 
40454
40470
  function updateColWidth(scene, col, detaX) {
40455
40471
  const autoRowHeight = scene.table.heightMode === 'autoHeight';
40456
- let needRerangeRow = false;
40457
40472
  const colOrCornerHeaderColumn = scene.getColGroup(col, true);
40458
- const oldColOrCornerHeaderColumnWidth = colOrCornerHeaderColumn?.attribute.width;
40459
- colOrCornerHeaderColumn?.setAttribute('width', oldColOrCornerHeaderColumnWidth + detaX);
40460
- colOrCornerHeaderColumn?.forEachChildren((cell, index) => {
40461
- const isHeightChange = updateCellWidth(scene, cell, col, cell.row, oldColOrCornerHeaderColumnWidth, detaX, index < scene.table.columnHeaderLevelCount, autoRowHeight);
40462
- if (isHeightChange) {
40463
- const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40464
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40465
- for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40466
- resetRowHeight(scene, row);
40467
- }
40468
- }
40469
- else {
40470
- resetRowHeight(scene, cell.row);
40471
- }
40472
- needRerangeRow = true;
40473
- }
40474
- });
40475
- if (needRerangeRow) {
40476
- let newTotalHeight = 0;
40477
- for (let col = 0; col < scene.table.colCount; col++) {
40478
- const colGroup = scene.getColGroup(col, true);
40479
- let y = 0;
40480
- colGroup.forEachChildren((cellGroup) => {
40481
- if (cellGroup.role !== 'cell') {
40482
- return;
40483
- }
40484
- cellGroup.setAttribute('y', y);
40485
- y += cellGroup.attribute.height;
40486
- });
40487
- newTotalHeight = y;
40488
- }
40489
- scene.updateContainerHeight(0, newTotalHeight - scene.colHeaderGroup.attribute.height);
40473
+ if (colOrCornerHeaderColumn) {
40474
+ updateColunmWidth(colOrCornerHeaderColumn, detaX, autoRowHeight, 'col-corner', scene);
40490
40475
  }
40491
- needRerangeRow = false;
40492
40476
  const rowHeaderOrBodyColumn = scene.getColGroup(col);
40493
- const oldRowHeaderOrBodyColumn = rowHeaderOrBodyColumn.attribute.width;
40494
- rowHeaderOrBodyColumn?.setAttribute('width', oldRowHeaderOrBodyColumn + detaX);
40495
- rowHeaderOrBodyColumn?.forEachChildren((cell, index) => {
40496
- const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldRowHeaderOrBodyColumn, detaX, col < scene.table.rowHeaderLevelCount, autoRowHeight);
40497
- if (isHeightChange) {
40498
- const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40499
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40500
- for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40501
- resetRowHeight(scene, row);
40502
- }
40503
- }
40504
- else {
40505
- resetRowHeight(scene, cell.row);
40506
- }
40507
- needRerangeRow = true;
40508
- }
40509
- });
40510
- if (needRerangeRow) {
40511
- let newTotalHeight = 0;
40512
- for (let col = 0; col < scene.table.colCount; col++) {
40513
- const colGroup = scene.getColGroup(col, false);
40514
- let y = 0;
40515
- colGroup.forEachChildren((cellGroup) => {
40516
- if (cellGroup.role !== 'cell') {
40517
- return;
40518
- }
40519
- cellGroup.setAttribute('y', y);
40520
- y += cellGroup.attribute.height;
40521
- });
40522
- newTotalHeight = y;
40523
- }
40524
- scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
40477
+ if (rowHeaderOrBodyColumn) {
40478
+ updateColunmWidth(rowHeaderOrBodyColumn, detaX, autoRowHeight, 'row-body', scene);
40479
+ }
40480
+ const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);
40481
+ if (leftBottomColumn) {
40482
+ updateColunmWidth(leftBottomColumn, detaX, autoRowHeight, 'left-bottom', scene);
40525
40483
  }
40526
40484
  const bottomColumn = scene.getColGroupInBottom(col);
40527
40485
  if (bottomColumn) {
40528
- const oldBottomColumnWidth = bottomColumn.attribute.width;
40529
- bottomColumn?.setAttribute('width', oldBottomColumnWidth + detaX);
40530
- bottomColumn?.forEachChildren((cell, index) => {
40531
- const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldBottomColumnWidth, detaX, col < scene.table.rowHeaderLevelCount, autoRowHeight);
40532
- if (isHeightChange) {
40533
- const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40534
- if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40535
- for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40536
- resetRowHeight(scene, row);
40537
- }
40538
- }
40539
- else {
40540
- resetRowHeight(scene, cell.row);
40541
- }
40542
- needRerangeRow = true;
40543
- }
40544
- });
40545
- if (needRerangeRow) {
40546
- let newTotalHeight = 0;
40547
- for (let col = 0; col < scene.table.colCount; col++) {
40548
- const colGroup = scene.getColGroup(col, false);
40549
- let y = 0;
40550
- colGroup.forEachChildren((cellGroup) => {
40551
- if (cellGroup.role !== 'cell') {
40552
- return;
40553
- }
40554
- cellGroup.setAttribute('y', y);
40555
- y += cellGroup.attribute.height;
40556
- });
40557
- newTotalHeight = y;
40558
- }
40559
- scene.updateContainerHeight(scene.table.frozenRowCount, newTotalHeight - scene.bodyGroup.attribute.height);
40560
- }
40486
+ updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);
40561
40487
  }
40562
40488
  if (col < scene.frozenColCount) {
40563
40489
  scene.cornerHeaderGroup.forEachChildrenSkipChild((column, index) => {
@@ -40582,15 +40508,81 @@
40582
40508
  column.setAttribute('x', column.attribute.x + detaX);
40583
40509
  }
40584
40510
  });
40585
- if (bottomColumn) {
40586
- scene.bottomFrozenGroup.forEachChildrenSkipChild((column, index) => {
40587
- if (column.col > col) {
40588
- column.setAttribute('x', column.attribute.x + detaX);
40511
+ }
40512
+ if (leftBottomColumn) {
40513
+ scene.leftBottomCornerGroup.forEachChildrenSkipChild((column, index) => {
40514
+ if (column.col > col) {
40515
+ column.setAttribute('x', column.attribute.x + detaX);
40516
+ }
40517
+ });
40518
+ }
40519
+ if (bottomColumn) {
40520
+ scene.bottomFrozenGroup.forEachChildrenSkipChild((column, index) => {
40521
+ if (column.col > col) {
40522
+ column.setAttribute('x', column.attribute.x + detaX);
40523
+ }
40524
+ });
40525
+ }
40526
+ scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);
40527
+ }
40528
+ function updateColunmWidth(columnGroup, detaX, autoRowHeight, mode, scene) {
40529
+ let needRerangeRow = false;
40530
+ const oldColumnWidth = columnGroup?.attribute.width ?? 0;
40531
+ columnGroup?.setAttribute('width', oldColumnWidth + detaX);
40532
+ columnGroup?.forEachChildren((cell, index) => {
40533
+ const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, detaX, mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true, autoRowHeight);
40534
+ if (isHeightChange) {
40535
+ const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
40536
+ if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
40537
+ for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
40538
+ resetRowHeight(scene, row);
40539
+ }
40540
+ }
40541
+ else {
40542
+ resetRowHeight(scene, cell.row);
40543
+ }
40544
+ needRerangeRow = true;
40545
+ }
40546
+ });
40547
+ if (needRerangeRow) {
40548
+ let newTotalHeight = 0;
40549
+ let colGroup;
40550
+ let oldContainerHeight;
40551
+ let row;
40552
+ for (let col = 0; col < scene.table.colCount; col++) {
40553
+ if (mode === 'col-corner') {
40554
+ row = 0;
40555
+ colGroup = scene.getColGroup(col, true);
40556
+ oldContainerHeight = scene.colHeaderGroup.attribute.height ?? 0;
40557
+ }
40558
+ else if (mode === 'row-body') {
40559
+ row = scene.table.frozenRowCount;
40560
+ colGroup = scene.getColGroup(col, false);
40561
+ oldContainerHeight = scene.bodyGroup.attribute.height ?? 0;
40562
+ }
40563
+ else if (mode === 'bottom') {
40564
+ row = scene.table.rowCount - scene.table.bottomFrozenRowCount;
40565
+ colGroup = scene.getColGroupInBottom(col);
40566
+ oldContainerHeight = scene.bottomFrozenGroup.attribute.height ?? 0;
40567
+ }
40568
+ else if (mode === 'left-bottom') {
40569
+ row = scene.table.rowCount - scene.table.bottomFrozenRowCount;
40570
+ colGroup = scene.getColGroupInLeftBottomCorner(col);
40571
+ oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;
40572
+ }
40573
+ let y = 0;
40574
+ colGroup.forEachChildren((cellGroup) => {
40575
+ if (cellGroup.role !== 'cell') {
40576
+ cellGroup.setAttribute('y', y);
40577
+ return;
40589
40578
  }
40579
+ cellGroup.setAttribute('y', y);
40580
+ y += cellGroup.attribute.height ?? 0;
40590
40581
  });
40582
+ newTotalHeight = y;
40591
40583
  }
40584
+ scene.updateContainerHeight(row, newTotalHeight - oldContainerHeight);
40592
40585
  }
40593
- scene.table.setColWidth(col, rowHeaderOrBodyColumn.attribute.width, true);
40594
40586
  }
40595
40587
  function updateCellWidth(scene, cell, col, row, width, detaX, isHeader, autoRowHeight) {
40596
40588
  let cellGroup;
@@ -40655,6 +40647,9 @@
40655
40647
  axis.overlap();
40656
40648
  }
40657
40649
  }
40650
+ else if (cell.firstChild?.name === 'axis') {
40651
+ cell.firstChild?.originAxis.resize(cell.attribute.width, cell.attribute.height);
40652
+ }
40658
40653
  else {
40659
40654
  const style = scene.table._getCellStyle(col, row);
40660
40655
  isHeightChange = updateCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline, scene);
@@ -41801,18 +41796,101 @@
41801
41796
  }
41802
41797
  }
41803
41798
 
41804
- const ChartRender = Symbol.for('ChartRender');
41805
- let DefaultCanvasChartRender = class DefaultCanvasChartRender {
41806
- type;
41807
- numberType = CHART_NUMBER_TYPE;
41808
- drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
41809
- const groupAttribute = getTheme(chart, params?.theme).group;
41810
- const { dataId, data } = chart.attribute;
41811
- const viewBox = chart.getViewBox();
41812
- const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
41813
- const { chartInstance, active, cacheCanvas, activeChartInstance } = chart;
41814
- if (!active && cacheCanvas) {
41815
- context.drawImage(cacheCanvas, x, y, width, height);
41799
+ const chartRenderKeys = [];
41800
+ const chartRenderQueueList = [];
41801
+ let batchRenderChartCount = 5;
41802
+ let isHandlingChartQueue = false;
41803
+ function setBatchRenderChartCount(count) {
41804
+ if (isValid$1(count)) {
41805
+ batchRenderChartCount = count;
41806
+ }
41807
+ }
41808
+ function IsHandlingChartQueue() {
41809
+ return isHandlingChartQueue;
41810
+ }
41811
+ function renderChart(chart) {
41812
+ const { axes, dataId, data } = chart.attribute;
41813
+ const { chartInstance } = chart;
41814
+ const viewBox = chart.getViewBox();
41815
+ axes.forEach((axis, index) => {
41816
+ if (axis.type === 'linear') {
41817
+ const chartAxis = chartInstance._chart._components[index];
41818
+ chartAxis._domain = {
41819
+ min: axis.range?.min ?? 0,
41820
+ max: axis.range?.max ?? 0
41821
+ };
41822
+ }
41823
+ else if (axis.type === 'band') {
41824
+ const chartAxis = chartInstance._chart._components[index];
41825
+ chartAxis._spec.domain = axis.domain.slice(0);
41826
+ chartAxis.updateScaleDomain();
41827
+ }
41828
+ });
41829
+ chartInstance.updateViewBox({
41830
+ x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
41831
+ x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
41832
+ y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
41833
+ y2: viewBox.y2 - chart.getRootNode().table.scrollTop
41834
+ }, false, false);
41835
+ if (typeof dataId === 'string') {
41836
+ chartInstance.updateDataSync(dataId, data ?? []);
41837
+ }
41838
+ else {
41839
+ const dataBatch = [];
41840
+ for (const dataIdStr in dataId) {
41841
+ const dataIdAndField = dataId[dataIdStr];
41842
+ dataBatch.push({
41843
+ id: dataIdStr,
41844
+ data: dataIdAndField
41845
+ ? data?.filter((item) => {
41846
+ return item.hasOwnProperty(dataIdAndField);
41847
+ }) ?? []
41848
+ : data ?? []
41849
+ });
41850
+ if (!chartInstance.updateDataInBatchesSync) {
41851
+ chartInstance.updateDataSync(dataIdStr, dataIdAndField
41852
+ ? data?.filter((item) => {
41853
+ return item.hasOwnProperty(dataIdAndField);
41854
+ }) ?? []
41855
+ : data ?? []);
41856
+ }
41857
+ }
41858
+ chartInstance.updateDataInBatchesSync?.(dataBatch);
41859
+ }
41860
+ const sg = chartInstance.getStage();
41861
+ chart.cacheCanvas = sg.toCanvas();
41862
+ }
41863
+ function startRenderChartQueue(table) {
41864
+ isHandlingChartQueue = true;
41865
+ if (chartRenderQueueList.length > 0) {
41866
+ requestAnimationFrame(() => {
41867
+ const chartsToRender = chartRenderQueueList.splice(0, batchRenderChartCount);
41868
+ chartRenderKeys.splice(0, batchRenderChartCount);
41869
+ chartsToRender.forEach(chart => {
41870
+ renderChart(chart);
41871
+ chart.addUpdateBoundTag();
41872
+ });
41873
+ table.render();
41874
+ startRenderChartQueue(table);
41875
+ });
41876
+ }
41877
+ else {
41878
+ isHandlingChartQueue = false;
41879
+ }
41880
+ }
41881
+
41882
+ const ChartRender = Symbol.for('ChartRender');
41883
+ let DefaultCanvasChartRender = class DefaultCanvasChartRender {
41884
+ type;
41885
+ numberType = CHART_NUMBER_TYPE;
41886
+ drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
41887
+ const groupAttribute = getTheme(chart, params?.theme).group;
41888
+ const { dataId, data } = chart.attribute;
41889
+ chart.getViewBox();
41890
+ const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
41891
+ const { chartInstance, active, cacheCanvas, activeChartInstance } = chart;
41892
+ if (!active && cacheCanvas) {
41893
+ context.drawImage(cacheCanvas, x, y, width, height);
41816
41894
  }
41817
41895
  else if (activeChartInstance) {
41818
41896
  if (typeof dataId === 'string') {
@@ -41830,42 +41908,18 @@
41830
41908
  }
41831
41909
  }
41832
41910
  else {
41833
- const { axes } = chart.attribute;
41834
- axes.forEach((axis, index) => {
41835
- if (axis.type === 'linear') {
41836
- const chartAxis = chartInstance._chart._components[index];
41837
- chartAxis._domain = {
41838
- min: axis.range?.min ?? 0,
41839
- max: axis.range?.max ?? 0
41840
- };
41911
+ if (chart.getRootNode().table.internalProps.renderChartAsync) {
41912
+ if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {
41913
+ chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);
41914
+ chartRenderQueueList.push(chart);
41841
41915
  }
41842
- else if (axis.type === 'band') {
41843
- const chartAxis = chartInstance._chart._components[index];
41844
- chartAxis._spec.domain = axis.domain.slice(0);
41845
- chartAxis.updateScaleDomain();
41916
+ if (!IsHandlingChartQueue()) {
41917
+ startRenderChartQueue(chart.getRootNode().table);
41846
41918
  }
41847
- });
41848
- chartInstance.updateViewBox({
41849
- x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
41850
- x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
41851
- y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
41852
- y2: viewBox.y2 - chart.getRootNode().table.scrollTop
41853
- }, false);
41854
- if (typeof dataId === 'string') {
41855
- chartInstance.updateDataSync(dataId, data ?? []);
41856
41919
  }
41857
41920
  else {
41858
- for (const dataIdStr in dataId) {
41859
- const dataIdAndField = dataId[dataIdStr];
41860
- chartInstance.updateDataSync(dataIdStr, dataIdAndField
41861
- ? data?.filter((item) => {
41862
- return item.hasOwnProperty(dataIdAndField);
41863
- }) ?? []
41864
- : data ?? []);
41865
- }
41921
+ renderChart(chart);
41866
41922
  }
41867
- const sg = chartInstance.getStage();
41868
- chart.cacheCanvas = sg.toCanvas();
41869
41923
  }
41870
41924
  }
41871
41925
  draw(chart, renderService, drawContext, params) {
@@ -41888,26 +41942,7 @@
41888
41942
  else {
41889
41943
  this.drawShape(chart, context, 0, 0, drawContext);
41890
41944
  }
41891
- const chartAttribute = getTheme(chart, params?.theme).group;
41892
- const { scrollX = chartAttribute.scrollX, scrollY = chartAttribute.scrollY } = chart.attribute;
41893
- if (scrollX || scrollY) {
41894
- context.translate(scrollX, scrollY);
41895
- }
41896
- let p;
41897
- if (params && params.drawingCb) {
41898
- p = params.drawingCb();
41899
- }
41900
- if (p && p.then) {
41901
- p.then(() => {
41902
- if (clip) {
41903
- context.restore();
41904
- }
41905
- else {
41906
- context.highPerformanceRestore();
41907
- }
41908
- });
41909
- }
41910
- else if (clip) {
41945
+ if (clip) {
41911
41946
  context.restore();
41912
41947
  }
41913
41948
  else {
@@ -42567,10 +42602,10 @@
42567
42602
  if (isArray$3(rowDimensionKey)) {
42568
42603
  rowDimensionKey = rowDimensionKey[0];
42569
42604
  }
42570
- const data = layout.dataset.collectedValues[rowDimensionKey];
42605
+ const data = layout.dataset.collectedValues[rowDimensionKey] ?? [];
42571
42606
  const recordRow = layout.getRecordIndexByRow(row);
42572
42607
  const rowPath = layout.getRowKeysPath()[recordRow];
42573
- const domain = data[rowPath[rowPath.length - 1]];
42608
+ const domain = data[rowPath[rowPath.length - 1]] ?? [];
42574
42609
  const axisOption = getAxisOption(col, row, 'left', layout);
42575
42610
  if (axisOption?.visible === false) {
42576
42611
  return;
@@ -42668,7 +42703,7 @@
42668
42703
  if (isArray$3(columnDimensionKey)) {
42669
42704
  columnDimensionKey = columnDimensionKey[0];
42670
42705
  }
42671
- const data = layout.dataset.collectedValues[columnDimensionKey];
42706
+ const data = layout.dataset.collectedValues[columnDimensionKey] ?? [];
42672
42707
  const recordCol = layout.getRecordIndexByCol(col);
42673
42708
  const colPath = layout.getColKeysPath()[recordCol];
42674
42709
  const domain = data?.[colPath[colPath.length - 1]] ?? [];
@@ -43491,7 +43526,7 @@
43491
43526
  cellGroup.role = 'cell';
43492
43527
  cellGroup.col = col;
43493
43528
  cellGroup.row = row;
43494
- columnGroup.addChild(cellGroup);
43529
+ columnGroup?.addChild(cellGroup);
43495
43530
  }
43496
43531
  cellGroup.AABBBounds.width();
43497
43532
  const chartGroup = new Chart({
@@ -43547,7 +43582,7 @@
43547
43582
  cellGroup.role = 'cell';
43548
43583
  cellGroup.col = col;
43549
43584
  cellGroup.row = row;
43550
- columnGroup.addChild(cellGroup);
43585
+ columnGroup?.addChild(cellGroup);
43551
43586
  if (customElementsGroup) {
43552
43587
  cellGroup.appendChild(customElementsGroup);
43553
43588
  }
@@ -43611,7 +43646,7 @@
43611
43646
  cellGroup.role = 'cell';
43612
43647
  cellGroup.col = col;
43613
43648
  cellGroup.row = row;
43614
- columnGroup.addChild(cellGroup);
43649
+ columnGroup?.addChild(cellGroup);
43615
43650
  const value = table.getCellValue(col, row);
43616
43651
  const video = document.createElement('video');
43617
43652
  video.addEventListener('loadeddata', () => {
@@ -43824,6 +43859,7 @@
43824
43859
  if (!addNew) {
43825
43860
  oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
43826
43861
  oldCellGroup.parent.removeChild(oldCellGroup);
43862
+ updateCell$1(range.start.col, range.start.row, table, false);
43827
43863
  }
43828
43864
  }
43829
43865
  else {
@@ -43964,7 +44000,7 @@
43964
44000
  cellGroup.row = row;
43965
44001
  cellGroup.mergeCol = range.start.col;
43966
44002
  cellGroup.mergeRow = range.start.row;
43967
- columnGroup.addChild(cellGroup);
44003
+ columnGroup?.addChild(cellGroup);
43968
44004
  columnGroup.updateColumnRowNumber(row);
43969
44005
  columnGroup.updateColumnHeight(height);
43970
44006
  range = table.getCellRange(col, row);
@@ -44033,6 +44069,7 @@
44033
44069
  }
44034
44070
 
44035
44071
  async function createGroupForFirstScreen(cornerHeaderGroup, colHeaderGroup, rowHeaderGroup, rightFrozenGroup, bottomFrozenGroup, bodyGroup, xOrigin, yOrigin, proxy) {
44072
+ const { leftBottomCornerGroup, rightTopCornerGroup, rightBottomCornerGroup } = proxy.table.scenegraph;
44036
44073
  proxy.setParamsForRow();
44037
44074
  proxy.setParamsForColumn();
44038
44075
  proxy.table.internalProps._colWidthsMap.clear();
@@ -44059,11 +44096,20 @@
44059
44096
  createColGroup(colHeaderGroup, xOrigin, yOrigin, proxy.table.rowHeaderLevelCount, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), 0, proxy.table.columnHeaderLevelCount - 1, 'columnHeader', proxy.table);
44060
44097
  createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, proxy.table.rowHeaderLevelCount - 1, proxy.table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), 'rowHeader', proxy.table);
44061
44098
  if (proxy.table.bottomFrozenRowCount > 0) {
44099
+ if (!proxy.table.isPivotChart()) {
44100
+ createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, proxy.table.rowHeaderLevelCount - 1, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, proxy.table.rowCount - 1, 'rowHeader', proxy.table);
44101
+ }
44062
44102
  createColGroup(bottomFrozenGroup, xOrigin, yOrigin, proxy.table.rowHeaderLevelCount, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, proxy.table.rowCount - 1, 'body', proxy.table);
44063
44103
  }
44064
44104
  if (proxy.table.rightFrozenColCount > 0) {
44105
+ if (!proxy.table.isPivotChart()) {
44106
+ createColGroup(rightTopCornerGroup, xOrigin, yOrigin, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, proxy.table.colCount - 1, 0, proxy.table.columnHeaderLevelCount - 1, 'columnHeader', proxy.table);
44107
+ }
44065
44108
  createColGroup(rightFrozenGroup, xOrigin, yOrigin, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, proxy.table.colCount - 1, proxy.table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), 'body', proxy.table);
44066
44109
  }
44110
+ if (proxy.table.bottomFrozenRowCount > 0 && proxy.table.rightFrozenColCount > 0 && !proxy.table.isPivotChart()) {
44111
+ createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount + 1, proxy.table.colCount - 1, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount + 1, proxy.table.rowCount - 1, 'body', proxy.table);
44112
+ }
44067
44113
  createColGroup(bodyGroup, xOrigin, yOrigin, proxy.table.rowHeaderLevelCount, Math.min(proxy.firstScreenColLimit, proxy.table.colCount - 1 - proxy.table.rightFrozenColCount), proxy.table.columnHeaderLevelCount, Math.min(proxy.firstScreenRowLimit, proxy.table.rowCount - 1 - proxy.table.bottomFrozenRowCount), 'body', proxy.table);
44068
44114
  if (!bodyGroup.firstChild) {
44069
44115
  proxy.currentRow = proxy.totalRow;
@@ -44088,34 +44134,171 @@
44088
44134
  }
44089
44135
  }
44090
44136
 
44137
+ function checkFirstRowMerge(row, proxy) {
44138
+ for (let col = 0; col < proxy.table.colCount; col++) {
44139
+ if ((col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||
44140
+ (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)) {
44141
+ continue;
44142
+ }
44143
+ const range = getCellMergeInfo(proxy.table, col, row);
44144
+ if (range && range.start.row !== row) {
44145
+ const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44146
+ const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44147
+ newCellGroup.col = col;
44148
+ newCellGroup.row = row;
44149
+ newCellGroup.setAttribute('y', proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1));
44150
+ oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44151
+ oldCellGroup.parent.removeChild(oldCellGroup);
44152
+ oldCellGroup.needUpdate = false;
44153
+ newCellGroup.needUpdate = false;
44154
+ if (proxy.cellCache.get(col)) {
44155
+ proxy.cellCache.set(col, newCellGroup);
44156
+ }
44157
+ }
44158
+ }
44159
+ }
44160
+ function checkFirstColMerge(col, scrolling, proxy) {
44161
+ for (let row = 0; row < proxy.table.rowCount; row++) {
44162
+ if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
44163
+ (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
44164
+ continue;
44165
+ }
44166
+ const range = getCellMergeInfo(proxy.table, col, row);
44167
+ if (range && range.start.col !== col) {
44168
+ if (scrolling && checkHasColMerge(range.start.col, range.end.col, row, proxy)) {
44169
+ continue;
44170
+ }
44171
+ const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44172
+ const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44173
+ newCellGroup.col = col;
44174
+ newCellGroup.row = row;
44175
+ newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1) - oldCellGroup.parent.attribute.x);
44176
+ oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44177
+ oldCellGroup.parent.removeChild(oldCellGroup);
44178
+ oldCellGroup.needUpdate = false;
44179
+ newCellGroup.needUpdate = false;
44180
+ if (proxy.cellCache.get(col)) {
44181
+ proxy.cellCache.set(col, newCellGroup);
44182
+ }
44183
+ }
44184
+ }
44185
+ }
44186
+ function checkHasColMerge(colStart, colEnd, row, proxy) {
44187
+ for (let col = colStart; col <= colEnd; col++) {
44188
+ if (proxy.highPerformanceGetCell(col, row, true).role !== 'shadow-cell' &&
44189
+ proxy.highPerformanceGetCell(col, row, true).role !== 'empty') {
44190
+ return true;
44191
+ }
44192
+ }
44193
+ return false;
44194
+ }
44195
+ function getFirstChild(containerGroup) {
44196
+ let child = containerGroup.firstChild;
44197
+ while (child.type !== 'group') {
44198
+ child = child._next;
44199
+ }
44200
+ return child;
44201
+ }
44202
+ function getLastChild(containerGroup) {
44203
+ let child = containerGroup.lastChild;
44204
+ while (child.type !== 'group') {
44205
+ child = child._prev;
44206
+ }
44207
+ return child;
44208
+ }
44209
+ function getPrevGroup(group) {
44210
+ let child = group._prev;
44211
+ while (child && child.type !== 'group') {
44212
+ child = child._prev;
44213
+ }
44214
+ return child;
44215
+ }
44216
+ function getNextGroup(group) {
44217
+ let child = group._next;
44218
+ while (child && child.type !== 'group') {
44219
+ child = child._next;
44220
+ }
44221
+ return child;
44222
+ }
44223
+
44224
+ function updateAutoColumn(colStart, colEnd, table, direction = 'left') {
44225
+ for (let col = colStart; col <= colEnd; col++) {
44226
+ const bodyColGroup = table.scenegraph.getColGroup(col);
44227
+ if (bodyColGroup) {
44228
+ moveColumnGroup(bodyColGroup, table, direction);
44229
+ }
44230
+ const columnHeaderColGroup = table.scenegraph.getColGroup(col, true);
44231
+ if (columnHeaderColGroup) {
44232
+ moveColumnGroup(columnHeaderColGroup, table, direction);
44233
+ }
44234
+ const bottomColGroup = table.scenegraph.getColGroupInBottom(col);
44235
+ if (bottomColGroup) {
44236
+ moveColumnGroup(bottomColGroup, table, direction);
44237
+ }
44238
+ }
44239
+ const totalActualBodyColumnCount = Math.min(table.scenegraph.proxy.colLimit, table.scenegraph.proxy.bodyRightCol - table.scenegraph.proxy.bodyLeftCol + 1);
44240
+ const totalBodyWidth = table.getColsWidth(table.rowHeaderLevelCount, table.rowHeaderLevelCount + totalActualBodyColumnCount);
44241
+ const totalWidth = table.getColsWidth(table.rowHeaderLevelCount, table.colCount - 1);
44242
+ table.scenegraph.proxy.xLimitLeft = totalBodyWidth / 2;
44243
+ table.scenegraph.proxy.xLimitRight = totalWidth - totalBodyWidth / 2;
44244
+ }
44245
+ function moveColumnGroup(colGroup, table, direction = 'left') {
44246
+ if (direction === 'left') {
44247
+ let x;
44248
+ const prevCellGroup = getPrevGroup(colGroup);
44249
+ if (prevCellGroup) {
44250
+ x = prevCellGroup.attribute.x + table.getColWidth(colGroup._prev.col);
44251
+ }
44252
+ else {
44253
+ x = table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1);
44254
+ }
44255
+ colGroup.setAttribute('x', x);
44256
+ }
44257
+ else {
44258
+ let x;
44259
+ const nextCellGroup = getNextGroup(colGroup);
44260
+ if (nextCellGroup) {
44261
+ x = nextCellGroup.attribute.x - table.getColWidth(colGroup.col);
44262
+ }
44263
+ else {
44264
+ x = table.getColsWidth(table.rowHeaderLevelCount, colGroup.col - 1);
44265
+ }
44266
+ colGroup.setAttribute('x', x);
44267
+ }
44268
+ }
44269
+
44091
44270
  async function dynamicSetX(x, proxy) {
44092
44271
  const screenLeft = proxy.table.getTargetColAt(x + proxy.table.scenegraph.rowHeaderGroup.attribute.width);
44093
44272
  if (!screenLeft) {
44094
44273
  return;
44095
44274
  }
44096
- proxy.screenLeftCol = screenLeft.col;
44275
+ const screenLeftCol = screenLeft.col;
44276
+ const screenLeftX = screenLeft.left;
44277
+ proxy.screenLeftCol = screenLeftCol;
44097
44278
  const deltaCol = proxy.screenLeftCol - proxy.referenceCol;
44098
44279
  if (deltaCol > 0) {
44099
- proxy.table.scenegraph.setBodyAndColHeaderX(-x);
44100
- await moveColumn(deltaCol, 'left', proxy.screenLeftCol, proxy);
44280
+ moveColumn(deltaCol, 'left', proxy.screenLeftCol, screenLeftX, proxy);
44281
+ proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
44101
44282
  }
44102
44283
  else if (deltaCol < 0) {
44103
- proxy.table.scenegraph.setBodyAndColHeaderX(-x);
44104
- await moveColumn(-deltaCol, 'right', proxy.screenLeftCol, proxy);
44284
+ moveColumn(-deltaCol, 'right', proxy.screenLeftCol, screenLeftX, proxy);
44285
+ proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
44105
44286
  }
44106
44287
  else {
44107
- proxy.table.scenegraph.setBodyAndColHeaderX(-x);
44288
+ proxy.table.scenegraph.setBodyAndColHeaderX(-x + proxy.deltaX);
44108
44289
  }
44109
44290
  proxy.table.scenegraph.updateNextFrame();
44110
44291
  }
44111
- async function moveColumn(count, direction, screenLeftCol, proxy) {
44292
+ async function moveColumn(count, direction, screenLeftCol, screenLeftX, proxy) {
44112
44293
  if (direction === 'left' && proxy.colEnd + count > proxy.bodyRightCol) {
44113
44294
  count = proxy.bodyRightCol - proxy.colEnd;
44114
44295
  }
44115
44296
  else if (direction === 'right' && proxy.colStart - count < proxy.bodyLeftCol) {
44116
44297
  count = proxy.colStart - proxy.bodyLeftCol;
44117
44298
  }
44118
- proxy.table.scenegraph.bodyGroup;
44299
+ if (count <= 0) {
44300
+ return;
44301
+ }
44119
44302
  if (count < proxy.colEnd - proxy.colStart) {
44120
44303
  const startCol = direction === 'left' ? proxy.colStart : proxy.colEnd - count + 1;
44121
44304
  const endCol = direction === 'left' ? proxy.colStart + count - 1 : proxy.colEnd;
@@ -44123,18 +44306,22 @@
44123
44306
  const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colStart - 1;
44124
44307
  computeColsWidth(proxy.table, distStartCol, distEndCol);
44125
44308
  updatePartColPosition(startCol, endCol, direction, proxy);
44126
- const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenColCount * 1);
44127
- const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenColCount * 2);
44309
+ const syncLeftCol = distStartCol;
44310
+ const syncRightCol = distEndCol;
44128
44311
  proxy.colStart = direction === 'left' ? proxy.colStart + count : proxy.colStart - count;
44129
44312
  proxy.colEnd = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
44130
- checkFirstColMerge(distStartCol, proxy);
44313
+ checkFirstColMerge(distStartCol, true, proxy);
44131
44314
  updateColContent(syncLeftCol, syncRightCol, proxy);
44315
+ updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, direction);
44316
+ const colGroup = proxy.table.scenegraph.getColGroup(screenLeftCol);
44317
+ const deltaX = screenLeftX - (colGroup.attribute.x + proxy.table.getFrozenColsWidth() + proxy.table.scenegraph.proxy.deltaX);
44318
+ proxy.table.scenegraph.proxy.deltaX += deltaX;
44132
44319
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
44133
44320
  proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
44134
44321
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
44135
44322
  proxy.colUpdatePos = distStartCol;
44136
44323
  proxy.colUpdateDirection = direction;
44137
- proxy.table.scenegraph.stage.render();
44324
+ proxy.table.scenegraph.updateNextFrame();
44138
44325
  await proxy.progress();
44139
44326
  }
44140
44327
  else {
@@ -44142,19 +44329,21 @@
44142
44329
  const distEndCol = direction === 'left' ? proxy.colEnd + count : proxy.colEnd - count;
44143
44330
  computeColsWidth(proxy.table, distStartCol, distEndCol);
44144
44331
  const distStartColY = proxy.table.getColsWidth(proxy.bodyLeftCol, distStartCol - 1);
44145
- console.log('distStartColY', proxy.bodyLeftCol, distStartCol - 1, distStartColY);
44146
44332
  updateAllColPosition(distStartColY, count, direction, proxy);
44147
- const syncLeftCol = Math.max(proxy.bodyLeftCol, screenLeftCol - proxy.screenRowCount * 1);
44148
- const syncRightCol = Math.min(proxy.bodyRightCol, screenLeftCol + proxy.screenRowCount * 2);
44333
+ const syncLeftCol = distStartCol;
44334
+ const syncRightCol = distEndCol;
44149
44335
  proxy.colStart = distStartCol;
44150
44336
  proxy.colEnd = distEndCol;
44151
- checkFirstColMerge(distStartCol, proxy);
44337
+ checkFirstColMerge(distStartCol, false, proxy);
44152
44338
  updateColContent(syncLeftCol, syncRightCol, proxy);
44339
+ updateAutoColumn(syncLeftCol, syncRightCol, proxy.table, distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left');
44340
+ proxy.table.scenegraph.proxy.deltaX = 0;
44153
44341
  proxy.currentCol = direction === 'left' ? proxy.currentCol + count : proxy.currentCol - count;
44154
44342
  proxy.totalCol = direction === 'left' ? proxy.totalCol + count : proxy.totalCol - count;
44155
44343
  proxy.referenceCol = proxy.colStart + Math.floor((proxy.colEnd - proxy.colStart) / 2);
44156
44344
  proxy.colUpdatePos = proxy.colStart;
44157
44345
  proxy.colUpdateDirection = distEndCol > proxy.bodyRightCol - (proxy.colEnd - proxy.colStart + 1) ? 'right' : 'left';
44346
+ proxy.table.scenegraph.updateNextFrame();
44158
44347
  await proxy.progress();
44159
44348
  }
44160
44349
  }
@@ -44177,6 +44366,7 @@
44177
44366
  cellGroup = newCellGroup._next;
44178
44367
  }
44179
44368
  colGroup.needUpdate = false;
44369
+ colGroup.setAttribute('width', proxy.table.getColWidth(colGroup.col));
44180
44370
  }
44181
44371
  function updatePartColPosition(startCol, endCol, direction, proxy) {
44182
44372
  for (let col = startCol; col <= endCol; col++) {
@@ -44184,34 +44374,38 @@
44184
44374
  updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
44185
44375
  }
44186
44376
  if (proxy.table.scenegraph.colHeaderGroup.childrenCount > 0) {
44187
- updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
44377
+ updateColPosition(proxy.table.scenegraph.colHeaderGroup, direction, proxy);
44188
44378
  }
44189
44379
  if (proxy.table.scenegraph.bottomFrozenGroup.childrenCount > 0) {
44190
- updateColPosition(proxy.table.scenegraph.bodyGroup, direction, proxy);
44380
+ updateColPosition(proxy.table.scenegraph.bottomFrozenGroup, direction, proxy);
44191
44381
  }
44192
44382
  }
44193
44383
  }
44194
44384
  function updateColPosition(containerGroup, direction, proxy) {
44195
44385
  if (direction === 'left') {
44196
- const colGroup = containerGroup.firstChild;
44197
- updateColGroupPosition(colGroup, containerGroup.lastChild.col + 1, containerGroup.lastChild.attribute.x + containerGroup.lastChild.attribute.width);
44386
+ const colGroup = getFirstChild(containerGroup);
44387
+ const lastChild = getLastChild(containerGroup);
44388
+ updateColGroupPosition(colGroup, lastChild.col + 1, lastChild.attribute.x + proxy.table.getColWidth(lastChild.col));
44198
44389
  containerGroup.appendChild(colGroup);
44390
+ if (containerGroup.border) {
44391
+ containerGroup.appendChild(containerGroup.border);
44392
+ }
44199
44393
  }
44200
44394
  else {
44201
- const colGroup = containerGroup.lastChild;
44202
- updateColGroupPosition(colGroup, containerGroup.firstChild.col - 1, containerGroup.firstChild.attribute.x -
44203
- proxy.table.getColWidth(containerGroup.firstChild.col - 1));
44395
+ const colGroup = getLastChild(containerGroup);
44396
+ const firstChild = getFirstChild(containerGroup);
44397
+ updateColGroupPosition(colGroup, firstChild.col - 1, firstChild.attribute.x - proxy.table.getColWidth(firstChild.col - 1));
44204
44398
  containerGroup.insertBefore(colGroup, containerGroup.firstChild);
44205
44399
  }
44206
44400
  }
44207
44401
  function updateColContent(syncLeftCol, syncRightCol, proxy) {
44208
44402
  for (let col = syncLeftCol; col <= syncRightCol; col++) {
44209
44403
  const colGroup = proxy.table.scenegraph.getColGroup(col);
44210
- updateColGroupContent(colGroup, proxy);
44404
+ colGroup && updateColGroupContent(colGroup, proxy);
44211
44405
  const colHeaderColGroup = proxy.table.scenegraph.getColGroup(col, true);
44212
- updateColGroupContent(colHeaderColGroup, proxy);
44406
+ colHeaderColGroup && updateColGroupContent(colHeaderColGroup, proxy);
44213
44407
  const bottomColGroup = proxy.table.scenegraph.getColGroupInBottom(col);
44214
- updateColGroupContent(bottomColGroup, proxy);
44408
+ bottomColGroup && updateColGroupContent(bottomColGroup, proxy);
44215
44409
  }
44216
44410
  }
44217
44411
  function updateAllColPosition(distStartColY, count, direction, proxy) {
@@ -44237,29 +44431,6 @@
44237
44431
  }
44238
44432
  });
44239
44433
  }
44240
- function checkFirstColMerge(col, proxy) {
44241
- for (let row = 0; row < proxy.table.rowCount; row++) {
44242
- if ((row >= proxy.table.columnHeaderLevelCount && row < proxy.rowStart) ||
44243
- (row > proxy.rowEnd && row < proxy.table.rowCount - proxy.table.bottomFrozenRowCount)) {
44244
- continue;
44245
- }
44246
- const range = getCellMergeInfo(proxy.table, col, row);
44247
- if (range && range.start.row !== row) {
44248
- const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44249
- const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44250
- newCellGroup.col = col;
44251
- newCellGroup.row = row;
44252
- newCellGroup.setAttribute('x', proxy.table.getColsWidth(proxy.table.rowHeaderLevelCount, range.start.col - 1));
44253
- oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44254
- oldCellGroup.parent.removeChild(oldCellGroup);
44255
- oldCellGroup.needUpdate = false;
44256
- newCellGroup.needUpdate = false;
44257
- if (proxy.cellCache.get(col)) {
44258
- proxy.cellCache.set(col, newCellGroup);
44259
- }
44260
- }
44261
- }
44262
- }
44263
44434
 
44264
44435
  function updateAutoRow(colStart, colEnd, rowStart, rowEnd, table, direction = 'up') {
44265
44436
  if (direction === 'up') {
@@ -44486,29 +44657,6 @@
44486
44657
  }
44487
44658
  }
44488
44659
  }
44489
- function checkFirstRowMerge(row, proxy) {
44490
- for (let col = 0; col < proxy.table.colCount; col++) {
44491
- if ((col >= proxy.table.rowHeaderLevelCount && col < proxy.colStart) ||
44492
- (col > proxy.colEnd && col < proxy.table.colCount - proxy.table.rightFrozenColCount)) {
44493
- continue;
44494
- }
44495
- const range = getCellMergeInfo(proxy.table, col, row);
44496
- if (range && range.start.row !== row) {
44497
- const oldCellGroup = proxy.highPerformanceGetCell(col, row, true);
44498
- const newCellGroup = updateCell$1(range.start.col, range.start.row, proxy.table, true);
44499
- newCellGroup.col = col;
44500
- newCellGroup.row = row;
44501
- newCellGroup.setAttribute('y', proxy.table.getRowsHeight(proxy.table.columnHeaderLevelCount, range.start.row - 1));
44502
- oldCellGroup.parent.insertAfter(newCellGroup, oldCellGroup);
44503
- oldCellGroup.parent.removeChild(oldCellGroup);
44504
- oldCellGroup.needUpdate = false;
44505
- newCellGroup.needUpdate = false;
44506
- if (proxy.cellCache.get(col)) {
44507
- proxy.cellCache.set(col, newCellGroup);
44508
- }
44509
- }
44510
- }
44511
- }
44512
44660
 
44513
44661
  class SceneProxy {
44514
44662
  table;
@@ -44530,7 +44678,7 @@
44530
44678
  rowUpdateDirection;
44531
44679
  screenTopRow = 0;
44532
44680
  deltaY = 0;
44533
- colLimit = 1000;
44681
+ colLimit = 100;
44534
44682
  bodyLeftCol;
44535
44683
  bodyRightCol;
44536
44684
  totalCol;
@@ -44546,6 +44694,7 @@
44546
44694
  referenceCol;
44547
44695
  screenLeftCol = 0;
44548
44696
  colUpdateDirection;
44697
+ deltaX = 0;
44549
44698
  cellCache = new Map();
44550
44699
  constructor(table) {
44551
44700
  this.table = table;
@@ -44684,6 +44833,12 @@
44684
44833
  createColGroup(onceCount) {
44685
44834
  const endCol = Math.min(this.totalCol, this.currentCol + onceCount);
44686
44835
  computeColsWidth(this.table, this.currentCol + 1, endCol);
44836
+ for (let row = 0; row < this.table.rowCount; row++) {
44837
+ const cellGroup = this.highPerformanceGetCell(this.currentCol, row);
44838
+ if (isNumber(cellGroup.mergeCol) && cellGroup.mergeCol > this.currentCol) {
44839
+ this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);
44840
+ }
44841
+ }
44687
44842
  if (this.table.columnHeaderLevelCount) {
44688
44843
  const lastColumnGroup = (this.table.scenegraph.colHeaderGroup.lastChild instanceof Group
44689
44844
  ? this.table.scenegraph.colHeaderGroup.lastChild
@@ -45435,25 +45590,296 @@
45435
45590
  });
45436
45591
  }
45437
45592
  }
45438
- function checkHaveTextStick(table) {
45439
- const headerObjects = table.internalProps.layoutMap.headerObjects;
45440
- const columnObjects = table.internalProps.layoutMap.columnObjects;
45441
- for (let i = 0; i < headerObjects.length; i++) {
45442
- const header = headerObjects[i];
45443
- if (header && header.style?.textStick) {
45444
- console.log('checkHaveTextStick', true);
45445
- return true;
45593
+ function checkHaveTextStick(table) {
45594
+ const headerObjects = table.internalProps.layoutMap.headerObjects;
45595
+ const columnObjects = table.internalProps.layoutMap.columnObjects;
45596
+ for (let i = 0; i < headerObjects.length; i++) {
45597
+ const header = headerObjects[i];
45598
+ if (header && header.style?.textStick) {
45599
+ console.log('checkHaveTextStick', true);
45600
+ return true;
45601
+ }
45602
+ }
45603
+ for (let i = 0; i < columnObjects.length; i++) {
45604
+ const column = columnObjects[i];
45605
+ if (column && column.style?.textStick) {
45606
+ console.log('checkHaveTextStick', true);
45607
+ return true;
45608
+ }
45609
+ }
45610
+ console.log('checkHaveTextStick', false);
45611
+ return false;
45612
+ }
45613
+
45614
+ function dealFrozen(scene) {
45615
+ if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
45616
+ scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45617
+ scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45618
+ scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45619
+ for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45620
+ moveColumnFromBodyToRowHeader(scene);
45621
+ moveColumnFromColHeaderToCornerHeader(scene);
45622
+ }
45623
+ }
45624
+ else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {
45625
+ for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {
45626
+ moveColumnFromRowHeaderToBody(scene);
45627
+ moveColumnFromCornerHeaderToColHeader(scene);
45628
+ }
45629
+ }
45630
+ scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45631
+ scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45632
+ scene.updateContainer();
45633
+ scene.updateBorderSizeAndPosition();
45634
+ if (!scene.isPivot && !scene.transpose) {
45635
+ scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45636
+ }
45637
+ scene.hasFrozen = true;
45638
+ scene.frozenColCount = scene.table.frozenColCount;
45639
+ scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45640
+ }
45641
+ function resetFrozen(scene) {
45642
+ if (scene.frozenColCount > scene.table.rowHeaderLevelCount) {
45643
+ for (let i = 0; i < scene.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45644
+ moveColumnFromRowHeaderToBody(scene);
45645
+ moveColumnFromCornerHeaderToColHeader(scene);
45646
+ }
45647
+ }
45648
+ else if (scene.frozenColCount < scene.table.rowHeaderLevelCount) {
45649
+ scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45650
+ scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45651
+ scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45652
+ for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.frozenColCount; i++) {
45653
+ moveColumnFromBodyToRowHeader(scene);
45654
+ moveColumnFromColHeaderToCornerHeader(scene);
45655
+ }
45656
+ }
45657
+ scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45658
+ scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45659
+ scene.updateContainer();
45660
+ scene.updateBorderSizeAndPosition();
45661
+ if (!scene.isPivot && !scene.transpose) {
45662
+ scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45663
+ }
45664
+ scene.hasFrozen = true;
45665
+ scene.frozenColCount = scene.table.rowHeaderLevelCount;
45666
+ scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45667
+ }
45668
+ function moveColumnFromBodyToRowHeader(scene) {
45669
+ const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;
45670
+ if (column) {
45671
+ scene.rowHeaderGroup.appendChild(column);
45672
+ scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width + column.attribute.width);
45673
+ scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width - column.attribute.width);
45674
+ }
45675
+ }
45676
+ function moveColumnFromColHeaderToCornerHeader(scene) {
45677
+ const headerColumn = scene.colHeaderGroup.firstChild instanceof Group ? scene.colHeaderGroup.firstChild : null;
45678
+ if (headerColumn) {
45679
+ scene.cornerHeaderGroup.appendChild(headerColumn);
45680
+ scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width);
45681
+ scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width - headerColumn.attribute.width);
45682
+ }
45683
+ }
45684
+ function moveColumnFromRowHeaderToBody(scene) {
45685
+ const column = scene.rowHeaderGroup.lastChild instanceof Group
45686
+ ? scene.rowHeaderGroup.lastChild
45687
+ : scene.rowHeaderGroup.lastChild?._prev;
45688
+ if (column) {
45689
+ insertBefore(scene.bodyGroup, column, scene.bodyGroup.firstChild);
45690
+ scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width + column.attribute.width);
45691
+ scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width - column.attribute.width);
45692
+ }
45693
+ }
45694
+ function moveColumnFromCornerHeaderToColHeader(scene) {
45695
+ const headerColumn = scene.cornerHeaderGroup.lastChild instanceof Group
45696
+ ? scene.cornerHeaderGroup.lastChild
45697
+ : scene.cornerHeaderGroup.lastChild?._prev;
45698
+ if (headerColumn) {
45699
+ insertBefore(scene.colHeaderGroup, headerColumn, scene.colHeaderGroup.firstChild);
45700
+ scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width + headerColumn.attribute.width);
45701
+ scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width);
45702
+ }
45703
+ }
45704
+ function dealRightFrozen(distRightFrozenCol, scene) {
45705
+ const { table, proxy, rightTopCornerGroup, rightFrozenGroup, rightBottomCornerGroup, bottomFrozenGroup, bodyGroup, colHeaderGroup } = scene;
45706
+ const currentRightFrozenCol = scene.table.rightFrozenColCount;
45707
+ if (distRightFrozenCol > currentRightFrozenCol) {
45708
+ for (let col = table.colCount - currentRightFrozenCol - 1; col >= table.colCount - distRightFrozenCol; col--) {
45709
+ const colGroup = scene.getColGroup(col);
45710
+ insertBefore(rightFrozenGroup, colGroup, rightFrozenGroup.firstChild);
45711
+ const headerColGroup = scene.getColGroup(col, true);
45712
+ insertBefore(rightTopCornerGroup, headerColGroup, rightTopCornerGroup.firstChild);
45713
+ const bottomColGroup = scene.getColGroupInBottom(col);
45714
+ insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild);
45715
+ }
45716
+ let x = 0;
45717
+ rightFrozenGroup.forEachChildren((columnGroup) => {
45718
+ columnGroup.setAttribute('x', x);
45719
+ x += columnGroup.attribute.width;
45720
+ });
45721
+ x = 0;
45722
+ rightTopCornerGroup.forEachChildren((columnGroup) => {
45723
+ columnGroup.setAttribute('x', x);
45724
+ x += columnGroup.attribute.width;
45725
+ });
45726
+ x = 0;
45727
+ rightBottomCornerGroup.forEachChildren((columnGroup) => {
45728
+ columnGroup.setAttribute('x', x);
45729
+ x += columnGroup.attribute.width;
45730
+ });
45731
+ }
45732
+ else if (distRightFrozenCol < currentRightFrozenCol) {
45733
+ for (let col = table.colCount - currentRightFrozenCol; col < table.colCount - distRightFrozenCol; col++) {
45734
+ const colGroup = scene.getColGroup(col);
45735
+ colGroup.setAttribute('x', bodyGroup.lastChild.attribute.x + table.getColWidth(bodyGroup.lastChild.col));
45736
+ bodyGroup.appendChild(colGroup);
45737
+ const headerColGroup = scene.getColGroupInRightTopCorner(col);
45738
+ headerColGroup.setAttribute('x', colHeaderGroup.lastChild.attribute.x + table.getColWidth(colHeaderGroup.lastChild.col));
45739
+ colHeaderGroup.appendChild(headerColGroup);
45740
+ const bottomColGroup = scene.getColGroupInRightBottomCorner(col);
45741
+ bottomColGroup.setAttribute('x', bottomFrozenGroup.lastChild.attribute.x +
45742
+ table.getColWidth(bottomFrozenGroup.lastChild.col));
45743
+ bottomFrozenGroup.appendChild(bottomColGroup);
45744
+ }
45745
+ let x = 0;
45746
+ rightFrozenGroup.forEachChildren((columnGroup) => {
45747
+ columnGroup.setAttribute('x', x);
45748
+ x += columnGroup.attribute.width;
45749
+ });
45750
+ x = 0;
45751
+ rightTopCornerGroup.forEachChildren((columnGroup) => {
45752
+ columnGroup.setAttribute('x', x);
45753
+ x += columnGroup.attribute.width;
45754
+ });
45755
+ x = 0;
45756
+ rightBottomCornerGroup.forEachChildren((columnGroup) => {
45757
+ columnGroup.setAttribute('x', x);
45758
+ x += columnGroup.attribute.width;
45759
+ });
45760
+ }
45761
+ rightFrozenGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));
45762
+ rightTopCornerGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));
45763
+ rightBottomCornerGroup.setAttribute('width', table.getColsWidth(table.colCount - distRightFrozenCol, table.colCount - 1));
45764
+ table.internalProps.rightFrozenColCount = distRightFrozenCol;
45765
+ scene.updateContainer();
45766
+ scene.component.updateScrollBar();
45767
+ scene.updateNextFrame();
45768
+ }
45769
+ function dealBottomFrozen(distBottomFrozenRow, scene) {
45770
+ const { table, proxy, bottomFrozenGroup, leftBottomCornerGroup, rightBottomCornerGroup } = scene;
45771
+ if (!bottomFrozenGroup.childrenCount) {
45772
+ if (!proxy.table.isPivotChart()) {
45773
+ createColGroup(leftBottomCornerGroup, 0, 0, 0, table.rowHeaderLevelCount - 1, 0, -1, 'rowHeader', table);
45774
+ createColGroup(rightBottomCornerGroup, 0, 0, table.colCount - table.rightFrozenColCount, table.colCount - 1, 0, -1, 'body', table);
45446
45775
  }
45776
+ createColGroup(bottomFrozenGroup, 0, 0, proxy.colStart, proxy.colEnd, 0, -1, 'body', table);
45447
45777
  }
45448
- for (let i = 0; i < columnObjects.length; i++) {
45449
- const column = columnObjects[i];
45450
- if (column && column.style?.textStick) {
45451
- console.log('checkHaveTextStick', true);
45452
- return true;
45778
+ const currentBottomFrozenRow = scene.table.bottomFrozenRowCount;
45779
+ if (distBottomFrozenRow > currentBottomFrozenRow) {
45780
+ for (let col = 0; col < table.rowHeaderLevelCount; col++) {
45781
+ const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);
45782
+ for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {
45783
+ const cellGroup = scene.getCell(col, row, true);
45784
+ insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild);
45785
+ }
45786
+ let y = 0;
45787
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45788
+ cellGroup.setAttribute('y', y);
45789
+ y += table.getRowHeight(cellGroup.row);
45790
+ });
45791
+ }
45792
+ for (let col = proxy.colStart; col <= proxy.colEnd; col++) {
45793
+ const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);
45794
+ for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {
45795
+ const cellGroup = scene.getCell(col, row, true);
45796
+ insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild);
45797
+ }
45798
+ let y = 0;
45799
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45800
+ cellGroup.setAttribute('y', y);
45801
+ y += table.getRowHeight(cellGroup.row);
45802
+ });
45803
+ }
45804
+ if (table.rightFrozenColCount > 0) {
45805
+ for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {
45806
+ const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);
45807
+ for (let row = table.rowCount - currentBottomFrozenRow - 1; row >= table.rowCount - distBottomFrozenRow; row--) {
45808
+ const cellGroup = scene.getCell(col, row, true);
45809
+ insertBefore(bottomFrozenColumnGroup, cellGroup, bottomFrozenColumnGroup.firstChild);
45810
+ }
45811
+ let y = 0;
45812
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45813
+ cellGroup.setAttribute('y', y);
45814
+ y += table.getRowHeight(cellGroup.row);
45815
+ });
45816
+ }
45453
45817
  }
45454
45818
  }
45455
- console.log('checkHaveTextStick', false);
45456
- return false;
45819
+ else if (distBottomFrozenRow < currentBottomFrozenRow) {
45820
+ for (let col = 0; col < table.rowHeaderLevelCount; col++) {
45821
+ const columnGroup = scene.getColGroup(col);
45822
+ for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {
45823
+ const cellGroup = scene.getCell(col, row, true);
45824
+ cellGroup.setAttribute('y', columnGroup.lastChild.attribute.y + table.getRowHeight(columnGroup.lastChild.row));
45825
+ columnGroup.appendChild(cellGroup);
45826
+ }
45827
+ const bottomFrozenColumnGroup = scene.getColGroupInLeftBottomCorner(col);
45828
+ let y = 0;
45829
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45830
+ cellGroup.setAttribute('y', y);
45831
+ y += table.getRowHeight(cellGroup.row);
45832
+ });
45833
+ }
45834
+ for (let col = proxy.colStart; col <= proxy.colEnd; col++) {
45835
+ const columnGroup = scene.getColGroup(col);
45836
+ for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {
45837
+ const cellGroup = scene.getCell(col, row, true);
45838
+ cellGroup.setAttribute('y', columnGroup.lastChild.attribute.y + table.getRowHeight(columnGroup.lastChild.row));
45839
+ columnGroup.appendChild(cellGroup);
45840
+ }
45841
+ const bottomFrozenColumnGroup = scene.getColGroupInBottom(col);
45842
+ let y = 0;
45843
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45844
+ cellGroup.setAttribute('y', y);
45845
+ y += table.getRowHeight(cellGroup.row);
45846
+ });
45847
+ }
45848
+ if (table.rightFrozenColCount > 0) {
45849
+ for (let col = table.colCount - table.rightFrozenColCount; col < table.colCount; col++) {
45850
+ const columnGroup = scene.getColGroup(col);
45851
+ for (let row = table.rowCount - currentBottomFrozenRow; row < table.rowCount - distBottomFrozenRow; row++) {
45852
+ const cellGroup = scene.getCell(col, row, true);
45853
+ cellGroup.setAttribute('y', columnGroup.lastChild.attribute.y + table.getRowHeight(columnGroup.lastChild.row));
45854
+ columnGroup.appendChild(cellGroup);
45855
+ }
45856
+ const bottomFrozenColumnGroup = scene.getColGroupInRightBottomCorner(col);
45857
+ let y = 0;
45858
+ bottomFrozenColumnGroup.forEachChildren((cellGroup) => {
45859
+ cellGroup.setAttribute('y', y);
45860
+ y += table.getRowHeight(cellGroup.row);
45861
+ });
45862
+ }
45863
+ }
45864
+ }
45865
+ bottomFrozenGroup.setAttribute('height', table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1));
45866
+ leftBottomCornerGroup.setAttribute('height', table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1));
45867
+ rightBottomCornerGroup.setAttribute('height', table.getRowsHeight(table.rowCount - distBottomFrozenRow, table.rowCount - 1));
45868
+ table.internalProps.bottomFrozenRowCount = distBottomFrozenRow;
45869
+ scene.updateContainer();
45870
+ scene.component.updateScrollBar();
45871
+ scene.updateNextFrame();
45872
+ }
45873
+ function insertBefore(container, newNode, targetGroup) {
45874
+ if (!newNode || !container) {
45875
+ return;
45876
+ }
45877
+ if (targetGroup) {
45878
+ container.insertBefore(newNode, targetGroup);
45879
+ }
45880
+ else {
45881
+ container.appendChild(newNode);
45882
+ }
45457
45883
  }
45458
45884
 
45459
45885
  function updateChartSize(scenegraph, col) {
@@ -45515,7 +45941,7 @@
45515
45941
  if ((datum === null || datum?.length === 0 || Object.keys(datum).length === 0) && preSelectItemsCount === 0) {
45516
45942
  return;
45517
45943
  }
45518
- table._selectedDataItemsInChart = [];
45944
+ const newSelectedDataItemsInChart = [];
45519
45945
  if (Array.isArray(datum)) {
45520
45946
  datum.forEach((dataItem) => {
45521
45947
  if (dataItem && dataItem.key !== 0 && Object.keys(dataItem).length > 0) {
@@ -45525,7 +45951,7 @@
45525
45951
  selectedState[itemKey] = dataItem[itemKey];
45526
45952
  }
45527
45953
  }
45528
- table._selectedDataItemsInChart.push(selectedState);
45954
+ newSelectedDataItemsInChart.push(selectedState);
45529
45955
  }
45530
45956
  });
45531
45957
  }
@@ -45536,13 +45962,14 @@
45536
45962
  selectedState[itemKey] = datum[itemKey];
45537
45963
  }
45538
45964
  }
45539
- table._selectedDataItemsInChart.push(selectedState);
45965
+ newSelectedDataItemsInChart.push(selectedState);
45540
45966
  }
45541
- if (table._selectedDataItemsInChart.length === 0 && preSelectItemsCount === 0) {
45542
- return;
45967
+ if (!isEqual(table._selectedDataItemsInChart, newSelectedDataItemsInChart)) {
45968
+ table._selectedDataItemsInChart = newSelectedDataItemsInChart;
45969
+ table.internalProps.layoutMap.updateDataStateToChartInstance();
45970
+ clearChartCacheImage(scenegraph);
45971
+ table.scenegraph.updateNextFrame();
45543
45972
  }
45544
- table.internalProps.layoutMap.updateDataStateToChartInstance();
45545
- clearChartCacheImage(scenegraph);
45546
45973
  }
45547
45974
  }
45548
45975
  function updateTableAxes(containerGroup, table) {
@@ -45571,108 +45998,7 @@
45571
45998
  });
45572
45999
  }
45573
46000
 
45574
- function dealFrozen(scene) {
45575
- if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
45576
- scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45577
- scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45578
- scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45579
- for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45580
- moveColumnFromBodyToRowHeader(scene);
45581
- moveColumnFromColHeaderToCornerHeader(scene);
45582
- }
45583
- }
45584
- else if (scene.table.frozenColCount < scene.table.rowHeaderLevelCount) {
45585
- for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) {
45586
- moveColumnFromRowHeaderToBody(scene);
45587
- moveColumnFromCornerHeaderToColHeader(scene);
45588
- }
45589
- }
45590
- scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45591
- scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45592
- scene.updateContainer();
45593
- scene.updateBorderSizeAndPosition();
45594
- if (!scene.isPivot && !scene.transpose) {
45595
- scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45596
- }
45597
- scene.hasFrozen = true;
45598
- scene.frozenColCount = scene.table.frozenColCount;
45599
- scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45600
- }
45601
- function resetFrozen(scene) {
45602
- if (scene.frozenColCount > scene.table.rowHeaderLevelCount) {
45603
- for (let i = 0; i < scene.frozenColCount - scene.table.rowHeaderLevelCount; i++) {
45604
- moveColumnFromRowHeaderToBody(scene);
45605
- moveColumnFromCornerHeaderToColHeader(scene);
45606
- }
45607
- }
45608
- else if (scene.frozenColCount < scene.table.rowHeaderLevelCount) {
45609
- scene.rowHeaderGroup.setAttribute('height', scene.bodyGroup.attribute.height);
45610
- scene.rowHeaderGroup.setAttribute('y', scene.bodyGroup.attribute.y);
45611
- scene.cornerHeaderGroup.setAttribute('height', scene.colHeaderGroup.attribute.height);
45612
- for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.frozenColCount; i++) {
45613
- moveColumnFromBodyToRowHeader(scene);
45614
- moveColumnFromColHeaderToCornerHeader(scene);
45615
- }
45616
- }
45617
- scene.bodyGroup.setAttribute('x', scene.rowHeaderGroup.attribute.width);
45618
- scene.colHeaderGroup.setAttribute('x', scene.cornerHeaderGroup.attribute.width);
45619
- scene.updateContainer();
45620
- scene.updateBorderSizeAndPosition();
45621
- if (!scene.isPivot && !scene.transpose) {
45622
- scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
45623
- }
45624
- scene.hasFrozen = true;
45625
- scene.frozenColCount = scene.table.rowHeaderLevelCount;
45626
- scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
45627
- }
45628
- function moveColumnFromBodyToRowHeader(scene) {
45629
- const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;
45630
- if (column) {
45631
- scene.rowHeaderGroup.appendChild(column);
45632
- scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width + column.attribute.width);
45633
- scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width - column.attribute.width);
45634
- }
45635
- }
45636
- function moveColumnFromColHeaderToCornerHeader(scene) {
45637
- const headerColumn = scene.colHeaderGroup.firstChild instanceof Group ? scene.colHeaderGroup.firstChild : null;
45638
- if (headerColumn) {
45639
- scene.cornerHeaderGroup.appendChild(headerColumn);
45640
- scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width + headerColumn.attribute.width);
45641
- scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width - headerColumn.attribute.width);
45642
- }
45643
- }
45644
- function moveColumnFromRowHeaderToBody(scene) {
45645
- const column = scene.rowHeaderGroup.lastChild instanceof Group
45646
- ? scene.rowHeaderGroup.lastChild
45647
- : scene.rowHeaderGroup.lastChild?._prev;
45648
- if (column) {
45649
- if (scene.bodyGroup.firstChild) {
45650
- scene.bodyGroup.insertBefore(column, scene.bodyGroup.firstChild);
45651
- }
45652
- else {
45653
- scene.bodyGroup.appendChild(column);
45654
- }
45655
- scene.bodyGroup.setAttribute('width', scene.bodyGroup.attribute.width + column.attribute.width);
45656
- scene.rowHeaderGroup.setAttribute('width', scene.rowHeaderGroup.attribute.width - column.attribute.width);
45657
- }
45658
- }
45659
- function moveColumnFromCornerHeaderToColHeader(scene) {
45660
- const headerColumn = scene.cornerHeaderGroup.lastChild instanceof Group
45661
- ? scene.cornerHeaderGroup.lastChild
45662
- : scene.cornerHeaderGroup.lastChild?._prev;
45663
- if (headerColumn) {
45664
- if (scene.colHeaderGroup.firstChild) {
45665
- scene.colHeaderGroup.insertBefore(headerColumn, scene.colHeaderGroup.firstChild);
45666
- }
45667
- else {
45668
- scene.bodyGroup.appendChild(headerColumn);
45669
- }
45670
- scene.colHeaderGroup.setAttribute('width', scene.colHeaderGroup.attribute.width + headerColumn.attribute.width);
45671
- scene.cornerHeaderGroup.setAttribute('width', scene.cornerHeaderGroup.attribute.width - headerColumn.attribute.width);
45672
- }
45673
- }
45674
-
45675
- function createCornerCell(frameTheme) {
46001
+ function createCornerCell(cellGroup, frameTheme) {
45676
46002
  const { bgColor, borderColor, borderLineWidth, borderLineDash } = frameTheme;
45677
46003
  const rectAttributes = {
45678
46004
  x: 0,
@@ -45694,9 +46020,71 @@
45694
46020
  rectAttributes.strokeArrayWidth = getQuadProps(borderLineWidth);
45695
46021
  rectAttributes.lineWidth = 1;
45696
46022
  }
45697
- const cornerCellGroup = new Group(rectAttributes);
45698
- cornerCellGroup.role = 'corner-frozen';
45699
- return cornerCellGroup;
46023
+ cellGroup.setAttributes(rectAttributes);
46024
+ cellGroup.role = 'corner-frozen';
46025
+ return cellGroup;
46026
+ }
46027
+
46028
+ function initSceneGraph(scene) {
46029
+ const width = scene.table.tableNoFrameWidth;
46030
+ const height = scene.table.tableNoFrameHeight;
46031
+ scene.tableGroup = new Group({ x: 0, y: 0, width, height, clip: true, pickable: false });
46032
+ scene.tableGroup.role = 'table';
46033
+ const colHeaderGroup = createContainerGroup(0, 0);
46034
+ colHeaderGroup.role = 'col-header';
46035
+ scene.colHeaderGroup = colHeaderGroup;
46036
+ const cornerHeaderGroup = createContainerGroup(0, 0);
46037
+ cornerHeaderGroup.role = 'corner-header';
46038
+ scene.cornerHeaderGroup = cornerHeaderGroup;
46039
+ const rowHeaderGroup = createContainerGroup(0, 0);
46040
+ rowHeaderGroup.role = 'row-header';
46041
+ scene.rowHeaderGroup = rowHeaderGroup;
46042
+ const bodyGroup = createContainerGroup(width, 0);
46043
+ bodyGroup.role = 'body';
46044
+ scene.bodyGroup = bodyGroup;
46045
+ const rightFrozenGroup = createContainerGroup(0, 0);
46046
+ rightFrozenGroup.role = 'right-frozen';
46047
+ scene.rightFrozenGroup = rightFrozenGroup;
46048
+ const bottomFrozenGroup = createContainerGroup(0, 0);
46049
+ bottomFrozenGroup.role = 'bottom-frozen';
46050
+ scene.bottomFrozenGroup = bottomFrozenGroup;
46051
+ const componentGroup = createContainerGroup(0, 0);
46052
+ componentGroup.role = 'component';
46053
+ scene.componentGroup = componentGroup;
46054
+ const rightTopCornerGroup = createContainerGroup(0, 0);
46055
+ rightTopCornerGroup.role = 'corner-right-top-header';
46056
+ scene.rightTopCornerGroup = rightTopCornerGroup;
46057
+ const rightBottomCornerGroup = createContainerGroup(0, 0);
46058
+ rightBottomCornerGroup.role = 'corner-right-bottom-header';
46059
+ scene.rightBottomCornerGroup = rightBottomCornerGroup;
46060
+ const leftBottomCornerGroup = createContainerGroup(0, 0);
46061
+ leftBottomCornerGroup.role = 'corner-left-bottom-header';
46062
+ scene.leftBottomCornerGroup = leftBottomCornerGroup;
46063
+ if (scene.table.isPivotChart()) {
46064
+ createCornerCell(rightTopCornerGroup, scene.table.theme.cornerRightTopCellStyle || scene.table.theme.cornerHeaderStyle);
46065
+ createCornerCell(leftBottomCornerGroup, scene.table.theme.cornerLeftBottomCellStyle || scene.table.theme.cornerHeaderStyle);
46066
+ createCornerCell(rightBottomCornerGroup, scene.table.theme.cornerRightBottomCellStyle || scene.table.theme.cornerHeaderStyle);
46067
+ }
46068
+ scene.tableGroup.addChild(bodyGroup);
46069
+ scene.tableGroup.addChild(rightFrozenGroup);
46070
+ scene.tableGroup.addChild(bottomFrozenGroup);
46071
+ scene.tableGroup.addChild(rowHeaderGroup);
46072
+ scene.tableGroup.addChild(colHeaderGroup);
46073
+ scene.tableGroup.addChild(rightBottomCornerGroup);
46074
+ scene.tableGroup.addChild(rightTopCornerGroup);
46075
+ scene.tableGroup.addChild(leftBottomCornerGroup);
46076
+ scene.tableGroup.addChild(cornerHeaderGroup);
46077
+ scene.tableGroup.addChild(componentGroup);
46078
+ }
46079
+ function createContainerGroup(width, height) {
46080
+ return new Group({
46081
+ x: 0,
46082
+ y: 0,
46083
+ width,
46084
+ height,
46085
+ clip: false,
46086
+ pickable: false
46087
+ });
45700
46088
  }
45701
46089
 
45702
46090
  container.load(splitModule);
@@ -45709,9 +46097,9 @@
45709
46097
  bodyGroup;
45710
46098
  rightFrozenGroup;
45711
46099
  bottomFrozenGroup;
45712
- rightTopCellGroup;
45713
- leftBottomCellGroup;
45714
- rightBottomCellGroup;
46100
+ rightTopCornerGroup;
46101
+ leftBottomCornerGroup;
46102
+ rightBottomCornerGroup;
45715
46103
  componentGroup;
45716
46104
  selectedRangeComponents;
45717
46105
  selectingRangeComponents;
@@ -45778,94 +46166,7 @@
45778
46166
  initSceneGraph() {
45779
46167
  this.isPivot = this.table.isPivotTable();
45780
46168
  this.transpose = this.table.options.transpose;
45781
- const width = this.table.tableNoFrameWidth;
45782
- const height = this.table.tableNoFrameHeight;
45783
- this.tableGroup = new Group({ x: 0, y: 0, width, height, clip: true, pickable: false });
45784
- this.tableGroup.role = 'table';
45785
- const colHeaderGroup = new Group({
45786
- x: 0,
45787
- y: 0,
45788
- width: 0,
45789
- height: 0,
45790
- clip: false,
45791
- pickable: false
45792
- });
45793
- colHeaderGroup.role = 'col-header';
45794
- this.colHeaderGroup = colHeaderGroup;
45795
- const cornerHeaderGroup = new Group({
45796
- x: 0,
45797
- y: 0,
45798
- width: 0,
45799
- height: 0,
45800
- clip: false,
45801
- pickable: false
45802
- });
45803
- cornerHeaderGroup.role = 'corner-header';
45804
- this.cornerHeaderGroup = cornerHeaderGroup;
45805
- const rowHeaderGroup = new Group({
45806
- x: 0,
45807
- y: 0,
45808
- width: 0,
45809
- height: 0,
45810
- clip: false,
45811
- pickable: false
45812
- });
45813
- rowHeaderGroup.role = 'row-header';
45814
- this.rowHeaderGroup = rowHeaderGroup;
45815
- const bodyGroup = new Group({
45816
- x: 0,
45817
- y: 0,
45818
- width,
45819
- height: 0,
45820
- clip: false,
45821
- pickable: false
45822
- });
45823
- bodyGroup.role = 'body';
45824
- this.bodyGroup = bodyGroup;
45825
- const rightFrozenGroup = new Group({
45826
- x: 0,
45827
- y: 0,
45828
- width,
45829
- height: 0,
45830
- clip: false,
45831
- pickable: false
45832
- });
45833
- rightFrozenGroup.role = 'right-frozen';
45834
- this.rightFrozenGroup = rightFrozenGroup;
45835
- const bottomFrozenGroup = new Group({
45836
- x: 0,
45837
- y: 0,
45838
- width,
45839
- height: 0,
45840
- clip: false,
45841
- pickable: false
45842
- });
45843
- bottomFrozenGroup.role = 'bottom-frozen';
45844
- this.bottomFrozenGroup = bottomFrozenGroup;
45845
- const componentGroup = new Group({
45846
- x: 0,
45847
- y: 0,
45848
- width: 0,
45849
- height: 0,
45850
- clip: false,
45851
- pickable: false,
45852
- childrenPickable: true
45853
- });
45854
- componentGroup.role = 'component';
45855
- this.componentGroup = componentGroup;
45856
- this.rightTopCellGroup = createCornerCell(this.table.theme.cornerRightTopCellStyle || this.table.theme.cornerHeaderStyle);
45857
- this.leftBottomCellGroup = createCornerCell(this.table.theme.cornerLeftBottomCellStyle || this.table.theme.cornerHeaderStyle);
45858
- this.rightBottomCellGroup = createCornerCell(this.table.theme.cornerRightBottomCellStyle || this.table.theme.cornerHeaderStyle);
45859
- this.tableGroup.addChild(bodyGroup);
45860
- this.tableGroup.addChild(rightFrozenGroup);
45861
- this.tableGroup.addChild(bottomFrozenGroup);
45862
- this.tableGroup.addChild(rowHeaderGroup);
45863
- this.tableGroup.addChild(colHeaderGroup);
45864
- this.tableGroup.addChild(this.rightBottomCellGroup);
45865
- this.tableGroup.addChild(this.rightTopCellGroup);
45866
- this.tableGroup.addChild(this.leftBottomCellGroup);
45867
- this.tableGroup.addChild(cornerHeaderGroup);
45868
- this.tableGroup.addChild(componentGroup);
46169
+ initSceneGraph(this);
45869
46170
  }
45870
46171
  clearCells() {
45871
46172
  this.clear = true;
@@ -45877,9 +46178,9 @@
45877
46178
  this.bodyGroup.clear();
45878
46179
  this.bottomFrozenGroup.clear();
45879
46180
  this.rightFrozenGroup.clear();
45880
- this.rightTopCellGroup.clear();
45881
- this.rightBottomCellGroup.clear();
45882
- this.leftBottomCellGroup.clear();
46181
+ this.rightTopCornerGroup.clear();
46182
+ this.rightBottomCornerGroup.clear();
46183
+ this.leftBottomCornerGroup.clear();
45883
46184
  this.colHeaderGroup.setAttributes({
45884
46185
  x: 0,
45885
46186
  y: 0,
@@ -45916,21 +46217,21 @@
45916
46217
  width: 0,
45917
46218
  height: 0
45918
46219
  });
45919
- this.rightTopCellGroup.setAttributes({
46220
+ this.rightTopCornerGroup.setAttributes({
45920
46221
  x: 0,
45921
46222
  y: 0,
45922
46223
  width: 0,
45923
46224
  height: 0,
45924
46225
  visible: false
45925
46226
  });
45926
- this.leftBottomCellGroup.setAttributes({
46227
+ this.leftBottomCornerGroup.setAttributes({
45927
46228
  x: 0,
45928
46229
  y: 0,
45929
46230
  width: 0,
45930
46231
  height: 0,
45931
46232
  visible: false
45932
46233
  });
45933
- this.rightTopCellGroup.setAttributes({
46234
+ this.rightBottomCornerGroup.setAttributes({
45934
46235
  x: 0,
45935
46236
  y: 0,
45936
46237
  width: 0,
@@ -46008,7 +46309,23 @@
46008
46309
  }
46009
46310
  getCell(col, row, getShadow) {
46010
46311
  let cell;
46011
- if (this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount) {
46312
+ if (this.table.rightFrozenColCount > 0 &&
46313
+ col >= this.table.colCount - this.table.rightFrozenColCount &&
46314
+ row < this.table.frozenRowCount) {
46315
+ cell = this.rightBottomCornerGroup.getColGroup(col)?.getRowGroup(row);
46316
+ }
46317
+ else if (this.table.bottomFrozenRowCount > 0 &&
46318
+ row >= this.table.rowCount - this.table.bottomFrozenRowCount &&
46319
+ col < this.table.frozenColCount) {
46320
+ cell = this.leftBottomCornerGroup.getColGroup(col)?.getRowGroup(row);
46321
+ }
46322
+ else if (this.table.rightFrozenColCount > 0 &&
46323
+ this.table.bottomFrozenRowCount > 0 &&
46324
+ col >= this.table.colCount - this.table.rightFrozenColCount &&
46325
+ row >= this.table.rowCount - this.table.bottomFrozenRowCount) {
46326
+ cell = this.rightBottomCornerGroup.getColGroup(col)?.getRowGroup(row);
46327
+ }
46328
+ else if (this.table.rightFrozenColCount > 0 && col > this.table.colCount - 1 - this.table.rightFrozenColCount) {
46012
46329
  cell = this.rightFrozenGroup.getColGroup(col)?.getRowGroup(row);
46013
46330
  }
46014
46331
  else if (this.table.bottomFrozenRowCount > 0 && row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount) {
@@ -46056,6 +46373,24 @@
46056
46373
  }
46057
46374
  return undefined;
46058
46375
  }
46376
+ getColGroupInLeftBottomCorner(col) {
46377
+ if (this.table.bottomFrozenRowCount > 0) {
46378
+ return this.leftBottomCornerGroup.getColGroup(col);
46379
+ }
46380
+ return undefined;
46381
+ }
46382
+ getColGroupInRightTopCorner(col) {
46383
+ if (this.table.rightFrozenColCount > 0) {
46384
+ return this.rightTopCornerGroup.getColGroup(col);
46385
+ }
46386
+ return undefined;
46387
+ }
46388
+ getColGroupInRightBottomCorner(col) {
46389
+ if (this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0) {
46390
+ return this.rightBottomCornerGroup.getColGroup(col);
46391
+ }
46392
+ return undefined;
46393
+ }
46059
46394
  getCellSize(col, row) {
46060
46395
  const cell = this.getCell(col, row);
46061
46396
  const mergeInfo = getCellMergeInfo(this.table, col, row);
@@ -46251,7 +46586,7 @@
46251
46586
  this.tableGroup.setAttributes({
46252
46587
  width: Math.min(this.table.tableNoFrameWidth, Math.max(this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.width, 0) +
46253
46588
  Math.max(this.cornerHeaderGroup.attribute.width, this.rowHeaderGroup.attribute.width, 0) +
46254
- this.rightBottomCellGroup.attribute.width),
46589
+ this.rightBottomCornerGroup.attribute.width),
46255
46590
  height: Math.min(this.table.tableNoFrameHeight, (this.colHeaderGroup.attribute.height ?? 0) +
46256
46591
  (this.bodyGroup.attribute.height ?? 0) +
46257
46592
  this.bottomFrozenGroup.attribute.height)
@@ -46264,13 +46599,13 @@
46264
46599
  }
46265
46600
  if (this.table.bottomFrozenRowCount > 0) {
46266
46601
  this.bottomFrozenGroup.setAttribute('y', this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height);
46267
- this.leftBottomCellGroup.setAttributes({
46602
+ this.leftBottomCornerGroup.setAttributes({
46268
46603
  visible: true,
46269
46604
  y: this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height,
46270
46605
  height: this.bottomFrozenGroup.attribute.height,
46271
46606
  width: this.table.getFrozenColsWidth()
46272
46607
  });
46273
- this.rightBottomCellGroup.setAttributes({
46608
+ this.rightBottomCornerGroup.setAttributes({
46274
46609
  visible: true,
46275
46610
  y: this.tableGroup.attribute.height - this.bottomFrozenGroup.attribute.height,
46276
46611
  height: this.bottomFrozenGroup.attribute.height
@@ -46278,13 +46613,13 @@
46278
46613
  }
46279
46614
  if (this.table.rightFrozenColCount > 0) {
46280
46615
  this.rightFrozenGroup.setAttribute('x', this.tableGroup.attribute.width - this.rightFrozenGroup.attribute.width);
46281
- this.rightTopCellGroup.setAttributes({
46616
+ this.rightTopCornerGroup.setAttributes({
46282
46617
  visible: true,
46283
46618
  x: this.tableGroup.attribute.width - this.rightFrozenGroup.attribute.width,
46284
46619
  width: this.rightFrozenGroup.attribute.width,
46285
46620
  height: this.table.getFrozenRowsHeight()
46286
46621
  });
46287
- this.rightBottomCellGroup.setAttributes({
46622
+ this.rightBottomCornerGroup.setAttributes({
46288
46623
  visible: true,
46289
46624
  x: this.tableGroup.attribute.width - this.rightFrozenGroup.attribute.width,
46290
46625
  width: this.rightFrozenGroup.attribute.width
@@ -46311,12 +46646,17 @@
46311
46646
  this.updateNextFrame();
46312
46647
  }
46313
46648
  updateContainerHeight(row, detaY) {
46314
- if (row < this.frozenRowCount) {
46649
+ if (row < this.table.frozenRowCount) {
46315
46650
  this.colHeaderGroup.setDeltaHeight(detaY);
46316
46651
  this.cornerHeaderGroup.setDeltaHeight(detaY);
46317
46652
  this.rowHeaderGroup.setDeltaY(detaY);
46318
46653
  this.bodyGroup.setDeltaY(detaY);
46319
46654
  }
46655
+ else if (row >= this.table.rowCount - this.table.bottomFrozenRowCount) {
46656
+ this.leftBottomCornerGroup.setDeltaHeight(detaY);
46657
+ this.bottomFrozenGroup.setDeltaHeight(detaY);
46658
+ this.rightBottomCornerGroup.setDeltaHeight(detaY);
46659
+ }
46320
46660
  else {
46321
46661
  this.rowHeaderGroup.setDeltaHeight(detaY);
46322
46662
  this.bodyGroup.setDeltaHeight(detaY);
@@ -46597,6 +46937,20 @@
46597
46937
  this.dealFrozen();
46598
46938
  this.component.updateScrollBar();
46599
46939
  }
46940
+ dealWidthRightFrozen(rightFrozenColCount) {
46941
+ if (this.clear) {
46942
+ this.table.internalProps.rightFrozenColCount = rightFrozenColCount;
46943
+ return;
46944
+ }
46945
+ dealRightFrozen(rightFrozenColCount, this);
46946
+ }
46947
+ dealWidthBottomFrozen(bottomFrozenRowCount) {
46948
+ if (this.clear) {
46949
+ this.table.internalProps.bottomFrozenRowCount = bottomFrozenRowCount;
46950
+ return;
46951
+ }
46952
+ dealBottomFrozen(bottomFrozenRowCount, this);
46953
+ }
46600
46954
  updateBorderSizeAndPosition() {
46601
46955
  if (this.bodyGroup.border) {
46602
46956
  this.bodyGroup.appendChild(this.bodyGroup.border);
@@ -46901,7 +47255,7 @@
46901
47255
  if (col === -1 || row === -1) {
46902
47256
  cellPos.col = -1;
46903
47257
  cellPos.row = -1;
46904
- if (updateScenegraph) {
47258
+ if (updateScenegraph && (prevHoverCellCol !== col || prevHoverCellRow !== row)) {
46905
47259
  state.table.scenegraph.updateNextFrame();
46906
47260
  }
46907
47261
  return;
@@ -48242,6 +48596,23 @@
48242
48596
  function drillClick(table) {
48243
48597
  table.fireListeners(PIVOT_TABLE_EVENT_TYPE.DRILLMENU_CLICK, table.stateManeger.drill);
48244
48598
  }
48599
+ function checkHaveDrill(table) {
48600
+ const rowsDefine = table.internalProps.layoutMap.rowsDefine;
48601
+ const columnsDefine = table.internalProps.layoutMap.columnsDefine;
48602
+ for (let i = 0; i < rowsDefine.length; i++) {
48603
+ const row = rowsDefine[i];
48604
+ if (typeof row !== 'string' && (row.drillDown || row.drillUp)) {
48605
+ return true;
48606
+ }
48607
+ }
48608
+ for (let i = 0; i < columnsDefine.length; i++) {
48609
+ const column = columnsDefine[i];
48610
+ if (typeof column !== 'string' && (column.drillDown || column.drillUp)) {
48611
+ return true;
48612
+ }
48613
+ }
48614
+ return false;
48615
+ }
48245
48616
 
48246
48617
  function bindSparklineHoverEvent(table) {
48247
48618
  let hasSparkLine = false;
@@ -49026,6 +49397,9 @@
49026
49397
  return;
49027
49398
  }
49028
49399
  table.scenegraph.tableGroup.addEventListener('click', (e) => {
49400
+ if (table.stateManeger.columnMove.moving || table.stateManeger.columnResize.resizing) {
49401
+ return;
49402
+ }
49029
49403
  if (e.target.name === 'axis-label') {
49030
49404
  const eventArgsSet = getCellEventArgsSet(e);
49031
49405
  const { col, row } = eventArgsSet.eventArgs;
@@ -49058,7 +49432,7 @@
49058
49432
  clearChartCacheImage(table.scenegraph);
49059
49433
  table.scenegraph.updateNextFrame();
49060
49434
  }
49061
- else if (table._selectedDimensionInChart) {
49435
+ else if (table._selectedDimensionInChart?.length) {
49062
49436
  table._selectedDimensionInChart.length = 0;
49063
49437
  const layout = table.internalProps.layoutMap;
49064
49438
  layout.updateDataStateToChartInstance();
@@ -49201,7 +49575,7 @@
49201
49575
  }
49202
49576
  }
49203
49577
  });
49204
- if (this.table.isPivotTable()) {
49578
+ if (this.table.isPivotTable() && checkHaveDrill(this.table)) {
49205
49579
  bindDrillEvent(this.table);
49206
49580
  }
49207
49581
  bindSparklineHoverEvent(this.table);
@@ -51772,19 +52146,19 @@
51772
52146
  if (this.legendComponent) {
51773
52147
  this.legendComponent.addEventListener(LegendEvent.legendItemClick, (e) => {
51774
52148
  const selectedData = get$4(e, 'detail.currentSelected');
51775
- this.table.scenegraph.updateNextFrame();
51776
52149
  this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_CLICK, { model: this, value: selectedData, event: e });
51777
52150
  });
51778
52151
  this.legendComponent.addEventListener(LegendEvent.legendItemHover, (e) => {
51779
52152
  const detail = get$4(e, 'detail');
51780
- this.table.scenegraph.updateNextFrame();
51781
52153
  this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_HOVER, { model: this, value: detail, event: e });
51782
52154
  });
51783
52155
  this.legendComponent.addEventListener(LegendEvent.legendItemUnHover, (e) => {
51784
52156
  const detail = get$4(e, 'detail');
51785
- this.table.scenegraph.updateNextFrame();
51786
52157
  this.table.fireListeners(TABLE_EVENT_TYPE.LEGEND_ITEM_UNHOVER, { model: this, value: detail, event: e });
51787
52158
  });
52159
+ this.legendComponent.addEventListener('legendItemAttributeUpdate', (e) => {
52160
+ this.table.scenegraph.updateNextFrame();
52161
+ });
51788
52162
  }
51789
52163
  }
51790
52164
  getLegendBounds() {
@@ -51959,13 +52333,11 @@
51959
52333
  stateManeger;
51960
52334
  eventManeger;
51961
52335
  _pixelRatio;
51962
- bottomFrozenRowCount = 0;
51963
- rightFrozenColCount = 0;
51964
52336
  static get EVENT_TYPE() {
51965
52337
  return TABLE_EVENT_TYPE;
51966
52338
  }
51967
52339
  options;
51968
- version = "0.9.3-alpha.7";
52340
+ version = "0.10.0";
51969
52341
  pagerConf;
51970
52342
  id = `VTable${Date.now()}`;
51971
52343
  headerStyleCache;
@@ -51976,7 +52348,7 @@
51976
52348
  if (!container) {
51977
52349
  throw new Error("vtable's container is undefined");
51978
52350
  }
51979
- const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, keyboardOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio } = options;
52351
+ const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, keyboardOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount } = options;
51980
52352
  this.container = container;
51981
52353
  this.options = options;
51982
52354
  this.options.container = container;
@@ -52021,6 +52393,8 @@
52021
52393
  internalProps.keyboardOptions = keyboardOptions;
52022
52394
  internalProps.columnResizeMode = columnResizeMode;
52023
52395
  internalProps.dragHeaderMode = dragHeaderMode;
52396
+ internalProps.renderChartAsync = renderChartAsync;
52397
+ setBatchRenderChartCount(renderChartAsyncBatchCount);
52024
52398
  internalProps._rowHeightsMap = new NumberMap();
52025
52399
  internalProps._rowRangeHeightsMap = new Map();
52026
52400
  internalProps._colRangeWidthsMap = new Map();
@@ -52169,6 +52543,18 @@
52169
52543
  set frozenRowCount(frozenRowCount) {
52170
52544
  this.internalProps.frozenRowCount = frozenRowCount;
52171
52545
  }
52546
+ get rightFrozenColCount() {
52547
+ return this.internalProps.rightFrozenColCount ?? 0;
52548
+ }
52549
+ set rightFrozenColCount(rightFrozenColCount) {
52550
+ this.scenegraph.dealWidthRightFrozen(rightFrozenColCount);
52551
+ }
52552
+ get bottomFrozenRowCount() {
52553
+ return this.internalProps.bottomFrozenRowCount ?? 0;
52554
+ }
52555
+ set bottomFrozenRowCount(bottomFrozenRowCount) {
52556
+ this.scenegraph.dealWidthBottomFrozen(bottomFrozenRowCount);
52557
+ }
52172
52558
  get defaultRowHeight() {
52173
52559
  return this.internalProps.defaultRowHeight;
52174
52560
  }
@@ -52902,7 +53288,7 @@
52902
53288
  }
52903
53289
  updateOption(options) {
52904
53290
  this.options = options;
52905
- const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, customRender } = options;
53291
+ const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, customRender, renderChartAsync, renderChartAsyncBatchCount } = options;
52906
53292
  if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
52907
53293
  this.internalProps.pixelRatio = pixelRatio;
52908
53294
  }
@@ -52940,6 +53326,8 @@
52940
53326
  internalProps.keyboardOptions = keyboardOptions;
52941
53327
  internalProps.columnResizeMode = columnResizeMode;
52942
53328
  internalProps.dragHeaderMode = dragHeaderMode;
53329
+ internalProps.renderChartAsync = renderChartAsync;
53330
+ setBatchRenderChartCount(renderChartAsyncBatchCount);
52943
53331
  internalProps.cellTextOverflows = {};
52944
53332
  internalProps._rowHeightsMap = new NumberMap();
52945
53333
  internalProps._rowRangeHeightsMap = new Map();
@@ -53521,7 +53909,9 @@
53521
53909
  dataValue: this.getCellOriginValue(col, row),
53522
53910
  cellHeaderPaths: this.getCellHeaderPaths(col, row)
53523
53911
  }, styleClass, this.options.autoWrapText);
53524
- this.bodyStyleCache.set(cacheKey, cacheStyle);
53912
+ if (!isFunction(style)) {
53913
+ this.bodyStyleCache.set(cacheKey, cacheStyle);
53914
+ }
53525
53915
  return cacheStyle;
53526
53916
  }
53527
53917
  clearCellStyleCache() {
@@ -54104,7 +54494,9 @@
54104
54494
  if (isArray$3(rowDimensionKey)) {
54105
54495
  rowDimensionKey = rowDimensionKey[0];
54106
54496
  }
54107
- const data = layout.dataset.cacheCollectedValues[rowDimensionKey] || layout.dataset.collectedValues[rowDimensionKey];
54497
+ const data = layout.dataset.cacheCollectedValues[rowDimensionKey] ||
54498
+ layout.dataset.collectedValues[rowDimensionKey] ||
54499
+ [];
54108
54500
  const recordRow = layout.getRecordIndexByRow(row);
54109
54501
  const rowPath = layout.getRowKeysPath()[recordRow];
54110
54502
  const domain = data[rowPath[rowPath.length - 1]];
@@ -54155,7 +54547,9 @@
54155
54547
  if (isArray$3(columnDimensionKey)) {
54156
54548
  columnDimensionKey = columnDimensionKey[0];
54157
54549
  }
54158
- const data = layout.dataset.cacheCollectedValues[columnDimensionKey] || layout.dataset.collectedValues[columnDimensionKey];
54550
+ const data = layout.dataset.cacheCollectedValues[columnDimensionKey] ||
54551
+ layout.dataset.collectedValues[columnDimensionKey] ||
54552
+ [];
54159
54553
  const recordCol = layout.getRecordIndexByCol(col);
54160
54554
  const colPath = layout.getColKeysPath()[recordCol];
54161
54555
  const domain = data?.[colPath[colPath.length - 1]] ?? [];
@@ -55056,6 +55450,7 @@
55056
55450
  (table.internalProps.dataSource?.length ?? 0) * layoutMap.bodyRowCount + layoutMap.headerLevelCount;
55057
55451
  table.frozenRowCount = 0;
55058
55452
  table.frozenColCount = layoutMap.headerLevelCount;
55453
+ table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
55059
55454
  }
55060
55455
  else {
55061
55456
  table.colCount = layoutMap.colCount ?? 0;
@@ -55063,6 +55458,8 @@
55063
55458
  (table.internalProps.dataSource?.length ?? 0) * layoutMap.bodyRowCount + layoutMap.headerLevelCount;
55064
55459
  table.frozenColCount = table.options.frozenColCount ?? 0;
55065
55460
  table.frozenRowCount = layoutMap.headerLevelCount;
55461
+ table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
55462
+ table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
55066
55463
  }
55067
55464
  }
55068
55465
  getFieldData(field, col, row) {
@@ -57874,7 +58271,7 @@
57874
58271
  });
57875
58272
  return !!match;
57876
58273
  }
57877
- else if (this._table._selectedDimensionInChart.length) {
58274
+ else if (this._table._selectedDimensionInChart?.length) {
57878
58275
  const match = this._table._selectedDimensionInChart.every(item => {
57879
58276
  if (datum[item.key] !== item.value) {
57880
58277
  return false;
@@ -57899,7 +58296,7 @@
57899
58296
  });
57900
58297
  return !match;
57901
58298
  }
57902
- else if (this._table._selectedDimensionInChart.length) {
58299
+ else if (this._table._selectedDimensionInChart?.length) {
57903
58300
  const match = this._table._selectedDimensionInChart.every(item => {
57904
58301
  if (datum[item.key] !== item.value) {
57905
58302
  return false;
@@ -59632,8 +60029,8 @@
59632
60029
  table.rowCount = layoutMap.rowCount ?? 0;
59633
60030
  table.frozenColCount = layoutMap.rowHeaderLevelCount;
59634
60031
  table.frozenRowCount = layoutMap.headerLevelCount;
59635
- table.bottomFrozenRowCount = layoutMap?.bottomFrozenRowCount ?? 0;
59636
- table.rightFrozenColCount = layoutMap?.rightFrozenColCount ?? 0;
60032
+ table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
60033
+ table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
59637
60034
  }
59638
60035
  _getSortFuncFromHeaderOption(columns, field, fieldKey) {
59639
60036
  return undefined;
@@ -61168,7 +61565,7 @@
61168
61565
  percentCalc: percentCalc
61169
61566
  });
61170
61567
 
61171
- const version = "0.9.3-alpha.7";
61568
+ const version = "0.10.0";
61172
61569
  function getIcons() {
61173
61570
  return get$1();
61174
61571
  }