@visactor/vtable 1.4.1-beta.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/cjs/PivotChart.d.ts +0 -1
  2. package/cjs/PivotChart.js +0 -4
  3. package/cjs/PivotChart.js.map +1 -1
  4. package/cjs/components/axis/axis.js +2 -3
  5. package/cjs/components/axis/axis.js.map +1 -1
  6. package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -2
  7. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  8. package/cjs/core/BaseTable.d.ts +2 -4
  9. package/cjs/core/BaseTable.js +171 -55
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/core/FouseInput.d.ts +0 -1
  12. package/cjs/core/FouseInput.js +2 -5
  13. package/cjs/core/FouseInput.js.map +1 -1
  14. package/cjs/core/tableHelper.d.ts +2 -2
  15. package/cjs/core/tableHelper.js.map +1 -1
  16. package/cjs/event/event.js +1 -2
  17. package/cjs/event/event.js.map +1 -1
  18. package/cjs/event/listener/container-dom.js +10 -9
  19. package/cjs/event/listener/container-dom.js.map +1 -1
  20. package/cjs/event/listener/table-group.js +11 -11
  21. package/cjs/event/listener/table-group.js.map +1 -1
  22. package/cjs/event/util.js +2 -2
  23. package/cjs/event/util.js.map +1 -1
  24. package/cjs/index.d.ts +1 -1
  25. package/cjs/index.js +1 -1
  26. package/cjs/index.js.map +1 -1
  27. package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
  28. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
  29. package/cjs/scenegraph/graphic/chart.d.ts +0 -1
  30. package/cjs/scenegraph/graphic/chart.js +20 -34
  31. package/cjs/scenegraph/graphic/chart.js.map +1 -1
  32. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  33. package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  34. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  35. package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
  36. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  37. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  38. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  39. package/cjs/scenegraph/refresh-node/update-chart.d.ts +0 -1
  40. package/cjs/scenegraph/refresh-node/update-chart.js +2 -9
  41. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  42. package/cjs/scenegraph/scenegraph.js +4 -10
  43. package/cjs/scenegraph/scenegraph.js.map +1 -1
  44. package/cjs/state/state.js +1 -1
  45. package/cjs/themes/component.js +1 -1
  46. package/cjs/ts-types/base-table.d.ts +1 -14
  47. package/cjs/ts-types/base-table.js.map +1 -1
  48. package/cjs/vrender.js.map +1 -1
  49. package/dist/vtable.js +325 -499
  50. package/dist/vtable.min.js +2 -2
  51. package/es/PivotChart.d.ts +0 -1
  52. package/es/PivotChart.js +2 -5
  53. package/es/PivotChart.js.map +1 -1
  54. package/es/components/axis/axis.js +1 -3
  55. package/es/components/axis/axis.js.map +1 -1
  56. package/es/components/legend/discrete-legend/discrete-legend.js +1 -2
  57. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  58. package/es/core/BaseTable.d.ts +2 -4
  59. package/es/core/BaseTable.js +170 -56
  60. package/es/core/BaseTable.js.map +1 -1
  61. package/es/core/FouseInput.d.ts +0 -1
  62. package/es/core/FouseInput.js +2 -5
  63. package/es/core/FouseInput.js.map +1 -1
  64. package/es/core/tableHelper.d.ts +2 -2
  65. package/es/core/tableHelper.js.map +1 -1
  66. package/es/event/event.js +1 -2
  67. package/es/event/event.js.map +1 -1
  68. package/es/event/listener/container-dom.js +10 -9
  69. package/es/event/listener/container-dom.js.map +1 -1
  70. package/es/event/listener/table-group.js +11 -11
  71. package/es/event/listener/table-group.js.map +1 -1
  72. package/es/event/util.js +2 -2
  73. package/es/event/util.js.map +1 -1
  74. package/es/index.d.ts +1 -1
  75. package/es/index.js +1 -1
  76. package/es/index.js.map +1 -1
  77. package/es/scenegraph/debug-tool/debug-tool.js +1 -4
  78. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
  79. package/es/scenegraph/graphic/chart.d.ts +0 -1
  80. package/es/scenegraph/graphic/chart.js +21 -33
  81. package/es/scenegraph/graphic/chart.js.map +1 -1
  82. package/es/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
  83. package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
  84. package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
  85. package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
  86. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
  87. package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
  88. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  89. package/es/scenegraph/refresh-node/update-chart.d.ts +0 -1
  90. package/es/scenegraph/refresh-node/update-chart.js +0 -6
  91. package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
  92. package/es/scenegraph/scenegraph.js +4 -10
  93. package/es/scenegraph/scenegraph.js.map +1 -1
  94. package/es/state/state.js +1 -1
  95. package/es/themes/component.js +1 -1
  96. package/es/ts-types/base-table.d.ts +1 -14
  97. package/es/ts-types/base-table.js.map +1 -1
  98. package/es/vrender.js.map +1 -1
  99. package/package.json +8 -8
  100. package/cjs/core/utils/get-cell-position.d.ts +0 -22
  101. package/cjs/core/utils/get-cell-position.js +0 -206
  102. package/cjs/core/utils/get-cell-position.js.map +0 -1
  103. package/es/core/utils/get-cell-position.d.ts +0 -22
  104. package/es/core/utils/get-cell-position.js +0 -194
  105. package/es/core/utils/get-cell-position.js.map +0 -1
package/dist/vtable.js CHANGED
@@ -19998,6 +19998,7 @@
19998
19998
  throw new Error("暂不支持");
19999
19999
  }
20000
20000
  createLayer(canvasId, layerMode) {
20001
+ if ("released" === this.releaseStatus) return;
20001
20002
  const layer = this.layerService.createLayer(this, {
20002
20003
  main: !1,
20003
20004
  layerMode: layerMode,
@@ -20015,12 +20016,13 @@
20015
20016
  return this.removeChild(this.findChildByUid(ILayerId));
20016
20017
  }
20017
20018
  tryInitInteractiveLayer() {
20018
- this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
20019
+ "released" !== this.releaseStatus && this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(), this.interactiveLayer.name = "_builtin_interactive", this.interactiveLayer.attribute.pickable = !1, this.nextFrameRenderLayerSet.add(this.interactiveLayer));
20019
20020
  }
20020
20021
  clearViewBox(color) {
20021
20022
  this.window.clearViewBox(color);
20022
20023
  }
20023
20024
  render(layers, params) {
20025
+ if ("released" === this.releaseStatus) return;
20024
20026
  this.ticker.start(), this.timeline.resume();
20025
20027
  const state = this.state;
20026
20028
  this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
@@ -20044,6 +20046,7 @@
20044
20046
  }));
20045
20047
  }
20046
20048
  _doRenderInThisFrame() {
20049
+ if ("released" === this.releaseStatus) return;
20047
20050
  this.timeline.resume(), this.ticker.start();
20048
20051
  const state = this.state;
20049
20052
  this.state = "rendering", this.layerService.prepareStageLayer(this), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()), this.lastRenderparams || {}), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
@@ -20079,18 +20082,18 @@
20079
20082
  }
20080
20083
  resize(w, h) {
20081
20084
  let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
20082
- this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(c => {
20085
+ "released" !== this.releaseStatus && (this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(c => {
20083
20086
  c.resize(w, h);
20084
- }), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render();
20087
+ }), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render());
20085
20088
  }
20086
20089
  resizeView(w, h) {
20087
20090
  let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
20088
- this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.forEachChildren(c => {
20091
+ "released" !== this.releaseStatus && (this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.forEachChildren(c => {
20089
20092
  c.resizeView(w, h);
20090
20093
  }), this.camera && (this.camera.params = Object.assign(Object.assign({}, this.camera.params), {
20091
20094
  right: this.width,
20092
20095
  bottom: this.height
20093
- })), rerender && this.render();
20096
+ })), rerender && this.render());
20094
20097
  }
20095
20098
  setViewBox(x, y, w, h, rerender) {
20096
20099
  let isRerender = !0;
@@ -20111,6 +20114,7 @@
20111
20114
  throw new Error("暂不支持");
20112
20115
  }
20113
20116
  pick(x, y) {
20117
+ if ("released" === this.releaseStatus) return;
20114
20118
  this.pickerService || (this.pickerService = container.get(PickerService));
20115
20119
  const result = this.pickerService.pick(this.children, new Point(x, y), {
20116
20120
  bounds: this.AABBBounds
@@ -20130,13 +20134,13 @@
20130
20134
  }
20131
20135
  setStage(stage) {}
20132
20136
  dirty(b, matrix) {
20133
- matrix && b.transformWithMatrix(matrix), this.dirtyBounds.empty() && this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2), this.dirtyBounds.union(b);
20137
+ "released" !== this.releaseStatus && (matrix && b.transformWithMatrix(matrix), this.dirtyBounds.empty() && this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2), this.dirtyBounds.union(b));
20134
20138
  }
20135
20139
  getLayer(name) {
20136
20140
  return this.children.filter(layer => layer.name === name)[0];
20137
20141
  }
20138
20142
  renderTo(window) {
20139
- this.forEachChildren((layer, i) => {
20143
+ "released" !== this.releaseStatus && this.forEachChildren((layer, i) => {
20140
20144
  layer.drawTo(window, {
20141
20145
  renderService: this.renderService,
20142
20146
  viewBox: window.getViewBox(),
@@ -20149,6 +20153,7 @@
20149
20153
  }
20150
20154
  renderToNewWindow() {
20151
20155
  let viewBox = arguments.length > 1 ? arguments[1] : undefined;
20156
+ if ("released" === this.releaseStatus) return;
20152
20157
  const window = container.get(VWindow),
20153
20158
  x1 = viewBox ? -viewBox.x1 : 0,
20154
20159
  y1 = viewBox ? -viewBox.y1 : 0,
@@ -20174,6 +20179,7 @@
20174
20179
  toCanvas() {
20175
20180
  let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
20176
20181
  let viewBox = arguments.length > 1 ? arguments[1] : undefined;
20182
+ if ("released" === this.releaseStatus) return;
20177
20183
  const c = this.renderToNewWindow(fullImage, viewBox).getNativeHandler();
20178
20184
  return c.nativeCanvas ? c.nativeCanvas : null;
20179
20185
  }
@@ -41998,7 +42004,7 @@
41998
42004
  }
41999
42005
  };
42000
42006
 
42001
- const version$1 = "0.19.12";
42007
+ const version$1 = "0.19.13-beta.0";
42002
42008
 
42003
42009
  let registed = false;
42004
42010
  function registerForVrender() {
@@ -47961,9 +47967,7 @@
47961
47967
  const axisStylrAttrs = getAxisAttributes(this.option);
47962
47968
  const attrs = this.getUpdateAttribute();
47963
47969
  attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
47964
- this.component = new LineAxis(merge({
47965
- disableTriggerEvent: this.table.options.disableInteraction
47966
- }, axisStylrAttrs, attrs));
47970
+ this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));
47967
47971
  this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
47968
47972
  this.component.originAxis = this;
47969
47973
  }
@@ -50701,8 +50705,8 @@
50701
50705
  function getCellEventArgsSet(e) {
50702
50706
  const tableEvent = {
50703
50707
  abstractPos: {
50704
- x: e.viewport.x,
50705
- y: e.viewport.y
50708
+ x: e.x,
50709
+ y: e.y
50706
50710
  }
50707
50711
  };
50708
50712
  const targetCell = getTargetCell(e.target);
@@ -52845,7 +52849,7 @@
52845
52849
  this.numberType = CHART_NUMBER_TYPE;
52846
52850
  this.isShareChartSpec = isShareChartSpec;
52847
52851
  if (!params.chartInstance) {
52848
- const chartInstance = (this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
52852
+ const chartInstance = new params.ClassType(params.spec, {
52849
52853
  renderCanvas: params.canvas,
52850
52854
  mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
52851
52855
  modeParams: this.attribute.modeParams,
@@ -52855,9 +52859,8 @@
52855
52859
  interactive: false,
52856
52860
  animation: false,
52857
52861
  autoFit: false
52858
- })));
52862
+ });
52859
52863
  chartInstance.renderSync();
52860
- chartInstance.getStage().enableDirtyBounds();
52861
52864
  params.chartInstance = this.chartInstance = chartInstance;
52862
52865
  }
52863
52866
  else {
@@ -52875,53 +52878,34 @@
52875
52878
  y1: y1 - table.scrollTop,
52876
52879
  y2: y2 - table.scrollTop
52877
52880
  });
52878
- this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
52881
+ this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
52879
52882
  renderCanvas: this.attribute.canvas,
52880
52883
  mode: 'desktop-browser',
52881
52884
  canvasControled: false,
52882
52885
  viewBox: {
52883
- x1: 0,
52884
- x2: x2 - x1,
52885
- y1: 0,
52886
- y2: y2 - y1
52886
+ x1: x1 - table.scrollLeft,
52887
+ x2: x2 - table.scrollLeft,
52888
+ y1: y1 - table.scrollTop,
52889
+ y2: y2 - table.scrollTop
52887
52890
  },
52888
52891
  dpr: table.internalProps.pixelRatio,
52889
52892
  animation: false,
52890
52893
  interactive: true,
52891
52894
  autoFit: false,
52892
- beforeRender: (chartStage) => {
52893
- const stage = this.stage;
52894
- const ctx = chartStage.window.getContext();
52895
- const stageMatrix = stage.window.getViewBoxTransform();
52896
- const viewBox = stage.window.getViewBox();
52895
+ beforeRender: (stage) => {
52896
+ const ctx = stage.window.getContext();
52897
52897
  ctx.inuse = true;
52898
52898
  ctx.clearMatrix();
52899
- ctx.setTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f, true);
52900
- ctx.translate(viewBox.x1, viewBox.y1);
52901
52899
  ctx.setTransformForCurrent(true);
52902
52900
  ctx.beginPath();
52903
52901
  ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
52904
52902
  ctx.clip();
52905
- ctx.clearMatrix();
52906
- if (!chartStage.needRender) {
52907
- chartStage.pauseRender();
52908
- table.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds);
52909
- table.scenegraph.updateNextFrame();
52910
- }
52911
52903
  },
52912
52904
  afterRender(stage) {
52913
52905
  const ctx = stage.window.getContext();
52914
52906
  ctx.inuse = false;
52915
- stage.needRender = false;
52916
- chartStage.resumeRender();
52917
52907
  }
52918
- }));
52919
- const chartStage = this.activeChartInstance.getStage();
52920
- const matrix = this.globalTransMatrix.clone();
52921
- const stageMatrix = this.stage.window.getViewBoxTransform();
52922
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
52923
- chartStage.window.setViewBoxTransform &&
52924
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
52908
+ });
52925
52909
  this.activeChartInstance.renderSync();
52926
52910
  table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
52927
52911
  this.activeChartInstance.on('click', (params) => {
@@ -52957,12 +52941,11 @@
52957
52941
  const cellGroup = this.parent;
52958
52942
  const padding = this.attribute.cellPadding;
52959
52943
  const table = this.stage.table;
52960
- const { x1, y1, x2, y2 } = cellGroup.globalAABBBounds;
52961
52944
  return {
52962
- x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
52963
- x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
52964
- y1: Math.ceil(y1 + padding[0] + table.scrollTop + (table.options.viewBox?.y1 ?? 0)),
52965
- y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (table.options.viewBox?.y1 ?? 0))
52945
+ x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
52946
+ x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
52947
+ y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
52948
+ y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
52966
52949
  };
52967
52950
  }
52968
52951
  }
@@ -52993,10 +52976,6 @@
52993
52976
  bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
52994
52977
  bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
52995
52978
  }
52996
- bodyBound.x1 = bodyBound.x1 + (table.options.viewBox?.x1 ?? 0);
52997
- bodyBound.x2 = bodyBound.x2 + (table.options.viewBox?.x1 ?? 0);
52998
- bodyBound.y1 = bodyBound.y1 + (table.options.viewBox?.y1 ?? 0);
52999
- bodyBound.y2 = bodyBound.y2 + (table.options.viewBox?.y1 ?? 0);
53000
52979
  return bodyBound;
53001
52980
  }
53002
52981
 
@@ -53078,8 +53057,7 @@
53078
53057
  data: table.getCellValue(col, row),
53079
53058
  cellPadding: padding,
53080
53059
  dpr: table.internalProps.pixelRatio,
53081
- axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],
53082
- tableChartOption: table.options.chartOption
53060
+ axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
53083
53061
  });
53084
53062
  cellGroup.appendChild(chartGroup);
53085
53063
  table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
@@ -58736,65 +58714,48 @@
58736
58714
  if (viewBox.y2 <= viewBox.y1) {
58737
58715
  viewBox.y2 = viewBox.y1 + 1;
58738
58716
  }
58739
- chartInstance.updateViewBox({
58740
- x1: 0,
58741
- x2: viewBox.x2 - viewBox.x1,
58742
- y1: 0,
58743
- y2: viewBox.y2 - viewBox.y1
58744
- }, false, false);
58745
- const chartStage = chartInstance.getStage();
58746
- const matrix = chart.globalTransMatrix.clone();
58747
- const stageMatrix = chart.stage.window.getViewBoxTransform();
58748
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
58749
- chartStage.window.setViewBoxTransform &&
58750
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
58751
- const { table } = chart.getRootNode();
58752
- let updateSpec = false;
58753
- if (table.options.specFormat) {
58754
- const formatResult = table.options.specFormat(chart.attribute.spec);
58755
- if (formatResult.needFormatSpec && formatResult.spec) {
58756
- const spec = formatResult.spec;
58757
- chartInstance.updateSpecSync(spec);
58758
- updateSpec = true;
58759
- }
58760
- }
58761
- if (!updateSpec) {
58762
- axes?.forEach((axis, index) => {
58763
- if (axis.type === 'band') {
58764
- chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
58765
- }
58766
- else {
58767
- chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
58768
- }
58769
- });
58770
- table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
58771
- if (typeof dataId === 'string') {
58772
- chartInstance.updateDataSync(dataId, data ?? []);
58717
+ axes?.forEach((axis, index) => {
58718
+ if (axis.type === 'band') {
58719
+ chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
58773
58720
  }
58774
58721
  else {
58775
- const dataBatch = [];
58776
- for (const dataIdStr in dataId) {
58777
- const dataIdAndField = dataId[dataIdStr];
58778
- const series = spec.series.find((item) => item?.data?.id === dataIdStr);
58779
- dataBatch.push({
58780
- id: dataIdStr,
58781
- values: dataIdAndField
58782
- ? data?.filter((item) => {
58783
- return item.hasOwnProperty(dataIdAndField);
58784
- }) ?? []
58785
- : data ?? [],
58786
- fields: series?.data?.fields
58787
- });
58788
- if (!chartInstance.updateFullDataSync) {
58789
- chartInstance.updateDataSync(dataIdStr, dataIdAndField
58790
- ? data?.filter((item) => {
58791
- return item.hasOwnProperty(dataIdAndField);
58792
- }) ?? []
58793
- : data ?? []);
58794
- }
58722
+ chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
58723
+ }
58724
+ });
58725
+ chartInstance.updateViewBox({
58726
+ x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
58727
+ x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
58728
+ y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
58729
+ y2: viewBox.y2 - chart.getRootNode().table.scrollTop
58730
+ }, false, false);
58731
+ const table = chart.getRootNode().table;
58732
+ table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
58733
+ if (typeof dataId === 'string') {
58734
+ chartInstance.updateDataSync(dataId, data ?? []);
58735
+ }
58736
+ else {
58737
+ const dataBatch = [];
58738
+ for (const dataIdStr in dataId) {
58739
+ const dataIdAndField = dataId[dataIdStr];
58740
+ const series = spec.series.find((item) => item?.data?.id === dataIdStr);
58741
+ dataBatch.push({
58742
+ id: dataIdStr,
58743
+ values: dataIdAndField
58744
+ ? data?.filter((item) => {
58745
+ return item.hasOwnProperty(dataIdAndField);
58746
+ }) ?? []
58747
+ : data ?? [],
58748
+ fields: series?.data?.fields
58749
+ });
58750
+ if (!chartInstance.updateFullDataSync) {
58751
+ chartInstance.updateDataSync(dataIdStr, dataIdAndField
58752
+ ? data?.filter((item) => {
58753
+ return item.hasOwnProperty(dataIdAndField);
58754
+ }) ?? []
58755
+ : data ?? []);
58795
58756
  }
58796
- chartInstance.updateFullDataSync?.(dataBatch);
58797
58757
  }
58758
+ chartInstance.updateFullDataSync?.(dataBatch);
58798
58759
  }
58799
58760
  const sg = chartInstance.getStage();
58800
58761
  cacheStageCanvas(sg, chart);
@@ -58856,7 +58817,7 @@
58856
58817
  }
58857
58818
 
58858
58819
  const ChartRender = Symbol.for('ChartRender');
58859
- let DefaultCanvasChartRender = class DefaultCanvasChartRender extends BaseRender {
58820
+ let DefaultCanvasChartRender = class DefaultCanvasChartRender {
58860
58821
  type;
58861
58822
  numberType = CHART_NUMBER_TYPE;
58862
58823
  drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
@@ -58864,7 +58825,6 @@
58864
58825
  const { dataId, data, spec } = chart.attribute;
58865
58826
  chart.getViewBox();
58866
58827
  const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
58867
- const { table } = chart.getRootNode();
58868
58828
  const { active, cacheCanvas, activeChartInstance } = chart;
58869
58829
  if (!active && cacheCanvas) {
58870
58830
  if (isArray$1(cacheCanvas)) {
@@ -58878,27 +58838,6 @@
58878
58838
  }
58879
58839
  }
58880
58840
  else if (activeChartInstance) {
58881
- if (table.options.specFormat) {
58882
- const formatResult = table.options.specFormat(chart.attribute.spec);
58883
- if (formatResult.needFormatSpec && formatResult.spec) {
58884
- const spec = formatResult.spec;
58885
- activeChartInstance.updateSpecSync(spec);
58886
- return;
58887
- }
58888
- }
58889
- const viewBox = chart.getViewBox();
58890
- activeChartInstance.updateViewBox({
58891
- x1: 0,
58892
- x2: viewBox.x2 - viewBox.x1,
58893
- y1: 0,
58894
- y2: viewBox.y2 - viewBox.y1
58895
- }, false, false);
58896
- const chartStage = activeChartInstance.getStage();
58897
- chartStage.needRender = true;
58898
- const matrix = chart.globalTransMatrix.clone();
58899
- const stageMatrix = chart.stage.window.getViewBoxTransform().clone();
58900
- stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
58901
- chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
58902
58841
  if (typeof dataId === 'string') {
58903
58842
  activeChartInstance.updateDataSync(dataId, data ?? []);
58904
58843
  }
@@ -58928,13 +58867,13 @@
58928
58867
  }
58929
58868
  }
58930
58869
  else {
58931
- if (table.internalProps.renderChartAsync) {
58870
+ if (chart.getRootNode().table.internalProps.renderChartAsync) {
58932
58871
  if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {
58933
58872
  chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);
58934
58873
  chartRenderQueueList.push(chart);
58935
58874
  }
58936
58875
  if (!IsHandlingChartQueue()) {
58937
- startRenderChartQueue(table);
58876
+ startRenderChartQueue(chart.getRootNode().table);
58938
58877
  }
58939
58878
  }
58940
58879
  else {
@@ -58943,7 +58882,31 @@
58943
58882
  }
58944
58883
  }
58945
58884
  draw(chart, renderService, drawContext, params) {
58946
- this._draw(chart, {}, false, drawContext, params);
58885
+ const { context } = drawContext;
58886
+ if (!context) {
58887
+ return;
58888
+ }
58889
+ const { clip } = chart.attribute;
58890
+ if (clip) {
58891
+ context.save();
58892
+ }
58893
+ else {
58894
+ context.highPerformanceSave();
58895
+ }
58896
+ context.transformFromMatrix(chart.transMatrix, true);
58897
+ context.beginPath();
58898
+ if (params.skipDraw) {
58899
+ this.drawShape(chart, context, 0, 0, drawContext, params, () => false, () => false);
58900
+ }
58901
+ else {
58902
+ this.drawShape(chart, context, 0, 0, drawContext);
58903
+ }
58904
+ if (clip) {
58905
+ context.restore();
58906
+ }
58907
+ else {
58908
+ context.highPerformanceRestore();
58909
+ }
58947
58910
  }
58948
58911
  };
58949
58912
  DefaultCanvasChartRender = __decorate([
@@ -63787,15 +63750,6 @@
63787
63750
  });
63788
63751
  }
63789
63752
  }
63790
- function clearCellChartCacheImage(col, row, scenegraph) {
63791
- const cellGroup = scenegraph.getCell(col, row);
63792
- cellGroup.children.forEach((node) => {
63793
- if (node.type === 'chart') {
63794
- node.cacheCanvas = null;
63795
- node.addUpdateBoundTag();
63796
- }
63797
- });
63798
- }
63799
63753
  function updateChartData(scenegraph) {
63800
63754
  const table = scenegraph.table;
63801
63755
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
@@ -64657,12 +64611,7 @@
64657
64611
  setPoptipTheme(this.table.theme.textPopTipStyle);
64658
64612
  let width;
64659
64613
  let height;
64660
- if (table.options.canvas && table.options.viewBox) {
64661
- vglobal.setEnv('browser');
64662
- width = table.options.viewBox.x2 - table.options.viewBox.x1;
64663
- height = table.options.viewBox.y2 - table.options.viewBox.y1;
64664
- }
64665
- else if (Env.mode === 'node') {
64614
+ if (Env.mode === 'node') {
64666
64615
  vglobal.setEnv('node', table.options.modeParams);
64667
64616
  width = table.canvasWidth;
64668
64617
  height = table.canvasHeight;
@@ -64680,15 +64629,9 @@
64680
64629
  background: table.theme.underlayBackgroundColor,
64681
64630
  dpr: table.internalProps.pixelRatio,
64682
64631
  enableLayout: true,
64683
- beforeRender: (stage) => {
64684
- this.table.options.beforeRender && this.table.options.beforeRender(stage);
64685
- },
64686
- afterRender: (stage) => {
64687
- this.table.options.afterRender && this.table.options.afterRender(stage);
64632
+ afterRender: () => {
64688
64633
  this.table.fireListeners('after_render', null);
64689
64634
  },
64690
- canvasControled: !table.options.canvas,
64691
- viewBox: table.options.viewBox,
64692
64635
  ...table.options.renderOption
64693
64636
  });
64694
64637
  this.stage.defaultLayer.setTheme({
@@ -68616,7 +68559,7 @@
68616
68559
  }
68617
68560
  const eventArgsSet = getCellEventArgsSet(e);
68618
68561
  if (stateManager.interactionState === InteractionState.grabing &&
68619
- !table.editorManager.editingEditor) {
68562
+ !table.editorManager?.editingEditor) {
68620
68563
  if (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {
68621
68564
  if (stateManager.isResizeCol()) ;
68622
68565
  else if (stateManager.isMoveCol()) {
@@ -68633,7 +68576,7 @@
68633
68576
  }
68634
68577
  else if (table.eventManager.isDraging &&
68635
68578
  stateManager.isSelecting() &&
68636
- !table.editorManager.editingEditor) {
68579
+ !table.editorManager?.editingEditor) {
68637
68580
  eventManager.dealTableSelect(eventArgsSet, true);
68638
68581
  }
68639
68582
  const cellGoup = e.path.find(node => node.role === 'cell');
@@ -69646,7 +69589,7 @@
69646
69589
  stateManager.select.cellPos.row >= 0 &&
69647
69590
  (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight')) {
69648
69591
  if (!(table.options.keyboardOptions?.moveEditCellOnArrowKeys ?? false) &&
69649
- table.editorManager.editingEditor) {
69592
+ table.editorManager?.editingEditor) {
69650
69593
  return;
69651
69594
  }
69652
69595
  e.preventDefault();
@@ -69711,7 +69654,7 @@
69711
69654
  }
69712
69655
  table.selectCell(targetCol, targetRow, e.shiftKey);
69713
69656
  if ((table.options.keyboardOptions?.moveEditCellOnArrowKeys ?? false) &&
69714
- table.editorManager.editingEditor) {
69657
+ table.editorManager?.editingEditor) {
69715
69658
  table.editorManager.completeEdit();
69716
69659
  table.getElement().focus();
69717
69660
  if (table.getEditor(targetCol, targetRow)) {
@@ -69723,7 +69666,7 @@
69723
69666
  table.editorManager.cancelEdit();
69724
69667
  }
69725
69668
  else if (e.key === 'Enter') {
69726
- if (table.editorManager.editingEditor) {
69669
+ if (table.editorManager?.editingEditor) {
69727
69670
  table.editorManager.completeEdit();
69728
69671
  table.getElement().focus();
69729
69672
  }
@@ -69761,7 +69704,7 @@
69761
69704
  targetCol = stateManager.select.cellPos.col + 1;
69762
69705
  }
69763
69706
  table.selectCell(targetCol, targetRow);
69764
- if (table.editorManager.editingEditor) {
69707
+ if (table.editorManager?.editingEditor) {
69765
69708
  table.editorManager.completeEdit();
69766
69709
  table.getElement().focus();
69767
69710
  if (table.getEditor(targetCol, targetRow)) {
@@ -69896,19 +69839,17 @@
69896
69839
  e.preventDefault();
69897
69840
  }
69898
69841
  });
69899
- if (!table.options.canvas) {
69900
- handler.on(table.getContainer(), 'resize', e => {
69901
- if (e.width === 0 && e.height === 0) {
69902
- return;
69903
- }
69904
- if (!isValid$1(table.options.pixelRatio)) {
69905
- table.setPixelRatio(getPixelRatio());
69906
- }
69907
- if (!e.windowSizeNotChange) {
69908
- table.resize();
69909
- }
69910
- });
69911
- }
69842
+ handler.on(table.getContainer(), 'resize', e => {
69843
+ if (e.width === 0 && e.height === 0) {
69844
+ return;
69845
+ }
69846
+ if (!isValid$1(table.options.pixelRatio)) {
69847
+ table.setPixelRatio(getPixelRatio());
69848
+ }
69849
+ if (!e.windowSizeNotChange) {
69850
+ table.resize();
69851
+ }
69852
+ });
69912
69853
  function pasteHtmlToTable(item) {
69913
69854
  const ranges = table.stateManager.select.ranges;
69914
69855
  const selectRangeLength = ranges.length;
@@ -70456,7 +70397,7 @@
70456
70397
  this.table = table;
70457
70398
  this.handleTextStickBindId = [];
70458
70399
  this.inertiaScroll = new InertiaScroll(table.stateManager);
70459
- if (Env.mode === 'node' || table.options.disableInteraction) {
70400
+ if (Env.mode === 'node') {
70460
70401
  return;
70461
70402
  }
70462
70403
  this.bindOuterEvent();
@@ -73043,7 +72984,6 @@
73043
72984
  }
73044
72985
 
73045
72986
  class FocusInput extends EventTarget {
73046
- _container;
73047
72987
  _table;
73048
72988
  _input;
73049
72989
  constructor(table, parentElement) {
@@ -73063,7 +73003,6 @@
73063
73003
  input.dataset.vtable = 'vtable';
73064
73004
  input.readOnly = true;
73065
73005
  parentElement.appendChild(div);
73066
- this._container = div;
73067
73006
  }
73068
73007
  focus() {
73069
73008
  this._input.focus({ preventScroll: true });
@@ -73083,7 +73022,6 @@
73083
73022
  return this._input;
73084
73023
  }
73085
73024
  release() {
73086
- this._container.parentElement?.removeChild(this._container);
73087
73025
  }
73088
73026
  }
73089
73027
 
@@ -73203,8 +73141,7 @@
73203
73141
  height: this.table.tableNoFrameHeight
73204
73142
  });
73205
73143
  const legend = new DiscreteLegend(merge({}, attrs, {
73206
- defaultSelected: this.selectedData,
73207
- disableTriggerEvent: this.table.options.disableInteraction
73144
+ defaultSelected: this.selectedData
73208
73145
  }));
73209
73146
  legend.name = 'legend';
73210
73147
  this.legendComponent = legend;
@@ -74766,249 +74703,6 @@
74766
74703
  return customTree;
74767
74704
  }
74768
74705
 
74769
- function getRowAt(absoluteY, _this) {
74770
- const frozen = _getTargetFrozenRowAt(_this, absoluteY);
74771
- if (frozen) {
74772
- return frozen;
74773
- }
74774
- let row = getTargetRowAt(absoluteY, _this);
74775
- if (!row) {
74776
- row = {
74777
- top: -1,
74778
- row: -1,
74779
- bottom: -1,
74780
- height: -1
74781
- };
74782
- }
74783
- return row;
74784
- }
74785
- function getColAt(absoluteX, _this) {
74786
- const frozen = _getTargetFrozenColAt(_this, absoluteX);
74787
- if (frozen) {
74788
- return frozen;
74789
- }
74790
- let col = getTargetColAt(absoluteX, _this);
74791
- if (!col) {
74792
- col = {
74793
- left: -1,
74794
- col: -1,
74795
- right: -1,
74796
- width: 1
74797
- };
74798
- }
74799
- return col;
74800
- }
74801
- function getCellAt(absoluteX, absoluteY, _this) {
74802
- const rowInfo = getRowAt(absoluteY, _this);
74803
- const { row, top, bottom, height } = rowInfo;
74804
- const colInfo = getColAt(absoluteX, _this);
74805
- const { col, left, right, width } = colInfo;
74806
- const rect = {
74807
- left,
74808
- right,
74809
- top,
74810
- bottom,
74811
- width,
74812
- height
74813
- };
74814
- return {
74815
- row,
74816
- col,
74817
- rect
74818
- };
74819
- }
74820
- function getTargetColAt(absoluteX, _this) {
74821
- if (absoluteX === 0) {
74822
- return { left: 0, col: 0, right: 0, width: 0 };
74823
- }
74824
- const findBefore = (startCol, startRight) => {
74825
- let right = startRight;
74826
- for (let col = startCol; col >= 0; col--) {
74827
- const width = _this.getColWidth(col);
74828
- const left = right - width;
74829
- if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
74830
- return {
74831
- left,
74832
- col,
74833
- right,
74834
- width
74835
- };
74836
- }
74837
- right = left;
74838
- }
74839
- return null;
74840
- };
74841
- const findAfter = (startCol, startRight) => {
74842
- let left = startRight - _this.getColWidth(startCol);
74843
- const { colCount } = _this.internalProps;
74844
- for (let col = startCol; col < colCount; col++) {
74845
- const width = _this.getColWidth(col);
74846
- const right = left + width;
74847
- if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
74848
- return {
74849
- left,
74850
- col,
74851
- right,
74852
- width
74853
- };
74854
- }
74855
- left = right;
74856
- }
74857
- return null;
74858
- };
74859
- const candCol = computeTargetColByX(absoluteX, _this);
74860
- const right = _this.getColsWidth(0, candCol);
74861
- if (absoluteX >= right) {
74862
- return findAfter(candCol, right);
74863
- }
74864
- return findBefore(candCol, right);
74865
- }
74866
- function getTargetRowAt(absoluteY, _this) {
74867
- if (absoluteY === 0) {
74868
- return { top: 0, row: 0, bottom: 0, height: 0 };
74869
- }
74870
- const findBefore = (startRow, startBottom) => {
74871
- let bottom = startBottom;
74872
- for (let row = startRow; row >= 0; row--) {
74873
- const height = _this.getRowHeight(row);
74874
- const top = bottom - height;
74875
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
74876
- return {
74877
- top,
74878
- row,
74879
- bottom,
74880
- height
74881
- };
74882
- }
74883
- bottom = top;
74884
- }
74885
- return null;
74886
- };
74887
- const findAfter = (startRow, startBottom) => {
74888
- let top = startBottom - _this.getRowHeight(startRow);
74889
- const { rowCount } = _this.internalProps;
74890
- for (let row = startRow; row < rowCount; row++) {
74891
- const height = _this.getRowHeight(row);
74892
- const bottom = top + height;
74893
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
74894
- return {
74895
- top,
74896
- row,
74897
- bottom,
74898
- height
74899
- };
74900
- }
74901
- top = bottom;
74902
- }
74903
- return null;
74904
- };
74905
- const candRow = computeTargetRowByY(absoluteY, _this);
74906
- const bottom = _this.getRowsHeight(0, candRow);
74907
- if (absoluteY >= bottom) {
74908
- return findAfter(candRow, bottom);
74909
- }
74910
- return findBefore(candRow, bottom);
74911
- }
74912
- function getTargetColAtConsiderRightFrozen(absoluteX, isConsider, _this) {
74913
- if (absoluteX === 0) {
74914
- return { left: 0, col: 0, right: 0, width: 0 };
74915
- }
74916
- if (isConsider &&
74917
- absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() &&
74918
- absoluteX < _this.tableNoFrameWidth) {
74919
- for (let i = 0; i < _this.rightFrozenColCount; i++) {
74920
- if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) {
74921
- return {
74922
- col: _this.colCount - i - 1,
74923
- left: undefined,
74924
- right: undefined,
74925
- width: undefined
74926
- };
74927
- }
74928
- }
74929
- }
74930
- return getTargetColAt(absoluteX, _this);
74931
- }
74932
- function getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider, _this) {
74933
- if (absoluteY === 0) {
74934
- return { top: 0, row: 0, bottom: 0, height: 0 };
74935
- }
74936
- if (isConsider &&
74937
- absoluteY > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() &&
74938
- absoluteY < _this.tableNoFrameHeight) {
74939
- for (let i = 0; i < _this.rightFrozenColCount; i++) {
74940
- if (absoluteY > _this.tableNoFrameHeight - _this.getRowsHeight(_this.rowCount - i - 1, _this.rowCount - 1)) {
74941
- return {
74942
- row: _this.rowCount - i - 1,
74943
- top: undefined,
74944
- bottom: undefined,
74945
- height: undefined
74946
- };
74947
- }
74948
- }
74949
- }
74950
- return getTargetRowAt(absoluteY, _this);
74951
- }
74952
- function computeTargetRowByY(absoluteY, _this) {
74953
- let defaultRowHeight = _this.internalProps.defaultRowHeight;
74954
- if (_this._rowRangeHeightsMap.get(`$0$${_this.rowCount - 1}`)) {
74955
- defaultRowHeight = _this._rowRangeHeightsMap.get(`$0$${_this.rowCount - 1}`) / _this.rowCount;
74956
- }
74957
- return Math.min(Math.ceil(absoluteY / defaultRowHeight), _this.rowCount - 1);
74958
- }
74959
- function computeTargetColByX(absoluteX, _this) {
74960
- if (_this._colRangeWidthsMap.get(`$0$${_this.colCount - 1}`)) {
74961
- let startCol = 0;
74962
- let endCol = _this.colCount - 1;
74963
- while (endCol - startCol > 1) {
74964
- const midCol = Math.floor((startCol + endCol) / 2);
74965
- if (absoluteX < _this._colRangeWidthsMap.get(`$0$${midCol}`)) {
74966
- endCol = midCol;
74967
- }
74968
- else if (absoluteX > _this._colRangeWidthsMap.get(`$0$${midCol}`)) {
74969
- startCol = midCol;
74970
- }
74971
- else {
74972
- return midCol;
74973
- }
74974
- }
74975
- return endCol;
74976
- }
74977
- return Math.min(Math.ceil(absoluteX / _this.internalProps.defaultColWidth), _this.colCount - 1);
74978
- }
74979
- function getCellAtRelativePosition(x, y, _this) {
74980
- x -= _this.tableX;
74981
- y -= _this.tableY;
74982
- let bottomFrozen = false;
74983
- if (y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight) {
74984
- bottomFrozen = true;
74985
- }
74986
- let rightFrozen = false;
74987
- if (x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth) {
74988
- rightFrozen = true;
74989
- }
74990
- const colInfo = getTargetColAtConsiderRightFrozen(rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this);
74991
- const rowInfo = getTargetRowAtConsiderBottomFrozen(bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);
74992
- if (!colInfo || !rowInfo) {
74993
- return undefined;
74994
- }
74995
- const { row, top, bottom, height } = rowInfo;
74996
- const { col, left, right, width } = colInfo;
74997
- const rect = {
74998
- left,
74999
- right,
75000
- top,
75001
- bottom,
75002
- width,
75003
- height
75004
- };
75005
- return {
75006
- row,
75007
- col,
75008
- rect
75009
- };
75010
- }
75011
-
75012
74706
  const { toBoxArray } = style;
75013
74707
  const { isTouchEvent } = event;
75014
74708
  const rangeReg = /^\$(\d+)\$(\d+)$/;
@@ -75041,7 +74735,7 @@
75041
74735
  return TABLE_EVENT_TYPE;
75042
74736
  }
75043
74737
  options;
75044
- version = "1.4.1-beta.0";
74738
+ version = "1.4.1";
75045
74739
  pagination;
75046
74740
  id = `VTable${Date.now()}`;
75047
74741
  headerStyleCache;
@@ -75056,7 +74750,7 @@
75056
74750
  _hasAutoImageColumn;
75057
74751
  constructor(container, options = {}) {
75058
74752
  super();
75059
- if (!container && options.mode !== 'node' && !options.canvas) {
74753
+ if (!container && options.mode !== 'node') {
75060
74754
  throw new Error("vtable's container is undefined");
75061
74755
  }
75062
74756
  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;
@@ -75094,14 +74788,7 @@
75094
74788
  if (typeof allowFrozenColCount === 'number' && allowFrozenColCount <= 0) {
75095
74789
  this.showFrozenIcon = false;
75096
74790
  }
75097
- if (this.options.canvas) {
75098
- internalProps.element = this.options.canvas.parentElement;
75099
- internalProps.element.style.position = 'relative';
75100
- internalProps.focusControl = new FocusInput(this, internalProps.element);
75101
- internalProps.canvas = this.options.canvas;
75102
- internalProps.context = internalProps.canvas.getContext('2d');
75103
- }
75104
- else if (Env.mode !== 'node') {
74791
+ if (Env.mode !== 'node') {
75105
74792
  internalProps.element = createRootElement(this.padding);
75106
74793
  internalProps.focusControl = new FocusInput(this, internalProps.element);
75107
74794
  internalProps.canvas = document.createElement('canvas');
@@ -75506,21 +75193,7 @@
75506
75193
  const { padding } = this;
75507
75194
  let widthP = 0;
75508
75195
  let heightP = 0;
75509
- this.tableX = 0;
75510
- this.tableY = 0;
75511
- if (this.options.canvas && this.options.viewBox) {
75512
- widthP = this.options.viewBox.x2 - this.options.viewBox.x1;
75513
- heightP = this.options.viewBox.y2 - this.options.viewBox.y1;
75514
- if (this?.scenegraph?.stage) {
75515
- if (this.options.viewBox) {
75516
- this.scenegraph.stage.setViewBox(this.options.viewBox, false);
75517
- }
75518
- else {
75519
- this.scenegraph.stage.resize(widthP, heightP);
75520
- }
75521
- }
75522
- }
75523
- else if (Env.mode === 'browser') {
75196
+ if (Env.mode === 'browser') {
75524
75197
  const element = this.getElement();
75525
75198
  let widthWithoutPadding = 0;
75526
75199
  let heightWithoutPadding = 0;
@@ -75587,23 +75260,6 @@
75587
75260
  }
75588
75261
  }
75589
75262
  }
75590
- updateViewBox(newViewBox) {
75591
- const oldWidth = this.options?.viewBox.x2 ?? 0 - this.options?.viewBox.x1 ?? 0;
75592
- const oldHeight = this.options?.viewBox.y2 ?? 0 - this.options?.viewBox.y1 ?? 0;
75593
- const newWidth = newViewBox.x2 - newViewBox.x1;
75594
- const newHeight = newViewBox.y2 - newViewBox.y1;
75595
- this.options.viewBox = newViewBox;
75596
- if (oldWidth !== newWidth || oldHeight !== newHeight) {
75597
- this.resize();
75598
- }
75599
- else {
75600
- this.scenegraph.stage.setViewBox(this.options.viewBox, true);
75601
- }
75602
- }
75603
- setViewBoxTransform(a, b, c, d, e, f) {
75604
- this.internalProps.modifiedViewBoxTransform = true;
75605
- this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
75606
- }
75607
75263
  get rowHierarchyType() {
75608
75264
  return 'grid';
75609
75265
  }
@@ -76064,16 +75720,55 @@
76064
75720
  return null;
76065
75721
  }
76066
75722
  getRowAt(absoluteY) {
76067
- return getRowAt(absoluteY, this);
75723
+ const frozen = _getTargetFrozenRowAt(this, absoluteY);
75724
+ if (frozen) {
75725
+ return frozen;
75726
+ }
75727
+ let row = this.getTargetRowAt(absoluteY);
75728
+ if (!row) {
75729
+ row = {
75730
+ top: -1,
75731
+ row: -1,
75732
+ bottom: -1,
75733
+ height: -1
75734
+ };
75735
+ }
75736
+ return row;
76068
75737
  }
76069
75738
  getColAt(absoluteX) {
76070
- return getColAt(absoluteX, this);
75739
+ const frozen = _getTargetFrozenColAt(this, absoluteX);
75740
+ if (frozen) {
75741
+ return frozen;
75742
+ }
75743
+ let col = this.getTargetColAt(absoluteX);
75744
+ if (!col) {
75745
+ col = {
75746
+ left: -1,
75747
+ col: -1,
75748
+ right: -1,
75749
+ width: 1
75750
+ };
75751
+ }
75752
+ return col;
76071
75753
  }
76072
75754
  getCellAt(absoluteX, absoluteY) {
76073
- return getCellAt(absoluteX, absoluteY, this);
76074
- }
76075
- getCellAtRelativePosition(relativeX, relativeY) {
76076
- return getCellAtRelativePosition(relativeX, relativeY, this);
75755
+ const rowInfo = this.getRowAt(absoluteY);
75756
+ const { row, top, bottom, height } = rowInfo;
75757
+ const colInfo = this.getColAt(absoluteX);
75758
+ const { col, left, right, width } = colInfo;
75759
+ const rect = {
75760
+ left,
75761
+ right,
75762
+ top,
75763
+ bottom,
75764
+ width,
75765
+ height
75766
+ };
75767
+ return {
75768
+ row,
75769
+ col,
75770
+ rect
75771
+ };
76077
75772
  }
76078
75773
  _checkRowCol(col, row) {
76079
75774
  if (col >= 0 && col < this.colCount && row >= 0 && row < this.rowCount) {
@@ -76128,8 +75823,6 @@
76128
75823
  const visibleRect = this.getVisibleRect();
76129
75824
  rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0));
76130
75825
  rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0));
76131
- rect.offsetLeft(this.options.viewBox?.x1 ?? 0);
76132
- rect.offsetTop(this.options.viewBox?.y1 ?? 0);
76133
75826
  return rect;
76134
75827
  }
76135
75828
  getVisibleRect() {
@@ -76289,9 +75982,8 @@
76289
75982
  }
76290
75983
  this.scenegraph.stage.release();
76291
75984
  this.scenegraph.proxy.release();
76292
- internalProps.focusControl.release();
76293
75985
  const { parentElement } = internalProps.element;
76294
- if (parentElement && !this.options.canvas) {
75986
+ if (parentElement) {
76295
75987
  parentElement.removeChild(internalProps.element);
76296
75988
  }
76297
75989
  this.editorManager?.editingEditor?.onEnd?.();
@@ -76335,7 +76027,7 @@
76335
76027
  this.autoFillHeight = autoFillHeight ?? false;
76336
76028
  this.customRender = customRender;
76337
76029
  const internalProps = this.internalProps;
76338
- if (Env.mode !== 'node' && !options.canvas) {
76030
+ if (Env.mode !== 'node') {
76339
76031
  updateRootElementPadding(internalProps.element, this.padding);
76340
76032
  }
76341
76033
  this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
@@ -76514,29 +76206,171 @@
76514
76206
  const currentHeight = rect.height;
76515
76207
  const originHeight = this.canvas.offsetHeight || currentHeight;
76516
76208
  const heightRatio = currentHeight / originHeight;
76517
- const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0) - (this.options.viewBox?.x1 ?? 0);
76518
- const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0) - (this.options.viewBox?.y1 ?? 0);
76519
- const point = { x, y, inTable };
76520
- if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
76521
- const transform = this.scenegraph.stage.window.getViewBoxTransform();
76522
- transform.transformPoint(point, point);
76523
- }
76524
- return point;
76209
+ const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0);
76210
+ const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0);
76211
+ return { x, y, inTable };
76525
76212
  }
76526
76213
  getTheme() {
76527
76214
  return this.internalProps.theme;
76528
76215
  }
76529
76216
  getTargetColAt(absoluteX) {
76530
- return getTargetColAt(absoluteX, this);
76217
+ if (absoluteX === 0) {
76218
+ return { left: 0, col: 0, right: 0, width: 0 };
76219
+ }
76220
+ const findBefore = (startCol, startRight) => {
76221
+ let right = startRight;
76222
+ for (let col = startCol; col >= 0; col--) {
76223
+ const width = this.getColWidth(col);
76224
+ const left = right - width;
76225
+ if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
76226
+ return {
76227
+ left,
76228
+ col,
76229
+ right,
76230
+ width
76231
+ };
76232
+ }
76233
+ right = left;
76234
+ }
76235
+ return null;
76236
+ };
76237
+ const findAfter = (startCol, startRight) => {
76238
+ let left = startRight - this.getColWidth(startCol);
76239
+ const { colCount } = this.internalProps;
76240
+ for (let col = startCol; col < colCount; col++) {
76241
+ const width = this.getColWidth(col);
76242
+ const right = left + width;
76243
+ if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) {
76244
+ return {
76245
+ left,
76246
+ col,
76247
+ right,
76248
+ width
76249
+ };
76250
+ }
76251
+ left = right;
76252
+ }
76253
+ return null;
76254
+ };
76255
+ const candCol = this.computeTargetColByX(absoluteX);
76256
+ const right = this.getColsWidth(0, candCol);
76257
+ if (absoluteX >= right) {
76258
+ return findAfter(candCol, right);
76259
+ }
76260
+ return findBefore(candCol, right);
76531
76261
  }
76532
76262
  getTargetRowAt(absoluteY) {
76533
- return getTargetRowAt(absoluteY, this);
76263
+ if (absoluteY === 0) {
76264
+ return { top: 0, row: 0, bottom: 0, height: 0 };
76265
+ }
76266
+ const findBefore = (startRow, startBottom) => {
76267
+ let bottom = startBottom;
76268
+ for (let row = startRow; row >= 0; row--) {
76269
+ const height = this.getRowHeight(row);
76270
+ const top = bottom - height;
76271
+ if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
76272
+ return {
76273
+ top,
76274
+ row,
76275
+ bottom,
76276
+ height
76277
+ };
76278
+ }
76279
+ bottom = top;
76280
+ }
76281
+ return null;
76282
+ };
76283
+ const findAfter = (startRow, startBottom) => {
76284
+ let top = startBottom - this.getRowHeight(startRow);
76285
+ const { rowCount } = this.internalProps;
76286
+ for (let row = startRow; row < rowCount; row++) {
76287
+ const height = this.getRowHeight(row);
76288
+ const bottom = top + height;
76289
+ if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) {
76290
+ return {
76291
+ top,
76292
+ row,
76293
+ bottom,
76294
+ height
76295
+ };
76296
+ }
76297
+ top = bottom;
76298
+ }
76299
+ return null;
76300
+ };
76301
+ const candRow = this.computeTargetRowByY(absoluteY);
76302
+ const bottom = this.getRowsHeight(0, candRow);
76303
+ if (absoluteY >= bottom) {
76304
+ return findAfter(candRow, bottom);
76305
+ }
76306
+ return findBefore(candRow, bottom);
76534
76307
  }
76535
76308
  getTargetColAtConsiderRightFrozen(absoluteX, isConsider) {
76536
- return getTargetColAtConsiderRightFrozen(absoluteX, isConsider, this);
76309
+ if (absoluteX === 0) {
76310
+ return { left: 0, col: 0, right: 0, width: 0 };
76311
+ }
76312
+ if (isConsider &&
76313
+ absoluteX > this.tableNoFrameWidth - this.getRightFrozenColsWidth() &&
76314
+ absoluteX < this.tableNoFrameWidth) {
76315
+ for (let i = 0; i < this.rightFrozenColCount; i++) {
76316
+ if (absoluteX > this.tableNoFrameWidth - this.getColsWidth(this.colCount - i - 1, this.colCount - 1)) {
76317
+ return {
76318
+ col: this.colCount - i - 1,
76319
+ left: undefined,
76320
+ right: undefined,
76321
+ width: undefined
76322
+ };
76323
+ }
76324
+ }
76325
+ }
76326
+ return this.getTargetColAt(absoluteX);
76537
76327
  }
76538
76328
  getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider) {
76539
- return getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider, this);
76329
+ if (absoluteY === 0) {
76330
+ return { top: 0, row: 0, bottom: 0, height: 0 };
76331
+ }
76332
+ if (isConsider &&
76333
+ absoluteY > this.tableNoFrameHeight - this.getBottomFrozenRowsHeight() &&
76334
+ absoluteY < this.tableNoFrameHeight) {
76335
+ for (let i = 0; i < this.rightFrozenColCount; i++) {
76336
+ if (absoluteY > this.tableNoFrameHeight - this.getRowsHeight(this.rowCount - i - 1, this.rowCount - 1)) {
76337
+ return {
76338
+ row: this.rowCount - i - 1,
76339
+ top: undefined,
76340
+ bottom: undefined,
76341
+ height: undefined
76342
+ };
76343
+ }
76344
+ }
76345
+ }
76346
+ return this.getTargetRowAt(absoluteY);
76347
+ }
76348
+ computeTargetRowByY(absoluteY) {
76349
+ let defaultRowHeight = this.internalProps.defaultRowHeight;
76350
+ if (this._rowRangeHeightsMap.get(`$0$${this.rowCount - 1}`)) {
76351
+ defaultRowHeight = this._rowRangeHeightsMap.get(`$0$${this.rowCount - 1}`) / this.rowCount;
76352
+ }
76353
+ return Math.min(Math.ceil(absoluteY / defaultRowHeight), this.rowCount - 1);
76354
+ }
76355
+ computeTargetColByX(absoluteX) {
76356
+ if (this._colRangeWidthsMap.get(`$0$${this.colCount - 1}`)) {
76357
+ let startCol = 0;
76358
+ let endCol = this.colCount - 1;
76359
+ while (endCol - startCol > 1) {
76360
+ const midCol = Math.floor((startCol + endCol) / 2);
76361
+ if (absoluteX < this._colRangeWidthsMap.get(`$0$${midCol}`)) {
76362
+ endCol = midCol;
76363
+ }
76364
+ else if (absoluteX > this._colRangeWidthsMap.get(`$0$${midCol}`)) {
76365
+ startCol = midCol;
76366
+ }
76367
+ else {
76368
+ return midCol;
76369
+ }
76370
+ }
76371
+ return endCol;
76372
+ }
76373
+ return Math.min(Math.ceil(absoluteX / this.internalProps.defaultColWidth), this.colCount - 1);
76540
76374
  }
76541
76375
  clearSelected() {
76542
76376
  this.stateManager.updateSelectPos(-1, -1);
@@ -87708,14 +87542,6 @@
87708
87542
  updateChartData(this.scenegraph);
87709
87543
  this.render();
87710
87544
  }
87711
- clearChartCacheImage(col, row) {
87712
- if (isNumber$2(col) && isNumber$2(row)) {
87713
- clearCellChartCacheImage(col, row, this.scenegraph);
87714
- }
87715
- else {
87716
- clearChartCacheImage(this.scenegraph);
87717
- }
87718
- }
87719
87545
  getLegendSelected() {
87720
87546
  const selected = [];
87721
87547
  this.internalProps.legends?.forEach(legend => {
@@ -88509,7 +88335,7 @@
88509
88335
  }
88510
88336
 
88511
88337
  registerForVrender();
88512
- const version = "1.4.1-beta.0";
88338
+ const version = "1.4.1";
88513
88339
  function getIcons() {
88514
88340
  return get$2();
88515
88341
  }