Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: fix resize error when remake, and re-normal aniamtion bug, fix #4070\n\n",
"type": "none",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "dingling112@gmail.com"
}
104 changes: 52 additions & 52 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@visactor/vchart-theme": "~1.6.6",
"@visactor/vmind": "1.2.4-alpha.5",
"@visactor/vutils": "~1.0.6",
"@visactor/vrender": "1.0.3",
"@visactor/vrender-kits": "1.0.3",
"@visactor/vrender": "1.0.7",
"@visactor/vrender-kits": "1.0.7",
"@visactor/vtable": "1.19.0-alpha.0",
"@visactor/vtable-editors": "1.19.0-alpha.0",
"@visactor/vtable-gantt": "1.19.0-alpha.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/openinula-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"dependencies": {
"@visactor/vchart": "workspace:2.0.0",
"@visactor/vutils": "~1.0.6",
"@visactor/vrender-core": "1.0.3",
"@visactor/vrender-kits": "1.0.3",
"@visactor/vrender-core": "1.0.7",
"@visactor/vrender-kits": "1.0.7",
"react-is": "^18.2.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"@visactor/vchart": "workspace:2.0.0",
"@visactor/vchart-extension": "workspace:2.0.0",
"@visactor/vutils": "~1.0.6",
"@visactor/vrender-core": "1.0.3",
"@visactor/vrender-kits": "1.0.3",
"@visactor/vrender-core": "1.0.7",
"@visactor/vrender-kits": "1.0.7",
"react-is": "^18.2.0"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/vchart-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"start": "ts-node __tests__/runtime/browser/scripts/initVite.ts && vite serve __tests__/runtime/browser"
},
"dependencies": {
"@visactor/vrender-core": "1.0.3",
"@visactor/vrender-kits": "1.0.3",
"@visactor/vrender-components": "1.0.3",
"@visactor/vrender-animate": "1.0.3",
"@visactor/vrender-core": "1.0.7",
"@visactor/vrender-kits": "1.0.7",
"@visactor/vrender-components": "1.0.7",
"@visactor/vrender-animate": "1.0.7",
"@visactor/vutils": "~1.0.6",
"@visactor/vdataset": "~1.0.6",
"@visactor/vlayouts": "~1.0.6",
Expand Down
8 changes: 4 additions & 4 deletions packages/vchart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@
"@visactor/vdataset": "~1.0.6",
"@visactor/vscale": "~1.0.6",
"@visactor/vlayouts": "~1.0.6",
"@visactor/vrender-core": "1.0.3",
"@visactor/vrender-kits": "1.0.3",
"@visactor/vrender-components": "1.0.3",
"@visactor/vrender-animate": "1.0.3",
"@visactor/vrender-core": "1.0.7",
"@visactor/vrender-kits": "1.0.7",
"@visactor/vrender-components": "1.0.7",
"@visactor/vrender-animate": "1.0.7",
"@visactor/vutils-extension": "workspace:2.0.0"
},
"publishConfig": {
Expand Down
3 changes: 3 additions & 0 deletions packages/vchart/src/compile/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export class Compiler implements ICompiler {
this._option = option;
}

getChart() {
return this._compileChart;
}
/**
* 获取 canvas dom
* @returns HTMLCanvasElement | undefined
Expand Down
1 change: 1 addition & 0 deletions packages/vchart/src/compile/interface/compilable-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export interface ICompiler {
updateLayoutTag: () => void;
getLayoutState: () => LayoutState;
getRootGroup: () => IGroup;
getChart: () => IChart;
}

export interface ICompilable {
Expand Down
38 changes: 16 additions & 22 deletions packages/vchart/src/core/vchart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,23 +694,19 @@ export class VChart implements IVChart {
// 内部模块删除事件时,调用了event Dispatcher.release() 导致用户事件被一起删除
// 外部事件现在需要重新添加
this._userEvents.forEach(e => this._event?.on(e.eType as any, e.query as any, e.handler as any));
} else if (updateResult.reCompile) {
// recompile
// 清除之前的所有 compile 内容
this._compiler?.clear({ chart: this._chart, vChart: this });
// 重新compile
this._compiler?.compile({ chart: this._chart, vChart: this });
}
if (updateResult.reSize) {
const { width, height } = this.getCurrentSize();

if (updateResult.reSize) {
this._doResize();
}
} else {
if (updateResult.reCompile) {
// recompile
// 清除之前的所有 compile 内容
this._compiler?.clear({ chart: this._chart, vChart: this });
// 重新compile
this._compiler?.compile({ chart: this._chart, vChart: this });
}
if (updateResult.reSize) {
const { width, height } = this.getCurrentSize();
this._chart.onResize(width, height, false);
this._compiler.resize(width, height, false);
}
this._currentSize = { width, height };
this._chart?.onResize(width, height, false);
this._compiler?.resize(width, height, false);
}
}

Expand Down Expand Up @@ -1905,23 +1901,21 @@ export class VChart implements IVChart {

/** 停止正在进行的所有动画 */
stopAnimation() {
this.getStage()?.stopAnimation(true);
(this.getStage() as any)?.stopAnimation(true);
}

reRunNormalAnimation() {
this.getStage()?.reApplyAnimationState('normal', true);
(this.getStage() as any)?.reApplyAnimationState('normal', true);
}

/** 暂停正在进行的所有动画 */
pauseAnimation() {
this.getStage()?.pauseAnimation(true);
// this._compiler?.getVGrammarView()?.animate?.pause();
(this.getStage() as any)?.pauseAnimation(true);
}

/** 恢复暂停时正在进行的所有动画 */
resumeAnimation() {
this.getStage()?.resumeAnimation(true);
// this._compiler?.getVGrammarView()?.animate?.resume();
(this.getStage() as any)?.resumeAnimation(true);
}

// TODO: 后续需要考虑滚动场景
Expand Down
Loading
Loading