@visactor/vtable 1.5.5-beta.0 → 1.5.5

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 (99) 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 +0 -3
  9. package/cjs/core/BaseTable.js +24 -44
  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/core/utils/get-cell-position.d.ts +25 -5
  17. package/cjs/core/utils/get-cell-position.js.map +1 -1
  18. package/cjs/event/event.js +1 -2
  19. package/cjs/event/event.js.map +1 -1
  20. package/cjs/event/listener/container-dom.js +1 -1
  21. package/cjs/event/listener/container-dom.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 +16 -56
  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 +3 -9
  41. package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
  42. package/cjs/scenegraph/scenegraph.js +5 -11
  43. package/cjs/scenegraph/scenegraph.js.map +1 -1
  44. package/cjs/state/state.js +1 -1
  45. package/cjs/tools/helper.js.map +1 -1
  46. package/cjs/ts-types/base-table.d.ts +1 -12
  47. package/cjs/ts-types/base-table.js.map +1 -1
  48. package/cjs/vrender.js.map +1 -1
  49. package/dist/vtable.js +114 -289
  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 +0 -3
  59. package/es/core/BaseTable.js +23 -43
  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/core/utils/get-cell-position.d.ts +25 -5
  67. package/es/core/utils/get-cell-position.js.map +1 -1
  68. package/es/event/event.js +1 -2
  69. package/es/event/event.js.map +1 -1
  70. package/es/event/listener/container-dom.js +1 -1
  71. package/es/event/listener/container-dom.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 +15 -57
  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 +5 -11
  93. package/es/scenegraph/scenegraph.js.map +1 -1
  94. package/es/state/state.js +1 -1
  95. package/es/tools/helper.js.map +1 -1
  96. package/es/ts-types/base-table.d.ts +1 -12
  97. package/es/ts-types/base-table.js.map +1 -1
  98. package/es/vrender.js.map +1 -1
  99. package/package.json +3 -3
package/dist/vtable.js CHANGED
@@ -44372,11 +44372,9 @@
44372
44372
  }
44373
44373
  function getPromiseValue(value, callback) {
44374
44374
  if (isPromise(value)) {
44375
- value
44376
- .then(result => {
44375
+ value.then(result => {
44377
44376
  callback(result);
44378
- })
44379
- .catch((err) => {
44377
+ }).catch((err) => {
44380
44378
  });
44381
44379
  }
44382
44380
  else {
@@ -49121,8 +49119,8 @@
49121
49119
  function getCellEventArgsSet(e) {
49122
49120
  const tableEvent = {
49123
49121
  abstractPos: {
49124
- x: e.viewport.x,
49125
- y: e.viewport.y
49122
+ x: e.x,
49123
+ y: e.y
49126
49124
  }
49127
49125
  };
49128
49126
  const targetCell = getTargetCell(e.target);
@@ -54761,7 +54759,7 @@
54761
54759
  this.numberType = CHART_NUMBER_TYPE;
54762
54760
  this.isShareChartSpec = isShareChartSpec;
54763
54761
  if (!params.chartInstance) {
54764
- const chartInstance = (this.chartInstance = new params.ClassType(params.spec, merge({}, this.attribute.tableChartOption, {
54762
+ const chartInstance = new params.ClassType(params.spec, {
54765
54763
  renderCanvas: params.canvas,
54766
54764
  mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
54767
54765
  modeParams: this.attribute.modeParams,
@@ -54771,9 +54769,8 @@
54771
54769
  interactive: false,
54772
54770
  animation: false,
54773
54771
  autoFit: false
54774
- })));
54772
+ });
54775
54773
  chartInstance.renderSync();
54776
- chartInstance.getStage().enableDirtyBounds();
54777
54774
  params.chartInstance = this.chartInstance = chartInstance;
54778
54775
  }
54779
54776
  else {
@@ -54791,53 +54788,34 @@
54791
54788
  y1: y1 - table.scrollTop,
54792
54789
  y2: y2 - table.scrollTop
54793
54790
  });
54794
- this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge({}, this.attribute.tableChartOption, {
54791
+ this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
54795
54792
  renderCanvas: this.attribute.canvas,
54796
54793
  mode: 'desktop-browser',
54797
54794
  canvasControled: false,
54798
54795
  viewBox: {
54799
- x1: 0,
54800
- x2: x2 - x1,
54801
- y1: 0,
54802
- y2: y2 - y1
54796
+ x1: x1 - table.scrollLeft,
54797
+ x2: x2 - table.scrollLeft,
54798
+ y1: y1 - table.scrollTop,
54799
+ y2: y2 - table.scrollTop
54803
54800
  },
54804
54801
  dpr: table.internalProps.pixelRatio,
54805
54802
  animation: false,
54806
54803
  interactive: true,
54807
54804
  autoFit: false,
54808
- beforeRender: (chartStage) => {
54809
- const stage = this.stage;
54810
- const ctx = chartStage.window.getContext();
54811
- const stageMatrix = stage.window.getViewBoxTransform();
54812
- const viewBox = stage.window.getViewBox();
54805
+ beforeRender: (stage) => {
54806
+ const ctx = stage.window.getContext();
54813
54807
  ctx.inuse = true;
54814
54808
  ctx.clearMatrix();
54815
- ctx.setTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f, true);
54816
- ctx.translate(viewBox.x1, viewBox.y1);
54817
54809
  ctx.setTransformForCurrent(true);
54818
54810
  ctx.beginPath();
54819
54811
  ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
54820
54812
  ctx.clip();
54821
- ctx.clearMatrix();
54822
- if (!chartStage.needRender) {
54823
- chartStage.pauseRender();
54824
- table.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds);
54825
- table.scenegraph.updateNextFrame();
54826
- }
54827
54813
  },
54828
54814
  afterRender(stage) {
54829
54815
  const ctx = stage.window.getContext();
54830
54816
  ctx.inuse = false;
54831
- stage.needRender = false;
54832
- chartStage.resumeRender();
54833
54817
  }
54834
- }));
54835
- const chartStage = this.activeChartInstance.getStage();
54836
- const matrix = this.globalTransMatrix.clone();
54837
- const stageMatrix = this.stage.window.getViewBoxTransform();
54838
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
54839
- chartStage.window.setViewBoxTransform &&
54840
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
54818
+ });
54841
54819
  this.activeChartInstance.renderSync();
54842
54820
  table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
54843
54821
  this.activeChartInstance.on('click', (params) => {
@@ -54873,12 +54851,11 @@
54873
54851
  const cellGroup = this.parent;
54874
54852
  const padding = this.attribute.cellPadding;
54875
54853
  const table = this.stage.table;
54876
- const { x1, y1, x2, y2 } = cellGroup.globalAABBBounds;
54877
54854
  return {
54878
- x1: Math.ceil(x1 + padding[3] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
54879
- x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft + (table.options.viewBox?.x1 ?? 0)),
54880
- y1: Math.ceil(y1 + padding[0] + table.scrollTop + (table.options.viewBox?.y1 ?? 0)),
54881
- y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop + (table.options.viewBox?.y1 ?? 0))
54855
+ x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
54856
+ x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
54857
+ y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
54858
+ y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
54882
54859
  };
54883
54860
  }
54884
54861
  }
@@ -54909,10 +54886,6 @@
54909
54886
  bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
54910
54887
  bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
54911
54888
  }
54912
- bodyBound.x1 = bodyBound.x1 + (table.options.viewBox?.x1 ?? 0);
54913
- bodyBound.x2 = bodyBound.x2 + (table.options.viewBox?.x1 ?? 0);
54914
- bodyBound.y1 = bodyBound.y1 + (table.options.viewBox?.y1 ?? 0);
54915
- bodyBound.y2 = bodyBound.y2 + (table.options.viewBox?.y1 ?? 0);
54916
54889
  return bodyBound;
54917
54890
  }
54918
54891
 
@@ -54953,65 +54926,46 @@
54953
54926
  if (viewBox.y2 <= viewBox.y1) {
54954
54927
  viewBox.y2 = viewBox.y1 + 1;
54955
54928
  }
54956
- chartInstance.updateViewBox({
54957
- x1: 0,
54958
- x2: viewBox.x2 - viewBox.x1,
54959
- y1: 0,
54960
- y2: viewBox.y2 - viewBox.y1
54961
- }, false, false);
54962
- const chartStage = chartInstance.getStage();
54963
- const matrix = chart.globalTransMatrix.clone();
54964
- const stageMatrix = chart.stage.window.getViewBoxTransform();
54965
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
54966
- chartStage.window.setViewBoxTransform &&
54967
- chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
54968
- const { table } = chart.getRootNode();
54969
- let updateSpec = false;
54970
- if (table.options.specFormat) {
54971
- const formatResult = table.options.specFormat(chart.attribute.spec);
54972
- if (formatResult.needFormatSpec && formatResult.spec) {
54973
- const spec = formatResult.spec;
54974
- chartInstance.updateSpecSync(spec);
54975
- updateSpec = true;
54976
- }
54977
- }
54978
- if (!updateSpec) {
54979
- axes?.forEach((axis, index) => {
54980
- if (axis.type === 'band') {
54981
- chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
54982
- }
54983
- else {
54984
- chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
54985
- }
54986
- });
54987
- table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
54988
- if (typeof dataId === 'string') {
54989
- chartInstance.updateDataSync(dataId, data ?? []);
54929
+ axes?.forEach((axis, index) => {
54930
+ if (axis.type === 'band') {
54931
+ chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
54990
54932
  }
54991
54933
  else {
54992
- const dataBatch = [];
54993
- for (const dataIdStr in dataId) {
54994
- const dataIdAndField = dataId[dataIdStr];
54995
- const series = spec.series.find((item) => item?.data?.id === dataIdStr);
54996
- dataBatch.push({
54997
- id: dataIdStr,
54998
- values: dataIdAndField
54999
- ? data?.filter((item) => {
55000
- return item.hasOwnProperty(dataIdAndField);
55001
- }) ?? []
55002
- : data ?? [],
55003
- fields: series?.data?.fields
55004
- });
55005
- if (!chartInstance.updateFullDataSync) {
55006
- chartInstance.updateDataSync(dataIdStr, dataIdAndField
55007
- ? data?.filter((item) => {
55008
- return item.hasOwnProperty(dataIdAndField);
55009
- }) ?? []
55010
- : data ?? []);
55011
- }
54934
+ chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
54935
+ }
54936
+ });
54937
+ chartInstance.updateViewBox({
54938
+ x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
54939
+ x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
54940
+ y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
54941
+ y2: viewBox.y2 - chart.getRootNode().table.scrollTop
54942
+ }, false, false);
54943
+ if (typeof dataId === 'string') {
54944
+ chartInstance.updateDataSync(dataId, data ?? []);
54945
+ }
54946
+ else {
54947
+ const dataBatch = [];
54948
+ for (const dataIdStr in dataId) {
54949
+ const dataIdAndField = dataId[dataIdStr];
54950
+ const series = spec.series.find((item) => item?.data?.id === dataIdStr);
54951
+ dataBatch.push({
54952
+ id: dataIdStr,
54953
+ values: dataIdAndField
54954
+ ? data?.filter((item) => {
54955
+ return item.hasOwnProperty(dataIdAndField);
54956
+ }) ?? []
54957
+ : data ?? [],
54958
+ fields: series?.data?.fields
54959
+ });
54960
+ if (!chartInstance.updateFullDataSync) {
54961
+ chartInstance.updateDataSync(dataIdStr, dataIdAndField
54962
+ ? data?.filter((item) => {
54963
+ return item.hasOwnProperty(dataIdAndField);
54964
+ }) ?? []
54965
+ : data ?? []);
55012
54966
  }
55013
- chartInstance.updateFullDataSync?.(dataBatch);
55014
54967
  }
54968
+ chartInstance.updateFullDataSync?.(dataBatch);
55015
54969
  }
55016
54970
  const sg = chartInstance.getStage();
55017
54971
  cacheStageCanvas(sg, chart);
@@ -55038,7 +54992,7 @@
55038
54992
  function cacheStageCanvas(stage, chart) {
55039
54993
  const { viewWidth, viewHeight } = stage;
55040
54994
  if (viewWidth < cacheCanvasSizeLimit && viewHeight < cacheCanvasSizeLimit) {
55041
- chart.cacheCanvas = toCanvas(stage);
54995
+ chart.cacheCanvas = stage.toCanvas();
55042
54996
  if (!chart.isShareChartSpec) {
55043
54997
  chart.chartInstance?.release();
55044
54998
  chart.chartInstance = null;
@@ -55059,7 +55013,7 @@
55059
55013
  const height = endY - startY;
55060
55014
  const bounds = new Bounds();
55061
55015
  bounds.setValue(startX, startY, endX, endY);
55062
- const canvas = toCanvas(stage, false, bounds);
55016
+ const canvas = stage.toCanvas(false, bounds);
55063
55017
  cacheCanvas.push({
55064
55018
  canvas,
55065
55019
  x: startX,
@@ -55071,57 +55025,9 @@
55071
55025
  }
55072
55026
  chart.cacheCanvas = cacheCanvas;
55073
55027
  }
55074
- function toCanvas(stage, fullImage = true, viewBox) {
55075
- if (stage.releaseStatus === 'released') {
55076
- return null;
55077
- }
55078
- const matrix = stage.window.getViewBoxTransform();
55079
- const window = renderToNewWindow(stage, fullImage, viewBox);
55080
- window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, 0, 0);
55081
- stage.renderTo(window);
55082
- const c = window.getNativeHandler();
55083
- if (c.nativeCanvas) {
55084
- return c.nativeCanvas;
55085
- }
55086
- return null;
55087
- }
55088
- function renderToNewWindow(stage, fullImage = true, viewBox) {
55089
- const matrix = stage.window.getViewBoxTransform();
55090
- const window = container.get(VWindow);
55091
- const x1 = viewBox ? -viewBox.x1 : 0;
55092
- const y1 = viewBox ? -viewBox.y1 : 0;
55093
- const x2 = viewBox ? viewBox.x2 : stage.viewWidth;
55094
- const y2 = viewBox ? viewBox.y2 : stage.viewHeight;
55095
- const width = viewBox ? viewBox.width() : stage.viewWidth;
55096
- const height = viewBox ? viewBox.height() : stage.viewHeight;
55097
- if (fullImage) {
55098
- window.create({
55099
- viewBox: { x1, y1, x2, y2 },
55100
- width: width * matrix.a,
55101
- height: height * matrix.d,
55102
- dpr: stage.window.dpr,
55103
- canvasControled: true,
55104
- offscreen: true,
55105
- title: ''
55106
- });
55107
- }
55108
- else {
55109
- window.create({
55110
- viewBox: { x1, y1, x2, y2 },
55111
- width: width * matrix.a,
55112
- height: height * matrix.d,
55113
- dpr: stage.window.dpr,
55114
- canvasControled: true,
55115
- offscreen: true,
55116
- title: ''
55117
- });
55118
- }
55119
- stage.renderTo(window);
55120
- return window;
55121
- }
55122
55028
 
55123
55029
  const ChartRender = Symbol.for('ChartRender');
55124
- let DefaultCanvasChartRender = class DefaultCanvasChartRender extends BaseRender {
55030
+ let DefaultCanvasChartRender = class DefaultCanvasChartRender {
55125
55031
  type;
55126
55032
  numberType = CHART_NUMBER_TYPE;
55127
55033
  drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
@@ -55129,7 +55035,6 @@
55129
55035
  const { dataId, data, spec } = chart.attribute;
55130
55036
  chart.getViewBox();
55131
55037
  const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
55132
- const { table } = chart.getRootNode();
55133
55038
  const { active, cacheCanvas, activeChartInstance } = chart;
55134
55039
  if (!active && cacheCanvas) {
55135
55040
  if (isArray$1(cacheCanvas)) {
@@ -55143,27 +55048,6 @@
55143
55048
  }
55144
55049
  }
55145
55050
  else if (activeChartInstance) {
55146
- if (table.options.specFormat) {
55147
- const formatResult = table.options.specFormat(chart.attribute.spec);
55148
- if (formatResult.needFormatSpec && formatResult.spec) {
55149
- const spec = formatResult.spec;
55150
- activeChartInstance.updateSpecSync(spec);
55151
- return;
55152
- }
55153
- }
55154
- const viewBox = chart.getViewBox();
55155
- activeChartInstance.updateViewBox({
55156
- x1: 0,
55157
- x2: viewBox.x2 - viewBox.x1,
55158
- y1: 0,
55159
- y2: viewBox.y2 - viewBox.y1
55160
- }, false, false);
55161
- const chartStage = activeChartInstance.getStage();
55162
- chartStage.needRender = true;
55163
- const matrix = chart.globalTransMatrix.clone();
55164
- const stageMatrix = chart.stage.window.getViewBoxTransform().clone();
55165
- stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
55166
- chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
55167
55051
  if (typeof dataId === 'string') {
55168
55052
  activeChartInstance.updateDataSync(dataId, data ?? []);
55169
55053
  }
@@ -55193,13 +55077,13 @@
55193
55077
  }
55194
55078
  }
55195
55079
  else {
55196
- if (table.internalProps.renderChartAsync) {
55080
+ if (chart.getRootNode().table.internalProps.renderChartAsync) {
55197
55081
  if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {
55198
55082
  chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);
55199
55083
  chartRenderQueueList.push(chart);
55200
55084
  }
55201
55085
  if (!IsHandlingChartQueue()) {
55202
- startRenderChartQueue(table);
55086
+ startRenderChartQueue(chart.getRootNode().table);
55203
55087
  }
55204
55088
  }
55205
55089
  else {
@@ -55208,7 +55092,31 @@
55208
55092
  }
55209
55093
  }
55210
55094
  draw(chart, renderService, drawContext, params) {
55211
- this._draw(chart, {}, false, drawContext, params);
55095
+ const { context } = drawContext;
55096
+ if (!context) {
55097
+ return;
55098
+ }
55099
+ const { clip } = chart.attribute;
55100
+ if (clip) {
55101
+ context.save();
55102
+ }
55103
+ else {
55104
+ context.highPerformanceSave();
55105
+ }
55106
+ context.transformFromMatrix(chart.transMatrix, true);
55107
+ context.beginPath();
55108
+ if (params.skipDraw) {
55109
+ this.drawShape(chart, context, 0, 0, drawContext, params, () => false, () => false);
55110
+ }
55111
+ else {
55112
+ this.drawShape(chart, context, 0, 0, drawContext);
55113
+ }
55114
+ if (clip) {
55115
+ context.restore();
55116
+ }
55117
+ else {
55118
+ context.highPerformanceRestore();
55119
+ }
55212
55120
  }
55213
55121
  };
55214
55122
  DefaultCanvasChartRender = __decorate([
@@ -60136,15 +60044,6 @@
60136
60044
  });
60137
60045
  }
60138
60046
  }
60139
- function clearCellChartCacheImage(col, row, scenegraph) {
60140
- const cellGroup = scenegraph.getCell(col, row);
60141
- cellGroup.children.forEach((node) => {
60142
- if (node.type === 'chart') {
60143
- node.cacheCanvas = null;
60144
- node.addUpdateBoundTag();
60145
- }
60146
- });
60147
- }
60148
60047
  function updateChartData(scenegraph) {
60149
60048
  const table = scenegraph.table;
60150
60049
  for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
@@ -61006,12 +60905,7 @@
61006
60905
  setPoptipTheme(this.table.theme.textPopTipStyle);
61007
60906
  let width;
61008
60907
  let height;
61009
- if (table.options.canvas && table.options.viewBox) {
61010
- vglobal.setEnv('browser');
61011
- width = table.options.viewBox.x2 - table.options.viewBox.x1;
61012
- height = table.options.viewBox.y2 - table.options.viewBox.y1;
61013
- }
61014
- else if (Env.mode === 'node') {
60908
+ if (Env.mode === 'node') {
61015
60909
  vglobal.setEnv('node', table.options.modeParams);
61016
60910
  width = table.canvasWidth;
61017
60911
  height = table.canvasHeight;
@@ -61029,15 +60923,9 @@
61029
60923
  background: table.theme.underlayBackgroundColor,
61030
60924
  dpr: table.internalProps.pixelRatio,
61031
60925
  enableLayout: true,
61032
- beforeRender: (stage) => {
61033
- this.table.options.beforeRender && this.table.options.beforeRender(stage);
61034
- },
61035
- afterRender: (stage) => {
61036
- this.table.options.afterRender && this.table.options.afterRender(stage);
60926
+ afterRender: () => {
61037
60927
  this.table.fireListeners('after_render', null);
61038
60928
  },
61039
- canvasControled: !table.options.canvas,
61040
- viewBox: table.options.viewBox,
61041
60929
  ...table.options.renderOption
61042
60930
  });
61043
60931
  this.stage.defaultLayer.setTheme({
@@ -66355,22 +66243,20 @@
66355
66243
  e.preventDefault();
66356
66244
  }
66357
66245
  });
66358
- if (!table.options.canvas) {
66359
- handler.on(table.getContainer(), 'resize', e => {
66360
- if (e.width === 0 && e.height === 0) {
66361
- return;
66362
- }
66363
- if (table.autoFillWidth || table.autoFillHeight) {
66364
- table.editorManager?.completeEdit();
66365
- }
66366
- if (!isValid$1(table.options.pixelRatio)) {
66367
- table.setPixelRatio(getPixelRatio());
66368
- }
66369
- if (!e.windowSizeNotChange) {
66370
- table.resize();
66371
- }
66372
- });
66373
- }
66246
+ handler.on(table.getContainer(), 'resize', e => {
66247
+ if (e.width === 0 && e.height === 0) {
66248
+ return;
66249
+ }
66250
+ if (table.autoFillWidth || table.autoFillHeight) {
66251
+ table.editorManager?.completeEdit();
66252
+ }
66253
+ if (!isValid$1(table.options.pixelRatio)) {
66254
+ table.setPixelRatio(getPixelRatio());
66255
+ }
66256
+ if (!e.windowSizeNotChange) {
66257
+ table.resize();
66258
+ }
66259
+ });
66374
66260
  const regex = /<tr[^>]*>([\s\S]*?)<\/tr>/g;
66375
66261
  const cellRegex = /<td[^>]*>([\s\S]*?)<\/td>/g;
66376
66262
  function pasteHtmlToTable(item) {
@@ -66932,7 +66818,7 @@
66932
66818
  this.table = table;
66933
66819
  this.handleTextStickBindId = [];
66934
66820
  this.inertiaScroll = new InertiaScroll(table.stateManager);
66935
- if (Env.mode === 'node' || table.options.disableInteraction) {
66821
+ if (Env.mode === 'node') {
66936
66822
  return;
66937
66823
  }
66938
66824
  this.bindOuterEvent();
@@ -68533,7 +68419,6 @@
68533
68419
  }
68534
68420
 
68535
68421
  class FocusInput extends EventTarget {
68536
- _container;
68537
68422
  _table;
68538
68423
  _input;
68539
68424
  constructor(table, parentElement) {
@@ -68553,7 +68438,6 @@
68553
68438
  input.dataset.vtable = 'vtable';
68554
68439
  input.readOnly = true;
68555
68440
  parentElement.appendChild(div);
68556
- this._container = div;
68557
68441
  }
68558
68442
  focus() {
68559
68443
  this._input.focus({ preventScroll: true });
@@ -68573,7 +68457,6 @@
68573
68457
  return this._input;
68574
68458
  }
68575
68459
  release() {
68576
- this._container.parentElement?.removeChild(this._container);
68577
68460
  }
68578
68461
  }
68579
68462
 
@@ -70723,7 +70606,7 @@
70723
70606
  return TABLE_EVENT_TYPE;
70724
70607
  }
70725
70608
  options;
70726
- version = "1.5.5-beta.0";
70609
+ version = "1.5.5";
70727
70610
  pagination;
70728
70611
  id = `VTable${Date.now()}`;
70729
70612
  headerStyleCache;
@@ -70738,7 +70621,7 @@
70738
70621
  _hasAutoImageColumn;
70739
70622
  constructor(container, options = {}) {
70740
70623
  super();
70741
- if (!container && options.mode !== 'node' && !options.canvas) {
70624
+ if (!container && options.mode !== 'node') {
70742
70625
  throw new Error("vtable's container is undefined");
70743
70626
  }
70744
70627
  const { frozenColCount = 0, frozenRowCount, 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;
@@ -70776,14 +70659,7 @@
70776
70659
  if (typeof allowFrozenColCount === 'number' && allowFrozenColCount <= 0) {
70777
70660
  this.showFrozenIcon = false;
70778
70661
  }
70779
- if (this.options.canvas) {
70780
- internalProps.element = this.options.canvas.parentElement;
70781
- internalProps.element.style.position = 'relative';
70782
- internalProps.focusControl = new FocusInput(this, internalProps.element);
70783
- internalProps.canvas = this.options.canvas;
70784
- internalProps.context = internalProps.canvas.getContext('2d');
70785
- }
70786
- else if (Env.mode !== 'node') {
70662
+ if (Env.mode !== 'node') {
70787
70663
  internalProps.element = createRootElement(this.padding);
70788
70664
  internalProps.focusControl = new FocusInput(this, internalProps.element);
70789
70665
  internalProps.canvas = document.createElement('canvas');
@@ -71191,21 +71067,7 @@
71191
71067
  const { padding } = this;
71192
71068
  let widthP = 0;
71193
71069
  let heightP = 0;
71194
- this.tableX = 0;
71195
- this.tableY = 0;
71196
- if (this.options.canvas && this.options.viewBox) {
71197
- widthP = this.options.viewBox.x2 - this.options.viewBox.x1;
71198
- heightP = this.options.viewBox.y2 - this.options.viewBox.y1;
71199
- if (this?.scenegraph?.stage) {
71200
- if (this.options.viewBox) {
71201
- this.scenegraph.stage.setViewBox(this.options.viewBox, false);
71202
- }
71203
- else {
71204
- this.scenegraph.stage.resize(widthP, heightP);
71205
- }
71206
- }
71207
- }
71208
- else if (Env.mode === 'browser') {
71070
+ if (Env.mode === 'browser') {
71209
71071
  const element = this.getElement();
71210
71072
  let widthWithoutPadding = 0;
71211
71073
  let heightWithoutPadding = 0;
@@ -71272,23 +71134,6 @@
71272
71134
  }
71273
71135
  }
71274
71136
  }
71275
- updateViewBox(newViewBox) {
71276
- const oldWidth = this.options?.viewBox.x2 ?? 0 - this.options?.viewBox.x1 ?? 0;
71277
- const oldHeight = this.options?.viewBox.y2 ?? 0 - this.options?.viewBox.y1 ?? 0;
71278
- const newWidth = newViewBox.x2 - newViewBox.x1;
71279
- const newHeight = newViewBox.y2 - newViewBox.y1;
71280
- this.options.viewBox = newViewBox;
71281
- if (oldWidth !== newWidth || oldHeight !== newHeight) {
71282
- this.resize();
71283
- }
71284
- else {
71285
- this.scenegraph.stage.setViewBox(this.options.viewBox, true);
71286
- }
71287
- }
71288
- setViewBoxTransform(a, b, c, d, e, f) {
71289
- this.internalProps.modifiedViewBoxTransform = true;
71290
- this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
71291
- }
71292
71137
  get rowHierarchyType() {
71293
71138
  return 'grid';
71294
71139
  }
@@ -71815,8 +71660,6 @@
71815
71660
  const visibleRect = this.getVisibleRect();
71816
71661
  rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0));
71817
71662
  rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0));
71818
- rect.offsetLeft(this.options.viewBox?.x1 ?? 0);
71819
- rect.offsetTop(this.options.viewBox?.y1 ?? 0);
71820
71663
  return rect;
71821
71664
  }
71822
71665
  getVisibleRect() {
@@ -71976,9 +71819,8 @@
71976
71819
  }
71977
71820
  this.scenegraph.stage.release();
71978
71821
  this.scenegraph.proxy.release();
71979
- internalProps.focusControl.release();
71980
71822
  const { parentElement } = internalProps.element;
71981
- if (parentElement && !this.options.canvas) {
71823
+ if (parentElement) {
71982
71824
  parentElement.removeChild(internalProps.element);
71983
71825
  }
71984
71826
  this.editorManager?.editingEditor?.onEnd?.();
@@ -72022,7 +71864,7 @@
72022
71864
  this.autoFillHeight = autoFillHeight ?? false;
72023
71865
  this.customRender = customRender;
72024
71866
  const internalProps = this.internalProps;
72025
- if (Env.mode !== 'node' && !options.canvas) {
71867
+ if (Env.mode !== 'node') {
72026
71868
  updateRootElementPadding(internalProps.element, this.padding);
72027
71869
  }
72028
71870
  this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
@@ -72203,14 +72045,9 @@
72203
72045
  const currentHeight = rect.height;
72204
72046
  const originHeight = this.canvas.offsetHeight || currentHeight;
72205
72047
  const heightRatio = currentHeight / originHeight;
72206
- const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0) - (this.options.viewBox?.x1 ?? 0);
72207
- const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0) - (this.options.viewBox?.y1 ?? 0);
72208
- const point = { x, y, inTable };
72209
- if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
72210
- const transform = this.scenegraph.stage.window.getViewBoxTransform();
72211
- transform.transformPoint(point, point);
72212
- }
72213
- return point;
72048
+ const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0);
72049
+ const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0);
72050
+ return { x, y, inTable };
72214
72051
  }
72215
72052
  getTheme() {
72216
72053
  return this.internalProps.theme;
@@ -77849,9 +77686,7 @@
77849
77686
  const axisStylrAttrs = getAxisAttributes(this.option);
77850
77687
  const attrs = this.getUpdateAttribute();
77851
77688
  attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
77852
- this.component = new LineAxis(merge({
77853
- disableTriggerEvent: this.table.options.disableInteraction
77854
- }, axisStylrAttrs, attrs));
77689
+ this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));
77855
77690
  this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
77856
77691
  this.component.originAxis = this;
77857
77692
  }
@@ -78432,8 +78267,7 @@
78432
78267
  height: this.table.tableNoFrameHeight
78433
78268
  });
78434
78269
  const legend = new DiscreteLegend(merge({}, attrs, {
78435
- defaultSelected: this.selectedData,
78436
- disableTriggerEvent: this.table.options.disableInteraction
78270
+ defaultSelected: this.selectedData
78437
78271
  }));
78438
78272
  legend.name = 'legend';
78439
78273
  this.legendComponent = legend;
@@ -80133,8 +79967,7 @@
80133
79967
  data: table.getCellValue(col, row),
80134
79968
  cellPadding: padding,
80135
79969
  dpr: table.internalProps.pixelRatio,
80136
- axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : [],
80137
- tableChartOption: table.options.chartOption
79970
+ axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
80138
79971
  });
80139
79972
  cellGroup.appendChild(chartGroup);
80140
79973
  table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
@@ -88483,14 +88316,6 @@
88483
88316
  updateChartData(this.scenegraph);
88484
88317
  this.render();
88485
88318
  }
88486
- clearChartCacheImage(col, row) {
88487
- if (isNumber$2(col) && isNumber$2(row)) {
88488
- clearCellChartCacheImage(col, row, this.scenegraph);
88489
- }
88490
- else {
88491
- clearChartCacheImage(this.scenegraph);
88492
- }
88493
- }
88494
88319
  getLegendSelected() {
88495
88320
  const selected = [];
88496
88321
  this.internalProps.legends?.forEach(legend => {
@@ -89284,7 +89109,7 @@
89284
89109
  }
89285
89110
 
89286
89111
  registerForVrender();
89287
- const version = "1.5.5-beta.0";
89112
+ const version = "1.5.5";
89288
89113
  function getIcons() {
89289
89114
  return get$2();
89290
89115
  }