@visactor/vtable 1.3.2-alpha.0 → 1.3.2-alpha.2

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 (107) hide show
  1. package/cjs/PivotChart.d.ts +1 -0
  2. package/cjs/PivotChart.js +4 -0
  3. package/cjs/PivotChart.js.map +1 -1
  4. package/cjs/components/axis/axis.js +3 -2
  5. package/cjs/components/axis/axis.js.map +1 -1
  6. package/cjs/components/empty-tip/empty-tip.js +2 -2
  7. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  8. package/cjs/components/legend/discrete-legend/discrete-legend.js +2 -1
  9. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  10. package/cjs/core/BaseTable.d.ts +4 -2
  11. package/cjs/core/BaseTable.js +54 -170
  12. package/cjs/core/BaseTable.js.map +1 -1
  13. package/cjs/core/FouseInput.d.ts +1 -0
  14. package/cjs/core/FouseInput.js +5 -2
  15. package/cjs/core/FouseInput.js.map +1 -1
  16. package/cjs/core/utils/get-cell-position.d.ts +42 -0
  17. package/cjs/core/utils/get-cell-position.js +206 -0
  18. package/cjs/core/utils/get-cell-position.js.map +1 -0
  19. package/cjs/dataset/dataset.d.ts +0 -2
  20. package/cjs/dataset/dataset.js +7 -8
  21. package/cjs/dataset/dataset.js.map +1 -1
  22. package/cjs/event/event.js +2 -1
  23. package/cjs/event/event.js.map +1 -1
  24. package/cjs/event/listener/container-dom.js +1 -1
  25. package/cjs/event/listener/container-dom.js.map +1 -1
  26. package/cjs/event/util.js +2 -2
  27. package/cjs/event/util.js.map +1 -1
  28. package/cjs/index.d.ts +1 -1
  29. package/cjs/index.js +1 -1
  30. package/cjs/index.js.map +1 -1
  31. package/cjs/layout/pivot-header-layout.js +37 -57
  32. package/cjs/layout/pivot-header-layout.js.map +1 -1
  33. package/cjs/scenegraph/debug-tool/debug-tool.js +4 -1
  34. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  35. package/cjs/scenegraph/graphic/chart.d.ts +1 -0
  36. package/cjs/scenegraph/graphic/chart.js +34 -20
  37. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  38. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +20 -8
  39. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  40. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  41. package/cjs/scenegraph/graphic/contributions/chart-render.js +40 -24
  42. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  43. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  44. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  45. package/cjs/scenegraph/refresh-node/update-chart.d.ts +1 -0
  46. package/cjs/scenegraph/refresh-node/update-chart.js +9 -2
  47. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  48. package/cjs/scenegraph/scenegraph.js +10 -4
  49. package/cjs/scenegraph/scenegraph.js.map +1 -1
  50. package/cjs/ts-types/base-table.d.ts +14 -1
  51. package/cjs/ts-types/base-table.js.map +1 -1
  52. package/cjs/vrender.js.map +1 -1
  53. package/dist/vtable.js +511 -443
  54. package/dist/vtable.min.js +2 -2
  55. package/es/PivotChart.d.ts +1 -0
  56. package/es/PivotChart.js +5 -2
  57. package/es/PivotChart.js.map +1 -1
  58. package/es/components/axis/axis.js +3 -1
  59. package/es/components/axis/axis.js.map +1 -1
  60. package/es/components/empty-tip/empty-tip.js +2 -2
  61. package/es/components/empty-tip/empty-tip.js.map +1 -1
  62. package/es/components/legend/discrete-legend/discrete-legend.js +2 -1
  63. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  64. package/es/core/BaseTable.d.ts +4 -2
  65. package/es/core/BaseTable.js +55 -169
  66. package/es/core/BaseTable.js.map +1 -1
  67. package/es/core/FouseInput.d.ts +1 -0
  68. package/es/core/FouseInput.js +5 -2
  69. package/es/core/FouseInput.js.map +1 -1
  70. package/es/core/utils/get-cell-position.d.ts +42 -0
  71. package/es/core/utils/get-cell-position.js +194 -0
  72. package/es/core/utils/get-cell-position.js.map +1 -0
  73. package/es/dataset/dataset.d.ts +0 -2
  74. package/es/dataset/dataset.js +7 -8
  75. package/es/dataset/dataset.js.map +1 -1
  76. package/es/event/event.js +2 -1
  77. package/es/event/event.js.map +1 -1
  78. package/es/event/listener/container-dom.js +1 -1
  79. package/es/event/listener/container-dom.js.map +1 -1
  80. package/es/event/util.js +2 -2
  81. package/es/event/util.js.map +1 -1
  82. package/es/index.d.ts +1 -1
  83. package/es/index.js +1 -1
  84. package/es/index.js.map +1 -1
  85. package/es/layout/pivot-header-layout.js +36 -56
  86. package/es/layout/pivot-header-layout.js.map +1 -1
  87. package/es/scenegraph/debug-tool/debug-tool.js +4 -1
  88. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  89. package/es/scenegraph/graphic/chart.d.ts +1 -0
  90. package/es/scenegraph/graphic/chart.js +33 -21
  91. package/es/scenegraph/graphic/chart.js.map +1 -1
  92. package/es/scenegraph/graphic/contributions/chart-render-helper.js +20 -8
  93. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  94. package/es/scenegraph/graphic/contributions/chart-render.d.ts +2 -1
  95. package/es/scenegraph/graphic/contributions/chart-render.js +41 -25
  96. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  97. package/es/scenegraph/group-creater/cell-type/chart-cell.js +2 -1
  98. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  99. package/es/scenegraph/refresh-node/update-chart.d.ts +1 -0
  100. package/es/scenegraph/refresh-node/update-chart.js +6 -0
  101. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  102. package/es/scenegraph/scenegraph.js +10 -4
  103. package/es/scenegraph/scenegraph.js.map +1 -1
  104. package/es/ts-types/base-table.d.ts +14 -1
  105. package/es/ts-types/base-table.js.map +1 -1
  106. package/es/vrender.js.map +1 -1
  107. package/package.json +2 -2
package/dist/vtable.js CHANGED
@@ -32684,7 +32684,9 @@
32684
32684
  const axisStylrAttrs = getAxisAttributes(this.option);
32685
32685
  const attrs = this.getUpdateAttribute();
32686
32686
  attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
32687
- this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));
32687
+ this.component = new LineAxis(merge({
32688
+ disableTriggerEvent: this.table.options.disableInteraction
32689
+ }, axisStylrAttrs, attrs));
32688
32690
  this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
32689
32691
  this.component.originAxis = this;
32690
32692
  }
@@ -35274,8 +35276,8 @@
35274
35276
  function getCellEventArgsSet(e) {
35275
35277
  const tableEvent = {
35276
35278
  abstractPos: {
35277
- x: e.x,
35278
- y: e.y
35279
+ x: e.viewport.x,
35280
+ y: e.viewport.y
35279
35281
  }
35280
35282
  };
35281
35283
  const targetCell = getTargetCell(e.target);
@@ -37413,7 +37415,7 @@
37413
37415
  this.numberType = CHART_NUMBER_TYPE;
37414
37416
  this.isShareChartSpec = isShareChartSpec;
37415
37417
  if (!params.chartInstance) {
37416
- const chartInstance = new params.ClassType(params.spec, {
37418
+ const chartInstance = (this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
37417
37419
  renderCanvas: params.canvas,
37418
37420
  mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
37419
37421
  modeParams: this.attribute.modeParams,
@@ -37423,8 +37425,9 @@
37423
37425
  interactive: false,
37424
37426
  animation: false,
37425
37427
  autoFit: false
37426
- });
37428
+ })));
37427
37429
  chartInstance.renderSync();
37430
+ chartInstance.getStage().enableDirtyBounds();
37428
37431
  params.chartInstance = this.chartInstance = chartInstance;
37429
37432
  }
37430
37433
  else {
@@ -37442,34 +37445,53 @@
37442
37445
  y1: y1 - table.scrollTop,
37443
37446
  y2: y2 - table.scrollTop
37444
37447
  });
37445
- this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
37448
+ this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
37446
37449
  renderCanvas: this.attribute.canvas,
37447
37450
  mode: 'desktop-browser',
37448
37451
  canvasControled: false,
37449
37452
  viewBox: {
37450
- x1: x1 - table.scrollLeft,
37451
- x2: x2 - table.scrollLeft,
37452
- y1: y1 - table.scrollTop,
37453
- y2: y2 - table.scrollTop
37453
+ x1: 0,
37454
+ x2: x2 - x1,
37455
+ y1: 0,
37456
+ y2: y2 - y1
37454
37457
  },
37455
37458
  dpr: table.internalProps.pixelRatio,
37456
37459
  animation: false,
37457
37460
  interactive: true,
37458
37461
  autoFit: false,
37459
- beforeRender: (stage) => {
37460
- const ctx = stage.window.getContext();
37462
+ beforeRender: (chartStage) => {
37463
+ const stage = this.stage;
37464
+ const ctx = chartStage.window.getContext();
37465
+ const stageMatrix = stage.window.getViewBoxTransform();
37466
+ const viewBox = stage.window.getViewBox();
37461
37467
  ctx.inuse = true;
37462
37468
  ctx.clearMatrix();
37469
+ ctx.setTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f, true);
37470
+ ctx.translate(viewBox.x1, viewBox.y1);
37463
37471
  ctx.setTransformForCurrent(true);
37464
37472
  ctx.beginPath();
37465
37473
  ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
37466
37474
  ctx.clip();
37475
+ ctx.clearMatrix();
37476
+ if (!chartStage.needRender) {
37477
+ chartStage.pauseRender();
37478
+ table.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds);
37479
+ table.scenegraph.updateNextFrame();
37480
+ }
37467
37481
  },
37468
37482
  afterRender(stage) {
37469
37483
  const ctx = stage.window.getContext();
37470
37484
  ctx.inuse = false;
37485
+ stage.needRender = false;
37486
+ chartStage.resumeRender();
37471
37487
  }
37472
- });
37488
+ }));
37489
+ const chartStage = this.activeChartInstance.getStage();
37490
+ const matrix = this.globalTransMatrix.clone();
37491
+ const stageMatrix = this.stage.window.getViewBoxTransform();
37492
+ matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
37493
+ chartStage.window.setViewBoxTransform &&
37494
+ chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
37473
37495
  this.activeChartInstance.renderSync();
37474
37496
  table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
37475
37497
  this.activeChartInstance.on('click', (params) => {
@@ -37505,11 +37527,12 @@
37505
37527
  const cellGroup = this.parent;
37506
37528
  const padding = this.attribute.cellPadding;
37507
37529
  const table = this.stage.table;
37530
+ const { x1, y1, x2, y2 } = cellGroup.globalAABBBounds;
37508
37531
  return {
37509
- x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
37510
- x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
37511
- y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
37512
- y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
37532
+ x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
37533
+ x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
37534
+ y1: Math.ceil(y1 + padding[0] + table.scrollTop + (table.options.viewBox?.y1 ?? 0)),
37535
+ y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (table.options.viewBox?.y1 ?? 0))
37513
37536
  };
37514
37537
  }
37515
37538
  }
@@ -37540,6 +37563,10 @@
37540
37563
  bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
37541
37564
  bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
37542
37565
  }
37566
+ bodyBound.x1 = bodyBound.x1 + (table.options.viewBox?.x1 ?? 0);
37567
+ bodyBound.x2 = bodyBound.x2 + (table.options.viewBox?.x1 ?? 0);
37568
+ bodyBound.y1 = bodyBound.y1 + (table.options.viewBox?.y1 ?? 0);
37569
+ bodyBound.y2 = bodyBound.y2 + (table.options.viewBox?.y1 ?? 0);
37543
37570
  return bodyBound;
37544
37571
  }
37545
37572
 
@@ -37621,7 +37648,8 @@
37621
37648
  data: table.getCellValue(col, row),
37622
37649
  cellPadding: padding,
37623
37650
  dpr: table.internalProps.pixelRatio,
37624
- axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
37651
+ axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],
37652
+ tableChartOption: table.options.chartOption
37625
37653
  });
37626
37654
  cellGroup.appendChild(chartGroup);
37627
37655
  table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
@@ -43262,48 +43290,65 @@
43262
43290
  if (viewBox.y2 <= viewBox.y1) {
43263
43291
  viewBox.y2 = viewBox.y1 + 1;
43264
43292
  }
43265
- axes?.forEach((axis, index) => {
43266
- if (axis.type === 'band') {
43267
- chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
43268
- }
43269
- else {
43270
- chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
43271
- }
43272
- });
43273
43293
  chartInstance.updateViewBox({
43274
- x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
43275
- x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
43276
- y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
43277
- y2: viewBox.y2 - chart.getRootNode().table.scrollTop
43294
+ x1: 0,
43295
+ x2: viewBox.x2 - viewBox.x1,
43296
+ y1: 0,
43297
+ y2: viewBox.y2 - viewBox.y1
43278
43298
  }, false, false);
43279
- const table = chart.getRootNode().table;
43280
- table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
43281
- if (typeof dataId === 'string') {
43282
- chartInstance.updateDataSync(dataId, data ?? []);
43283
- }
43284
- else {
43285
- const dataBatch = [];
43286
- for (const dataIdStr in dataId) {
43287
- const dataIdAndField = dataId[dataIdStr];
43288
- const series = spec.series.find((item) => item?.data?.id === dataIdStr);
43289
- dataBatch.push({
43290
- id: dataIdStr,
43291
- values: dataIdAndField
43292
- ? data?.filter((item) => {
43293
- return item.hasOwnProperty(dataIdAndField);
43294
- }) ?? []
43295
- : data ?? [],
43296
- fields: series?.data?.fields
43297
- });
43298
- if (!chartInstance.updateFullDataSync) {
43299
- chartInstance.updateDataSync(dataIdStr, dataIdAndField
43300
- ? data?.filter((item) => {
43301
- return item.hasOwnProperty(dataIdAndField);
43302
- }) ?? []
43303
- : data ?? []);
43299
+ const chartStage = chartInstance.getStage();
43300
+ const matrix = chart.globalTransMatrix.clone();
43301
+ const stageMatrix = chart.stage.window.getViewBoxTransform();
43302
+ matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
43303
+ chartStage.window.setViewBoxTransform &&
43304
+ chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
43305
+ const { table } = chart.getRootNode();
43306
+ let updateSpec = false;
43307
+ if (table.options.specFormat) {
43308
+ const formatResult = table.options.specFormat(chart.attribute.spec);
43309
+ if (formatResult.needFormatSpec && formatResult.spec) {
43310
+ const spec = formatResult.spec;
43311
+ chartInstance.updateSpecSync(spec);
43312
+ updateSpec = true;
43313
+ }
43314
+ }
43315
+ if (!updateSpec) {
43316
+ axes?.forEach((axis, index) => {
43317
+ if (axis.type === 'band') {
43318
+ chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
43319
+ }
43320
+ else {
43321
+ chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
43322
+ }
43323
+ });
43324
+ table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
43325
+ if (typeof dataId === 'string') {
43326
+ chartInstance.updateDataSync(dataId, data ?? []);
43327
+ }
43328
+ else {
43329
+ const dataBatch = [];
43330
+ for (const dataIdStr in dataId) {
43331
+ const dataIdAndField = dataId[dataIdStr];
43332
+ const series = spec.series.find((item) => item?.data?.id === dataIdStr);
43333
+ dataBatch.push({
43334
+ id: dataIdStr,
43335
+ values: dataIdAndField
43336
+ ? data?.filter((item) => {
43337
+ return item.hasOwnProperty(dataIdAndField);
43338
+ }) ?? []
43339
+ : data ?? [],
43340
+ fields: series?.data?.fields
43341
+ });
43342
+ if (!chartInstance.updateFullDataSync) {
43343
+ chartInstance.updateDataSync(dataIdStr, dataIdAndField
43344
+ ? data?.filter((item) => {
43345
+ return item.hasOwnProperty(dataIdAndField);
43346
+ }) ?? []
43347
+ : data ?? []);
43348
+ }
43304
43349
  }
43350
+ chartInstance.updateFullDataSync?.(dataBatch);
43305
43351
  }
43306
- chartInstance.updateFullDataSync?.(dataBatch);
43307
43352
  }
43308
43353
  const sg = chartInstance.getStage();
43309
43354
  cacheStageCanvas(sg, chart);
@@ -43365,7 +43410,7 @@
43365
43410
  }
43366
43411
 
43367
43412
  const ChartRender = Symbol.for('ChartRender');
43368
- let DefaultCanvasChartRender = class DefaultCanvasChartRender {
43413
+ let DefaultCanvasChartRender = class DefaultCanvasChartRender extends BaseRender {
43369
43414
  type;
43370
43415
  numberType = CHART_NUMBER_TYPE;
43371
43416
  drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
@@ -43373,6 +43418,7 @@
43373
43418
  const { dataId, data, spec } = chart.attribute;
43374
43419
  chart.getViewBox();
43375
43420
  const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
43421
+ const { table } = chart.getRootNode();
43376
43422
  const { active, cacheCanvas, activeChartInstance } = chart;
43377
43423
  if (!active && cacheCanvas) {
43378
43424
  if (isArray$1(cacheCanvas)) {
@@ -43386,6 +43432,27 @@
43386
43432
  }
43387
43433
  }
43388
43434
  else if (activeChartInstance) {
43435
+ if (table.options.specFormat) {
43436
+ const formatResult = table.options.specFormat(chart.attribute.spec);
43437
+ if (formatResult.needFormatSpec && formatResult.spec) {
43438
+ const spec = formatResult.spec;
43439
+ activeChartInstance.updateSpecSync(spec);
43440
+ return;
43441
+ }
43442
+ }
43443
+ const viewBox = chart.getViewBox();
43444
+ activeChartInstance.updateViewBox({
43445
+ x1: 0,
43446
+ x2: viewBox.x2 - viewBox.x1,
43447
+ y1: 0,
43448
+ y2: viewBox.y2 - viewBox.y1
43449
+ }, false, false);
43450
+ const chartStage = activeChartInstance.getStage();
43451
+ chartStage.needRender = true;
43452
+ const matrix = chart.globalTransMatrix.clone();
43453
+ const stageMatrix = chart.stage.window.getViewBoxTransform().clone();
43454
+ stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
43455
+ chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
43389
43456
  if (typeof dataId === 'string') {
43390
43457
  activeChartInstance.updateDataSync(dataId, data ?? []);
43391
43458
  }
@@ -43415,13 +43482,13 @@
43415
43482
  }
43416
43483
  }
43417
43484
  else {
43418
- if (chart.getRootNode().table.internalProps.renderChartAsync) {
43485
+ if (table.internalProps.renderChartAsync) {
43419
43486
  if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {
43420
43487
  chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);
43421
43488
  chartRenderQueueList.push(chart);
43422
43489
  }
43423
43490
  if (!IsHandlingChartQueue()) {
43424
- startRenderChartQueue(chart.getRootNode().table);
43491
+ startRenderChartQueue(table);
43425
43492
  }
43426
43493
  }
43427
43494
  else {
@@ -43430,31 +43497,7 @@
43430
43497
  }
43431
43498
  }
43432
43499
  draw(chart, renderService, drawContext, params) {
43433
- const { context } = drawContext;
43434
- if (!context) {
43435
- return;
43436
- }
43437
- const { clip } = chart.attribute;
43438
- if (clip) {
43439
- context.save();
43440
- }
43441
- else {
43442
- context.highPerformanceSave();
43443
- }
43444
- context.transformFromMatrix(chart.transMatrix, true);
43445
- context.beginPath();
43446
- if (params.skipDraw) {
43447
- this.drawShape(chart, context, 0, 0, drawContext, params, () => false, () => false);
43448
- }
43449
- else {
43450
- this.drawShape(chart, context, 0, 0, drawContext);
43451
- }
43452
- if (clip) {
43453
- context.restore();
43454
- }
43455
- else {
43456
- context.highPerformanceRestore();
43457
- }
43500
+ this._draw(chart, {}, false, drawContext, params);
43458
43501
  }
43459
43502
  };
43460
43503
  DefaultCanvasChartRender = __decorate([
@@ -48289,6 +48332,15 @@
48289
48332
  });
48290
48333
  }
48291
48334
  }
48335
+ function clearCellChartCacheImage(col, row, scenegraph) {
48336
+ const cellGroup = scenegraph.getCell(col, row);
48337
+ cellGroup.children.forEach((node) => {
48338
+ if (node.type === 'chart') {
48339
+ node.cacheCanvas = null;
48340
+ node.addUpdateBoundTag();
48341
+ }
48342
+ });
48343
+ }
48292
48344
  function updateChartData(scenegraph) {
48293
48345
  const table = scenegraph.table;
48294
48346
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
@@ -49150,7 +49202,12 @@
49150
49202
  setPoptipTheme(this.table.theme.textPopTipStyle);
49151
49203
  let width;
49152
49204
  let height;
49153
- if (Env.mode === 'node') {
49205
+ if (table.options.canvas && table.options.viewBox) {
49206
+ vglobal.setEnv('browser');
49207
+ width = table.options.viewBox.x2 - table.options.viewBox.x1;
49208
+ height = table.options.viewBox.y2 - table.options.viewBox.y1;
49209
+ }
49210
+ else if (Env.mode === 'node') {
49154
49211
  vglobal.setEnv('node', table.options.modeParams);
49155
49212
  width = table.canvasWidth;
49156
49213
  height = table.canvasHeight;
@@ -49168,9 +49225,15 @@
49168
49225
  background: table.theme.underlayBackgroundColor,
49169
49226
  dpr: table.internalProps.pixelRatio,
49170
49227
  enableLayout: true,
49171
- afterRender: () => {
49228
+ beforeRender: (stage) => {
49229
+ this.table.options.beforeRender && this.table.options.beforeRender(stage);
49230
+ },
49231
+ afterRender: (stage) => {
49232
+ this.table.options.afterRender && this.table.options.afterRender(stage);
49172
49233
  this.table.fireListeners('after_render', null);
49173
49234
  },
49235
+ canvasControled: !table.options.canvas,
49236
+ viewBox: table.options.viewBox,
49174
49237
  ...table.options.renderOption
49175
49238
  });
49176
49239
  this.stage.defaultLayer.setTheme({
@@ -54355,17 +54418,19 @@
54355
54418
  e.preventDefault();
54356
54419
  }
54357
54420
  });
54358
- handler.on(table.getContainer(), 'resize', e => {
54359
- if (e.width === 0 && e.height === 0) {
54360
- return;
54361
- }
54362
- if (!isValid$1(table.options.pixelRatio)) {
54363
- table.setPixelRatio(getPixelRatio());
54364
- }
54365
- if (!e.windowSizeNotChange) {
54366
- table.resize();
54367
- }
54368
- });
54421
+ if (!table.options.canvas) {
54422
+ handler.on(table.getContainer(), 'resize', e => {
54423
+ if (e.width === 0 && e.height === 0) {
54424
+ return;
54425
+ }
54426
+ if (!isValid$1(table.options.pixelRatio)) {
54427
+ table.setPixelRatio(getPixelRatio());
54428
+ }
54429
+ if (!e.windowSizeNotChange) {
54430
+ table.resize();
54431
+ }
54432
+ });
54433
+ }
54369
54434
  function pasteHtmlToTable(item) {
54370
54435
  const ranges = table.stateManager.select.ranges;
54371
54436
  const selectRangeLength = ranges.length;
@@ -54913,7 +54978,7 @@
54913
54978
  this.table = table;
54914
54979
  this.handleTextStickBindId = [];
54915
54980
  this.inertiaScroll = new InertiaScroll(table.stateManager);
54916
- if (Env.mode === 'node') {
54981
+ if (Env.mode === 'node' || table.options.disableInteraction) {
54917
54982
  return;
54918
54983
  }
54919
54984
  this.bindOuterEvent();
@@ -57475,6 +57540,7 @@
57475
57540
  }
57476
57541
 
57477
57542
  class FocusInput extends EventTarget {
57543
+ _container;
57478
57544
  _table;
57479
57545
  _input;
57480
57546
  constructor(table, parentElement) {
@@ -57494,6 +57560,7 @@
57494
57560
  input.dataset.vtable = 'vtable';
57495
57561
  input.readOnly = true;
57496
57562
  parentElement.appendChild(div);
57563
+ this._container = div;
57497
57564
  }
57498
57565
  focus() {
57499
57566
  this._input.focus({ preventScroll: true });
@@ -57513,6 +57580,7 @@
57513
57580
  return this._input;
57514
57581
  }
57515
57582
  release() {
57583
+ this._container.parentElement?.removeChild(this._container);
57516
57584
  }
57517
57585
  }
57518
57586
 
@@ -57632,7 +57700,8 @@
57632
57700
  height: this.table.tableNoFrameHeight
57633
57701
  });
57634
57702
  const legend = new DiscreteLegend(merge({}, attrs, {
57635
- defaultSelected: this.selectedData
57703
+ defaultSelected: this.selectedData,
57704
+ disableTriggerEvent: this.table.options.disableInteraction
57636
57705
  }));
57637
57706
  legend.name = 'legend';
57638
57707
  this.legendComponent = legend;
@@ -59194,6 +59263,249 @@
59194
59263
  return customTree;
59195
59264
  }
59196
59265
 
59266
+ function getRowAt(absoluteY, _this) {
59267
+ const frozen = _getTargetFrozenRowAt(_this, absoluteY);
59268
+ if (frozen) {
59269
+ return frozen;
59270
+ }
59271
+ let row = getTargetRowAt(absoluteY, _this);
59272
+ if (!row) {
59273
+ row = {
59274
+ top: -1,
59275
+ row: -1,
59276
+ bottom: -1,
59277
+ height: -1
59278
+ };
59279
+ }
59280
+ return row;
59281
+ }
59282
+ function getColAt(absoluteX, _this) {
59283
+ const frozen = _getTargetFrozenColAt(_this, absoluteX);
59284
+ if (frozen) {
59285
+ return frozen;
59286
+ }
59287
+ let col = getTargetColAt(absoluteX, _this);
59288
+ if (!col) {
59289
+ col = {
59290
+ left: -1,
59291
+ col: -1,
59292
+ right: -1,
59293
+ width: 1
59294
+ };
59295
+ }
59296
+ return col;
59297
+ }
59298
+ function getCellAt(absoluteX, absoluteY, _this) {
59299
+ const rowInfo = getRowAt(absoluteY, _this);
59300
+ const { row, top, bottom, height } = rowInfo;
59301
+ const colInfo = getColAt(absoluteX, _this);
59302
+ const { col, left, right, width } = colInfo;
59303
+ const rect = {
59304
+ left,
59305
+ right,
59306
+ top,
59307
+ bottom,
59308
+ width,
59309
+ height
59310
+ };
59311
+ return {
59312
+ row,
59313
+ col,
59314
+ rect
59315
+ };
59316
+ }
59317
+ function getTargetColAt(absoluteX, _this) {
59318
+ if (absoluteX === 0) {
59319
+ return { left: 0, col: 0, right: 0, width: 0 };
59320
+ }
59321
+ const findBefore = (startCol, startRight) => {
59322
+ let right = startRight;
59323
+ for (let col = startCol; col >= 0; col--) {
59324
+ const width = _this.getColWidth(col);
59325
+ const left = right - width;
59326
+ if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
59327
+ return {
59328
+ left,
59329
+ col,
59330
+ right,
59331
+ width
59332
+ };
59333
+ }
59334
+ right = left;
59335
+ }
59336
+ return null;
59337
+ };
59338
+ const findAfter = (startCol, startRight) => {
59339
+ let left = startRight - _this.getColWidth(startCol);
59340
+ const { colCount } = _this.internalProps;
59341
+ for (let col = startCol; col < colCount; col++) {
59342
+ const width = _this.getColWidth(col);
59343
+ const right = left + width;
59344
+ if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
59345
+ return {
59346
+ left,
59347
+ col,
59348
+ right,
59349
+ width
59350
+ };
59351
+ }
59352
+ left = right;
59353
+ }
59354
+ return null;
59355
+ };
59356
+ const candCol = computeTargetColByX(absoluteX, _this);
59357
+ const right = _this.getColsWidth(0, candCol);
59358
+ if (absoluteX >= right) {
59359
+ return findAfter(candCol, right);
59360
+ }
59361
+ return findBefore(candCol, right);
59362
+ }
59363
+ function getTargetRowAt(absoluteY, _this) {
59364
+ if (absoluteY === 0) {
59365
+ return { top: 0, row: 0, bottom: 0, height: 0 };
59366
+ }
59367
+ const findBefore = (startRow, startBottom) => {
59368
+ let bottom = startBottom;
59369
+ for (let row = startRow; row >= 0; row--) {
59370
+ const height = _this.getRowHeight(row);
59371
+ const top = bottom - height;
59372
+ if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
59373
+ return {
59374
+ top,
59375
+ row,
59376
+ bottom,
59377
+ height
59378
+ };
59379
+ }
59380
+ bottom = top;
59381
+ }
59382
+ return null;
59383
+ };
59384
+ const findAfter = (startRow, startBottom) => {
59385
+ let top = startBottom - _this.getRowHeight(startRow);
59386
+ const { rowCount } = _this.internalProps;
59387
+ for (let row = startRow; row < rowCount; row++) {
59388
+ const height = _this.getRowHeight(row);
59389
+ const bottom = top + height;
59390
+ if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
59391
+ return {
59392
+ top,
59393
+ row,
59394
+ bottom,
59395
+ height
59396
+ };
59397
+ }
59398
+ top = bottom;
59399
+ }
59400
+ return null;
59401
+ };
59402
+ const candRow = computeTargetRowByY(absoluteY, _this);
59403
+ const bottom = _this.getRowsHeight(0, candRow);
59404
+ if (absoluteY >= bottom) {
59405
+ return findAfter(candRow, bottom);
59406
+ }
59407
+ return findBefore(candRow, bottom);
59408
+ }
59409
+ function getTargetColAtConsiderRightFrozen(absoluteX, isConsider, _this) {
59410
+ if (absoluteX === 0) {
59411
+ return { left: 0, col: 0, right: 0, width: 0 };
59412
+ }
59413
+ if (isConsider &&
59414
+ absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() &&
59415
+ absoluteX < _this.tableNoFrameWidth) {
59416
+ for (let i = 0; i < _this.rightFrozenColCount; i++) {
59417
+ if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) {
59418
+ return {
59419
+ col: _this.colCount - i - 1,
59420
+ left: undefined,
59421
+ right: undefined,
59422
+ width: undefined
59423
+ };
59424
+ }
59425
+ }
59426
+ }
59427
+ return getTargetColAt(absoluteX, _this);
59428
+ }
59429
+ function getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider, _this) {
59430
+ if (absoluteY === 0) {
59431
+ return { top: 0, row: 0, bottom: 0, height: 0 };
59432
+ }
59433
+ if (isConsider &&
59434
+ absoluteY > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() &&
59435
+ absoluteY < _this.tableNoFrameHeight) {
59436
+ for (let i = 0; i < _this.rightFrozenColCount; i++) {
59437
+ if (absoluteY > _this.tableNoFrameHeight - _this.getRowsHeight(_this.rowCount - i - 1, _this.rowCount - 1)) {
59438
+ return {
59439
+ row: _this.rowCount - i - 1,
59440
+ top: undefined,
59441
+ bottom: undefined,
59442
+ height: undefined
59443
+ };
59444
+ }
59445
+ }
59446
+ }
59447
+ return getTargetRowAt(absoluteY, _this);
59448
+ }
59449
+ function computeTargetRowByY(absoluteY, _this) {
59450
+ let defaultRowHeight = _this.internalProps.defaultRowHeight;
59451
+ if (_this._rowRangeHeightsMap.get(`$0$${_this.rowCount - 1}`)) {
59452
+ defaultRowHeight = _this._rowRangeHeightsMap.get(`$0$${_this.rowCount - 1}`) / _this.rowCount;
59453
+ }
59454
+ return Math.min(Math.ceil(absoluteY / defaultRowHeight), _this.rowCount - 1);
59455
+ }
59456
+ function computeTargetColByX(absoluteX, _this) {
59457
+ if (_this._colRangeWidthsMap.get(`$0$${_this.colCount - 1}`)) {
59458
+ let startCol = 0;
59459
+ let endCol = _this.colCount - 1;
59460
+ while (endCol - startCol > 1) {
59461
+ const midCol = Math.floor((startCol + endCol) / 2);
59462
+ if (absoluteX < _this._colRangeWidthsMap.get(`$0$${midCol}`)) {
59463
+ endCol = midCol;
59464
+ }
59465
+ else if (absoluteX > _this._colRangeWidthsMap.get(`$0$${midCol}`)) {
59466
+ startCol = midCol;
59467
+ }
59468
+ else {
59469
+ return midCol;
59470
+ }
59471
+ }
59472
+ return endCol;
59473
+ }
59474
+ return Math.min(Math.ceil(absoluteX / _this.internalProps.defaultColWidth), _this.colCount - 1);
59475
+ }
59476
+ function getCellAtRelativePosition(x, y, _this) {
59477
+ x -= _this.tableX;
59478
+ y -= _this.tableY;
59479
+ let bottomFrozen = false;
59480
+ if (y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight) {
59481
+ bottomFrozen = true;
59482
+ }
59483
+ let rightFrozen = false;
59484
+ if (x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth) {
59485
+ rightFrozen = true;
59486
+ }
59487
+ const colInfo = getTargetColAtConsiderRightFrozen(rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this);
59488
+ const rowInfo = getTargetRowAtConsiderBottomFrozen(bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);
59489
+ if (!colInfo || !rowInfo) {
59490
+ return undefined;
59491
+ }
59492
+ const { row, top, bottom, height } = rowInfo;
59493
+ const { col, left, right, width } = colInfo;
59494
+ const rect = {
59495
+ left,
59496
+ right,
59497
+ top,
59498
+ bottom,
59499
+ width,
59500
+ height
59501
+ };
59502
+ return {
59503
+ row,
59504
+ col,
59505
+ rect
59506
+ };
59507
+ }
59508
+
59197
59509
  const { toBoxArray } = style;
59198
59510
  const { isTouchEvent } = event;
59199
59511
  const rangeReg = /^\$(\d+)\$(\d+)$/;
@@ -59226,7 +59538,7 @@
59226
59538
  return TABLE_EVENT_TYPE;
59227
59539
  }
59228
59540
  options;
59229
- version = "1.3.2-alpha.0";
59541
+ version = "1.3.2-alpha.2";
59230
59542
  pagination;
59231
59543
  id = `VTable${Date.now()}`;
59232
59544
  headerStyleCache;
@@ -59240,7 +59552,7 @@
59240
59552
  _hasAutoImageColumn;
59241
59553
  constructor(container, options = {}) {
59242
59554
  super();
59243
- if (!container && options.mode !== 'node') {
59555
+ if (!container && options.mode !== 'node' && !options.canvas) {
59244
59556
  throw new Error("vtable's container is undefined");
59245
59557
  }
59246
59558
  const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
@@ -59278,7 +59590,14 @@
59278
59590
  if (typeof allowFrozenColCount === 'number' && allowFrozenColCount <= 0) {
59279
59591
  this.showFrozenIcon = false;
59280
59592
  }
59281
- if (Env.mode !== 'node') {
59593
+ if (this.options.canvas) {
59594
+ internalProps.element = this.options.canvas.parentElement;
59595
+ internalProps.element.style.position = 'relative';
59596
+ internalProps.focusControl = new FocusInput(this, internalProps.element);
59597
+ internalProps.canvas = this.options.canvas;
59598
+ internalProps.context = internalProps.canvas.getContext('2d');
59599
+ }
59600
+ else if (Env.mode !== 'node') {
59282
59601
  internalProps.element = createRootElement(this.padding);
59283
59602
  internalProps.focusControl = new FocusInput(this, internalProps.element);
59284
59603
  internalProps.canvas = document.createElement('canvas');
@@ -59675,7 +59994,21 @@
59675
59994
  const { padding } = this;
59676
59995
  let widthP = 0;
59677
59996
  let heightP = 0;
59678
- if (Env.mode === 'browser') {
59997
+ this.tableX = 0;
59998
+ this.tableY = 0;
59999
+ if (this.options.canvas && this.options.viewBox) {
60000
+ widthP = this.options.viewBox.x2 - this.options.viewBox.x1;
60001
+ heightP = this.options.viewBox.y2 - this.options.viewBox.y1;
60002
+ if (this?.scenegraph?.stage) {
60003
+ if (this.options.viewBox) {
60004
+ this.scenegraph.stage.setViewBox(this.options.viewBox, false);
60005
+ }
60006
+ else {
60007
+ this.scenegraph.stage.resize(widthP, heightP);
60008
+ }
60009
+ }
60010
+ }
60011
+ else if (Env.mode === 'browser') {
59679
60012
  const element = this.getElement();
59680
60013
  let widthWithoutPadding = 0;
59681
60014
  let heightWithoutPadding = 0;
@@ -59734,6 +60067,23 @@
59734
60067
  }
59735
60068
  }
59736
60069
  }
60070
+ updateViewBox(newViewBox) {
60071
+ const oldWidth = this.options?.viewBox.x2 ?? 0 - this.options?.viewBox.x1 ?? 0;
60072
+ const oldHeight = this.options?.viewBox.y2 ?? 0 - this.options?.viewBox.y1 ?? 0;
60073
+ const newWidth = newViewBox.x2 - newViewBox.x1;
60074
+ const newHeight = newViewBox.y2 - newViewBox.y1;
60075
+ this.options.viewBox = newViewBox;
60076
+ if (oldWidth !== newWidth || oldHeight !== newHeight) {
60077
+ this.resize();
60078
+ }
60079
+ else {
60080
+ this.scenegraph.stage.setViewBox(this.options.viewBox, true);
60081
+ }
60082
+ }
60083
+ setViewBoxTransform(a, b, c, d, e, f) {
60084
+ this.internalProps.modifiedViewBoxTransform = true;
60085
+ this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
60086
+ }
59737
60087
  get rowHierarchyType() {
59738
60088
  return 'grid';
59739
60089
  }
@@ -60184,55 +60534,16 @@
60184
60534
  return null;
60185
60535
  }
60186
60536
  getRowAt(absoluteY) {
60187
- const frozen = _getTargetFrozenRowAt(this, absoluteY);
60188
- if (frozen) {
60189
- return frozen;
60190
- }
60191
- let row = this.getTargetRowAt(absoluteY);
60192
- if (!row) {
60193
- row = {
60194
- top: -1,
60195
- row: -1,
60196
- bottom: -1,
60197
- height: -1
60198
- };
60199
- }
60200
- return row;
60537
+ return getRowAt(absoluteY, this);
60201
60538
  }
60202
60539
  getColAt(absoluteX) {
60203
- const frozen = _getTargetFrozenColAt(this, absoluteX);
60204
- if (frozen) {
60205
- return frozen;
60206
- }
60207
- let col = this.getTargetColAt(absoluteX);
60208
- if (!col) {
60209
- col = {
60210
- left: -1,
60211
- col: -1,
60212
- right: -1,
60213
- width: 1
60214
- };
60215
- }
60216
- return col;
60540
+ return getColAt(absoluteX, this);
60217
60541
  }
60218
60542
  getCellAt(absoluteX, absoluteY) {
60219
- const rowInfo = this.getRowAt(absoluteY);
60220
- const { row, top, bottom, height } = rowInfo;
60221
- const colInfo = this.getColAt(absoluteX);
60222
- const { col, left, right, width } = colInfo;
60223
- const rect = {
60224
- left,
60225
- right,
60226
- top,
60227
- bottom,
60228
- width,
60229
- height
60230
- };
60231
- return {
60232
- row,
60233
- col,
60234
- rect
60235
- };
60543
+ return getCellAt(absoluteX, absoluteY, this);
60544
+ }
60545
+ getCellAtRelativePosition(relativeX, relativeY) {
60546
+ return getCellAtRelativePosition(relativeX, relativeY, this);
60236
60547
  }
60237
60548
  _checkRowCol(col, row) {
60238
60549
  if (col >= 0 && col < this.colCount && row >= 0 && row < this.rowCount) {
@@ -60287,6 +60598,8 @@
60287
60598
  const visibleRect = this.getVisibleRect();
60288
60599
  rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0));
60289
60600
  rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0));
60601
+ rect.offsetLeft(this.options.viewBox?.x1 ?? 0);
60602
+ rect.offsetTop(this.options.viewBox?.y1 ?? 0);
60290
60603
  return rect;
60291
60604
  }
60292
60605
  getVisibleRect() {
@@ -60446,8 +60759,9 @@
60446
60759
  }
60447
60760
  this.scenegraph.stage.release();
60448
60761
  this.scenegraph.proxy.release();
60762
+ internalProps.focusControl.release();
60449
60763
  const { parentElement } = internalProps.element;
60450
- if (parentElement) {
60764
+ if (parentElement && !this.options.canvas) {
60451
60765
  parentElement.removeChild(internalProps.element);
60452
60766
  }
60453
60767
  this.editorManager?.editingEditor?.onEnd?.();
@@ -60670,171 +60984,29 @@
60670
60984
  const currentHeight = rect.height;
60671
60985
  const originHeight = this.canvas.offsetHeight || currentHeight;
60672
60986
  const heightRatio = currentHeight / originHeight;
60673
- const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0);
60674
- const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0);
60675
- return { x, y, inTable };
60987
+ const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0) - (this.options.viewBox?.x1 ?? 0);
60988
+ const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0) - (this.options.viewBox?.y1 ?? 0);
60989
+ const point = { x, y, inTable };
60990
+ if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
60991
+ const transform = this.scenegraph.stage.window.getViewBoxTransform();
60992
+ transform.transformPoint(point, point);
60993
+ }
60994
+ return point;
60676
60995
  }
60677
60996
  getTheme() {
60678
60997
  return this.internalProps.theme;
60679
60998
  }
60680
60999
  getTargetColAt(absoluteX) {
60681
- if (absoluteX === 0) {
60682
- return { left: 0, col: 0, right: 0, width: 0 };
60683
- }
60684
- const findBefore = (startCol, startRight) => {
60685
- let right = startRight;
60686
- for (let col = startCol; col >= 0; col--) {
60687
- const width = this.getColWidth(col);
60688
- const left = right - width;
60689
- if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
60690
- return {
60691
- left,
60692
- col,
60693
- right,
60694
- width
60695
- };
60696
- }
60697
- right = left;
60698
- }
60699
- return null;
60700
- };
60701
- const findAfter = (startCol, startRight) => {
60702
- let left = startRight - this.getColWidth(startCol);
60703
- const { colCount } = this.internalProps;
60704
- for (let col = startCol; col < colCount; col++) {
60705
- const width = this.getColWidth(col);
60706
- const right = left + width;
60707
- if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
60708
- return {
60709
- left,
60710
- col,
60711
- right,
60712
- width
60713
- };
60714
- }
60715
- left = right;
60716
- }
60717
- return null;
60718
- };
60719
- const candCol = this.computeTargetColByX(absoluteX);
60720
- const right = this.getColsWidth(0, candCol);
60721
- if (absoluteX >= right) {
60722
- return findAfter(candCol, right);
60723
- }
60724
- return findBefore(candCol, right);
61000
+ return getTargetColAt(absoluteX, this);
60725
61001
  }
60726
61002
  getTargetRowAt(absoluteY) {
60727
- if (absoluteY === 0) {
60728
- return { top: 0, row: 0, bottom: 0, height: 0 };
60729
- }
60730
- const findBefore = (startRow, startBottom) => {
60731
- let bottom = startBottom;
60732
- for (let row = startRow; row >= 0; row--) {
60733
- const height = this.getRowHeight(row);
60734
- const top = bottom - height;
60735
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
60736
- return {
60737
- top,
60738
- row,
60739
- bottom,
60740
- height
60741
- };
60742
- }
60743
- bottom = top;
60744
- }
60745
- return null;
60746
- };
60747
- const findAfter = (startRow, startBottom) => {
60748
- let top = startBottom - this.getRowHeight(startRow);
60749
- const { rowCount } = this.internalProps;
60750
- for (let row = startRow; row < rowCount; row++) {
60751
- const height = this.getRowHeight(row);
60752
- const bottom = top + height;
60753
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
60754
- return {
60755
- top,
60756
- row,
60757
- bottom,
60758
- height
60759
- };
60760
- }
60761
- top = bottom;
60762
- }
60763
- return null;
60764
- };
60765
- const candRow = this.computeTargetRowByY(absoluteY);
60766
- const bottom = this.getRowsHeight(0, candRow);
60767
- if (absoluteY >= bottom) {
60768
- return findAfter(candRow, bottom);
60769
- }
60770
- return findBefore(candRow, bottom);
61003
+ return getTargetRowAt(absoluteY, this);
60771
61004
  }
60772
61005
  getTargetColAtConsiderRightFrozen(absoluteX, isConsider) {
60773
- if (absoluteX === 0) {
60774
- return { left: 0, col: 0, right: 0, width: 0 };
60775
- }
60776
- if (isConsider &&
60777
- absoluteX > this.tableNoFrameWidth - this.getRightFrozenColsWidth() &&
60778
- absoluteX < this.tableNoFrameWidth) {
60779
- for (let i = 0; i < this.rightFrozenColCount; i++) {
60780
- if (absoluteX > this.tableNoFrameWidth - this.getColsWidth(this.colCount - i - 1, this.colCount - 1)) {
60781
- return {
60782
- col: this.colCount - i - 1,
60783
- left: undefined,
60784
- right: undefined,
60785
- width: undefined
60786
- };
60787
- }
60788
- }
60789
- }
60790
- return this.getTargetColAt(absoluteX);
61006
+ return getTargetColAtConsiderRightFrozen(absoluteX, isConsider, this);
60791
61007
  }
60792
61008
  getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider) {
60793
- if (absoluteY === 0) {
60794
- return { top: 0, row: 0, bottom: 0, height: 0 };
60795
- }
60796
- if (isConsider &&
60797
- absoluteY > this.tableNoFrameHeight - this.getBottomFrozenRowsHeight() &&
60798
- absoluteY < this.tableNoFrameHeight) {
60799
- for (let i = 0; i < this.rightFrozenColCount; i++) {
60800
- if (absoluteY > this.tableNoFrameHeight - this.getRowsHeight(this.rowCount - i - 1, this.rowCount - 1)) {
60801
- return {
60802
- row: this.rowCount - i - 1,
60803
- top: undefined,
60804
- bottom: undefined,
60805
- height: undefined
60806
- };
60807
- }
60808
- }
60809
- }
60810
- return this.getTargetRowAt(absoluteY);
60811
- }
60812
- computeTargetRowByY(absoluteY) {
60813
- let defaultRowHeight = this.internalProps.defaultRowHeight;
60814
- if (this._rowRangeHeightsMap.get(`$0$${this.rowCount - 1}`)) {
60815
- defaultRowHeight = this._rowRangeHeightsMap.get(`$0$${this.rowCount - 1}`) / this.rowCount;
60816
- }
60817
- return Math.min(Math.ceil(absoluteY / defaultRowHeight), this.rowCount - 1);
60818
- }
60819
- computeTargetColByX(absoluteX) {
60820
- if (this._colRangeWidthsMap.get(`$0$${this.colCount - 1}`)) {
60821
- let startCol = 0;
60822
- let endCol = this.colCount - 1;
60823
- while (endCol - startCol > 1) {
60824
- const midCol = Math.floor((startCol + endCol) / 2);
60825
- if (absoluteX < this._colRangeWidthsMap.get(`$0$${midCol}`)) {
60826
- endCol = midCol;
60827
- }
60828
- else if (absoluteX > this._colRangeWidthsMap.get(`$0$${midCol}`)) {
60829
- startCol = midCol;
60830
- }
60831
- else {
60832
- return midCol;
60833
- }
60834
- }
60835
- return endCol;
60836
- }
60837
- return Math.min(Math.ceil(absoluteX / this.internalProps.defaultColWidth), this.colCount - 1);
61009
+ return getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider, this);
60838
61010
  }
60839
61011
  clearSelected() {
60840
61012
  this.stateManager.updateSelectPos(-1, -1);
@@ -64100,12 +64272,10 @@
64100
64272
  const topHeaderHeight = !this.table.transpose || this.table.options.indicatorsAsCol
64101
64273
  ? this.table.getFrozenRowsHeight()
64102
64274
  : 0;
64103
- const width = (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()
64104
- ? this.table.getDrawRange().width
64105
- : this.table.tableNoFrameWidth) - leftHeaderWidth;
64106
- const height = (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()
64107
- ? this.table.getDrawRange().height
64108
- : this.table.tableNoFrameHeight) - topHeaderHeight;
64275
+ const width = (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -
64276
+ leftHeaderWidth;
64277
+ const height = (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -
64278
+ topHeaderHeight;
64109
64279
  this._emptyTipComponent.setAttributes({
64110
64280
  spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,
64111
64281
  x: this.table.tableX + leftHeaderWidth,
@@ -64148,12 +64318,10 @@
64148
64318
  const topHeaderHeight = !this.table.transpose || this.table.options.indicatorsAsCol
64149
64319
  ? this.table.getFrozenRowsHeight()
64150
64320
  : 0;
64151
- const width = (this.table.columnHeaderLevelCount > 0 && this.table.isListTable()
64152
- ? this.table.getDrawRange().width
64153
- : this.table.tableNoFrameWidth) - leftHeaderWidth;
64154
- const height = (this.table.rowHeaderLevelCount > 0 && this.table.isListTable()
64155
- ? this.table.getDrawRange().height
64156
- : this.table.tableNoFrameHeight) - topHeaderHeight;
64321
+ const width = (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -
64322
+ leftHeaderWidth;
64323
+ const height = (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -
64324
+ topHeaderHeight;
64157
64325
  return {
64158
64326
  spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,
64159
64327
  x: this.table.tableX + leftHeaderWidth,
@@ -65648,8 +65816,11 @@
65648
65816
  this.rowDimensionKeys = this.rowDimensionTree.dimensionKeys.valueArr();
65649
65817
  this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys);
65650
65818
  this.resetRowHeaderLevelCount();
65819
+ this._generateColHeaderIds();
65820
+ this.colIndex = 0;
65821
+ this._generateRowHeaderIds();
65651
65822
  if (this._table.isPivotChart()) {
65652
- this.hasTwoIndicatorAxes = this.indicatorsDefine.some((indicatorObject) => {
65823
+ this.hasTwoIndicatorAxes = this._indicators.some(indicatorObject => {
65653
65824
  if (indicatorObject.chartSpec &&
65654
65825
  indicatorObject.chartSpec.series &&
65655
65826
  indicatorObject.chartSpec.series.length > 1) {
@@ -65668,9 +65839,6 @@
65668
65839
  });
65669
65840
  }
65670
65841
  this.resetColumnHeaderLevelCount();
65671
- this._generateColHeaderIds();
65672
- this.colIndex = 0;
65673
- this._generateRowHeaderIds();
65674
65842
  this._rowHeaderCellFullPathIds_FULL = transpose(this._rowHeaderCellFullPathIds_FULL);
65675
65843
  if (table.options.rowHierarchyType === 'tree' && this.extensionRows?.length >= 1) {
65676
65844
  this.generateExtensionRowTree();
@@ -65690,21 +65858,7 @@
65690
65858
  }
65691
65859
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
65692
65860
  if (this.cornerSetting.titleOnDimension === 'column') {
65693
- let colDimensionKeys = this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();
65694
- if (this.dataset &&
65695
- (this.dataset.records?.length ?? 0) === 0 &&
65696
- !this.dataset.customColTree &&
65697
- !this.dataset.customRowTree) {
65698
- colDimensionKeys = this.columnsDefine.map(define => {
65699
- if (typeof define === 'string') {
65700
- return define;
65701
- }
65702
- return define.dimensionKey;
65703
- });
65704
- if (this.indicatorsAsCol) {
65705
- colDimensionKeys.push(this.indicatorDimensionKey);
65706
- }
65707
- }
65861
+ const colDimensionKeys = this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();
65708
65862
  this.cornerHeaderObjs = this._addCornerHeaders(this.columnHeaderTitle ? [''].concat(colDimensionKeys) : colDimensionKeys, this.columnsDefine);
65709
65863
  }
65710
65864
  else if (this.cornerSetting.titleOnDimension === 'row') {
@@ -65720,21 +65874,7 @@
65720
65874
  this.cornerHeaderObjs = this._addCornerHeaders(this.rowHeaderTitle ? [''].concat(rowTreeFirstKey) : rowTreeFirstKey, this.rowsDefine.concat(extensionRowDimensions));
65721
65875
  }
65722
65876
  else {
65723
- let rowDimensionKeys = this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr();
65724
- if (this.dataset &&
65725
- (this.dataset.records?.length ?? 0) === 0 &&
65726
- !this.dataset.customColTree &&
65727
- !this.dataset.customRowTree) {
65728
- rowDimensionKeys = this.rowsDefine.map(define => {
65729
- if (typeof define === 'string') {
65730
- return define;
65731
- }
65732
- return define.dimensionKey;
65733
- });
65734
- if (!this.indicatorsAsCol) {
65735
- rowDimensionKeys.push(this.indicatorDimensionKey);
65736
- }
65737
- }
65877
+ const rowDimensionKeys = this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr();
65738
65878
  this.cornerHeaderObjs = this._addCornerHeaders(this.rowHeaderTitle ? [''].concat(rowDimensionKeys) : rowDimensionKeys, this.rowsDefine);
65739
65879
  }
65740
65880
  }
@@ -65840,24 +65980,12 @@
65840
65980
  }
65841
65981
  _generateColHeaderIds() {
65842
65982
  if (this.columnDimensionTree.tree.children?.length >= 1) {
65843
- let startRow = 0;
65844
- if (this.dataset &&
65845
- (this.dataset.records?.length ?? 0) === 0 &&
65846
- !this.dataset.customColTree &&
65847
- !this.dataset.customRowTree &&
65848
- this.indicatorsAsCol &&
65849
- this.columnDimensionTree.totalLevel < this.columnHeaderLevelCount) {
65850
- startRow = this.columnHeaderLevelCount - this.columnDimensionTree.totalLevel;
65851
- for (let i = 0; i < startRow; i++) {
65852
- this._columnHeaderCellFullPathIds.unshift([]);
65853
- }
65854
- }
65855
- this._addHeaders(this._columnHeaderCellFullPathIds, startRow, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs);
65983
+ this._addHeaders(this._columnHeaderCellFullPathIds, 0, this.columnDimensionTree.tree.children, [], this.columnHeaderObjs);
65856
65984
  }
65857
65985
  if (this.columnHeaderTitle) {
65858
65986
  this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
65859
65987
  const id = ++this.sharedVar.seqId;
65860
- const firstRowIds = Array(this.colCount - this.rowHeaderLevelCount - this.rightFrozenColCount).fill(id);
65988
+ const firstRowIds = Array(this.colCount - this.rowHeaderLevelCount).fill(id);
65861
65989
  this._columnHeaderCellFullPathIds.unshift(firstRowIds);
65862
65990
  const cell = {
65863
65991
  id,
@@ -65888,19 +66016,7 @@
65888
66016
  this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, true, this.rowsDefine, this.rowHeaderObjs);
65889
66017
  }
65890
66018
  else {
65891
- let startRow = 0;
65892
- if (this.dataset &&
65893
- (this.dataset.records?.length ?? 0) === 0 &&
65894
- !this.dataset.customColTree &&
65895
- !this.dataset.customRowTree &&
65896
- !this.indicatorsAsCol &&
65897
- this.rowDimensionTree.totalLevel < this.rowHeaderLevelCount) {
65898
- startRow = this.rowHeaderLevelCount - this.rowDimensionTree.totalLevel;
65899
- for (let i = 0; i < startRow; i++) {
65900
- this._rowHeaderCellFullPathIds_FULL.unshift([]);
65901
- }
65902
- }
65903
- this._addHeaders(this._rowHeaderCellFullPathIds_FULL, startRow, this.rowDimensionTree.tree.children, [], this.rowHeaderObjs);
66019
+ this._addHeaders(this._rowHeaderCellFullPathIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowHeaderObjs);
65904
66020
  }
65905
66021
  }
65906
66022
  if (this.rowHeaderTitle) {
@@ -66425,25 +66541,6 @@
66425
66541
  checkHasCartesianChart(this.indicatorsDefine)) {
66426
66542
  count -= 1;
66427
66543
  }
66428
- if (count === 0 && this.dataset && !this.dataset.customColTree && !this.dataset.customRowTree) {
66429
- if (this.cornerSetting.titleOnDimension === 'row') {
66430
- count = 1;
66431
- }
66432
- else if ((this.dataset.records?.length ?? 0) === 0 && this.cornerSetting.titleOnDimension === 'column') {
66433
- count = this.columnsDefine.length ?? 0;
66434
- }
66435
- }
66436
- else if (this.dataset &&
66437
- (this.dataset.records?.length ?? 0) === 0 &&
66438
- !this.dataset.customColTree &&
66439
- !this.dataset.customRowTree) {
66440
- if (this.cornerSetting.titleOnDimension === 'column') {
66441
- count = this.columnsDefine.length ?? 0;
66442
- if (!this.hideIndicatorName && this.indicatorsAsCol) {
66443
- count++;
66444
- }
66445
- }
66446
- }
66447
66544
  this.columnHeaderLevelCount = count;
66448
66545
  return;
66449
66546
  }
@@ -66471,25 +66568,6 @@
66471
66568
  if (this.rowHeaderTitle) {
66472
66569
  count += 1;
66473
66570
  }
66474
- if (count === 0 && this.dataset && !this.dataset.customColTree && !this.dataset.customRowTree) {
66475
- if (this.cornerSetting.titleOnDimension === 'column') {
66476
- count = 1;
66477
- }
66478
- else if ((this.dataset.records?.length ?? 0) === 0 && this.cornerSetting.titleOnDimension === 'row') {
66479
- count = this.rowsDefine.length ?? 0;
66480
- }
66481
- }
66482
- else if (this.dataset &&
66483
- (this.dataset.records?.length ?? 0) === 0 &&
66484
- !this.dataset.customColTree &&
66485
- !this.dataset.customRowTree) {
66486
- if (this.cornerSetting.titleOnDimension === 'row') {
66487
- count = this.rowsDefine.length;
66488
- if (!this.hideIndicatorName && !this.indicatorsAsCol) {
66489
- count++;
66490
- }
66491
- }
66492
- }
66493
66571
  this.rowHeaderLevelCount = count;
66494
66572
  return;
66495
66573
  }
@@ -66601,16 +66679,16 @@
66601
66679
  return '';
66602
66680
  }
66603
66681
  else if (this.isCornerHeader(col, row)) {
66604
- return this._cornerHeaderCellIds[row]?.[col - this.leftRowSeriesNumberColumnCount];
66682
+ return this._cornerHeaderCellIds[row][col - this.leftRowSeriesNumberColumnCount];
66605
66683
  }
66606
66684
  else if (this.isColumnHeader(col, row)) {
66607
- return this._columnHeaderCellIds[row]?.[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
66685
+ return this._columnHeaderCellIds[row][col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
66608
66686
  }
66609
66687
  else if (this.isRowHeader(col, row)) {
66610
66688
  return this._rowHeaderCellIds[row - this.columnHeaderLevelCount]?.[col - this.leftRowSeriesNumberColumnCount];
66611
66689
  }
66612
66690
  else if (this.isRightFrozenColumn(col, row)) {
66613
- return this._rowHeaderCellIds[row - this.columnHeaderLevelCount]?.[this.rowHeaderLevelCount - 1];
66691
+ return this._rowHeaderCellIds[row - this.columnHeaderLevelCount][this.rowHeaderLevelCount - 1];
66614
66692
  }
66615
66693
  else if (this.isBottomFrozenRow(col, row)) {
66616
66694
  return this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]?.[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
@@ -68002,10 +68080,10 @@
68002
68080
  this.columnTree = dataset.colHeaderTree;
68003
68081
  this.columnDimensionTree = new DimensionTree(this.columnTree ?? [], this.sharedVar);
68004
68082
  this.rowDimensionTree = new DimensionTree(this.rowTree ?? [], this.sharedVar, this.rowHierarchyType, this.rowHierarchyType === 'tree' ? this.rowExpandLevel : undefined);
68005
- this.resetColumnHeaderLevelCount();
68006
68083
  this._generateColHeaderIds();
68007
68084
  this.colIndex = 0;
68008
68085
  this._generateRowHeaderIds();
68086
+ this.resetColumnHeaderLevelCount();
68009
68087
  this._rowHeaderCellFullPathIds_FULL = transpose(this._rowHeaderCellFullPathIds_FULL);
68010
68088
  this._headerObjectMap = this._headerObjects.reduce((o, e) => {
68011
68089
  o[e.id] = e;
@@ -68445,9 +68523,7 @@
68445
68523
  collectedValues = {};
68446
68524
  cacheCollectedValues = {};
68447
68525
  rows;
68448
- rowsHasValue;
68449
68526
  columns;
68450
- columnsHasValue;
68451
68527
  indicatorKeys;
68452
68528
  customRowTree;
68453
68529
  customColTree;
@@ -68507,8 +68583,6 @@
68507
68583
  this.rowFlatKeys = {};
68508
68584
  this.colKeys = [];
68509
68585
  this.rowKeys = [];
68510
- this.rowsHasValue = [];
68511
- this.columnsHasValue = [];
68512
68586
  if (records) {
68513
68587
  this.records = records;
68514
68588
  typeof window !== 'undefined' ? window.performance.now() : 0;
@@ -68529,25 +68603,19 @@
68529
68603
  }
68530
68604
  else {
68531
68605
  if (this.rowHierarchyType === 'tree') {
68532
- this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter((key, index) => {
68533
- return this.rowsHasValue[index];
68534
- }), this.indicatorsAsCol ? undefined : this.indicators, this.totals?.row?.showGrandTotals ||
68606
+ this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, this.indicatorsAsCol ? undefined : this.indicators, this.totals?.row?.showGrandTotals ||
68535
68607
  (!this.indicatorsAsCol && this.columns.length === 0) ||
68536
68608
  (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel);
68537
68609
  }
68538
68610
  else {
68539
- this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter((key, index) => {
68540
- return this.rowsHasValue[index];
68541
- }), this.indicatorsAsCol ? undefined : this.indicators, this.rowsIsTotal, this.totals?.row?.showGrandTotals || (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel, this.rowSubTotalLabel, this.totals?.row?.showGrandTotalsOnTop ?? false, this.totals?.row?.showSubTotalsOnTop ?? false);
68611
+ this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows, this.indicatorsAsCol ? undefined : this.indicators, this.rowsIsTotal, this.totals?.row?.showGrandTotals || (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel, this.rowSubTotalLabel, this.totals?.row?.showGrandTotalsOnTop ?? false, this.totals?.row?.showSubTotalsOnTop ?? false);
68542
68612
  }
68543
68613
  }
68544
68614
  if (this.customColTree) {
68545
68615
  this.colHeaderTree = this.customColTree;
68546
68616
  }
68547
68617
  else {
68548
- this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter((key, index) => {
68549
- return this.columnsHasValue[index];
68550
- }), this.indicatorsAsCol ? this.indicators : undefined, this.colsIsTotal, this.totals?.column?.showGrandTotals || (!this.indicatorsAsCol && this.columns.length === 0), this.colGrandTotalLabel, this.colSubTotalLabel, this.totals?.column?.showGrandTotalsOnLeft ?? false, this.totals?.column?.showSubTotalsOnLeft ?? false);
68618
+ this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns, this.indicatorsAsCol ? this.indicators : undefined, this.colsIsTotal, this.totals?.column?.showGrandTotals || (!this.indicatorsAsCol && this.columns.length === 0), this.colGrandTotalLabel, this.colSubTotalLabel, this.totals?.column?.showGrandTotalsOnLeft ?? false, this.totals?.column?.showSubTotalsOnLeft ?? false);
68551
68619
  }
68552
68620
  typeof window !== 'undefined' ? window.performance.now() : 0;
68553
68621
  if (this.dataConfig?.isPivotChart) {
@@ -68744,7 +68812,6 @@
68744
68812
  for (let l = 0, len1 = this.rows.length; l < len1; l++) {
68745
68813
  const rowAttr = this.rows[l];
68746
68814
  if (rowAttr in record) {
68747
- this.rowsHasValue[l] = true;
68748
68815
  rowKey.push(record[rowAttr]);
68749
68816
  }
68750
68817
  else if (rowAttr !== IndicatorDimensionKeyPlaceholder) {
@@ -68770,7 +68837,6 @@
68770
68837
  for (let n = 0, len2 = this.columns.length; n < len2; n++) {
68771
68838
  const colAttr = this.columns[n];
68772
68839
  if (colAttr in record) {
68773
- this.columnsHasValue[n] = true;
68774
68840
  colKey.push(record[colAttr]);
68775
68841
  }
68776
68842
  else if (colAttr !== IndicatorDimensionKeyPlaceholder) {
@@ -68896,22 +68962,16 @@
68896
68962
  this.sortKeys();
68897
68963
  if (!this.customRowTree) {
68898
68964
  if (this.rowHierarchyType === 'tree') {
68899
- this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows.filter((key, index) => {
68900
- return this.rowsHasValue[index];
68901
- }), this.indicatorsAsCol ? undefined : this.indicators, this.totals?.row?.showGrandTotals ||
68965
+ this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, this.indicatorsAsCol ? undefined : this.indicators, this.totals?.row?.showGrandTotals ||
68902
68966
  (!this.indicatorsAsCol && this.columns.length === 0) ||
68903
68967
  (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel);
68904
68968
  }
68905
68969
  else {
68906
- this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows.filter((key, index) => {
68907
- return this.rowsHasValue[index];
68908
- }), this.indicatorsAsCol ? undefined : this.indicators, this.rowsIsTotal, this.totals?.row?.showGrandTotals || (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel, this.rowSubTotalLabel, this.totals?.row?.showGrandTotalsOnTop ?? false, this.totals?.row?.showSubTotalsOnTop ?? false);
68970
+ this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows, this.indicatorsAsCol ? undefined : this.indicators, this.rowsIsTotal, this.totals?.row?.showGrandTotals || (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel, this.rowSubTotalLabel, this.totals?.row?.showGrandTotalsOnTop ?? false, this.totals?.row?.showSubTotalsOnTop ?? false);
68909
68971
  }
68910
68972
  }
68911
68973
  if (!this.customColTree) {
68912
- this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns.filter((key, index) => {
68913
- return this.columnsHasValue[index];
68914
- }), this.indicatorsAsCol ? this.indicators : undefined, this.colsIsTotal, this.totals?.column?.showGrandTotals || (!this.indicatorsAsCol && this.columns.length === 0), this.colGrandTotalLabel, this.colSubTotalLabel, this.totals?.column?.showGrandTotalsOnLeft ?? false, this.totals?.column?.showSubTotalsOnLeft ?? false);
68974
+ this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns, this.indicatorsAsCol ? this.indicators : undefined, this.colsIsTotal, this.totals?.column?.showGrandTotals || (!this.indicatorsAsCol && this.columns.length === 0), this.colGrandTotalLabel, this.colSubTotalLabel, this.totals?.column?.showGrandTotalsOnLeft ?? false, this.totals?.column?.showSubTotalsOnLeft ?? false);
68915
68975
  }
68916
68976
  }
68917
68977
  updateFilterRules(filterRules, isResetTree = false) {
@@ -71687,6 +71747,14 @@
71687
71747
  updateChartData(this.scenegraph);
71688
71748
  this.render();
71689
71749
  }
71750
+ clearChartCacheImage(col, row) {
71751
+ if (isNumber$2(col) && isNumber$2(row)) {
71752
+ clearCellChartCacheImage(col, row, this.scenegraph);
71753
+ }
71754
+ else {
71755
+ clearChartCacheImage(this.scenegraph);
71756
+ }
71757
+ }
71690
71758
  getLegendSelected() {
71691
71759
  const selected = [];
71692
71760
  this.internalProps.legends?.forEach(legend => {
@@ -72480,7 +72548,7 @@
72480
72548
  }
72481
72549
 
72482
72550
  registerForVrender();
72483
- const version = "1.3.2-alpha.0";
72551
+ const version = "1.3.2-alpha.2";
72484
72552
  function getIcons() {
72485
72553
  return get$2();
72486
72554
  }