From c3722e3a423a502a68caa897f056c65bdab55673 Mon Sep 17 00:00:00 2001 From: "lixuefei.1313" Date: Wed, 23 Jul 2025 19:27:22 +0800 Subject: [PATCH 1/2] feat: add the afterClearScreen hook of render --- common/config/rush/pnpm-lock.yaml | 104 +++++++++--------- docs/package.json | 4 +- packages/openinula-vchart/package.json | 4 +- packages/react-vchart/package.json | 4 +- packages/vchart-extension/package.json | 8 +- packages/vchart/package.json | 8 +- packages/vchart/src/compile/compiler.ts | 1 + .../vchart/src/compile/interface/compiler.ts | 6 + packages/vstory/package.json | 6 +- tools/story-player/package.json | 6 +- 10 files changed, 79 insertions(+), 72 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8c28acbe9d..00fba93c2c 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -22,8 +22,8 @@ importers: '@visactor/vchart-extension': workspace:2.0.0 '@visactor/vchart-theme': ~1.6.6 '@visactor/vmind': 1.2.4-alpha.5 - '@visactor/vrender': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vtable': 1.19.0-alpha.0 '@visactor/vtable-calendar': 1.19.0-alpha.0 '@visactor/vtable-editors': 1.19.0-alpha.0 @@ -59,8 +59,8 @@ importers: '@visactor/vchart-extension': link:../packages/vchart-extension '@visactor/vchart-theme': 1.6.9 '@visactor/vmind': 1.2.4-alpha.5 - '@visactor/vrender': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vtable': 1.19.0-alpha.0 '@visactor/vtable-calendar': 1.19.0-alpha.0 '@visactor/vtable-editors': 1.19.0-alpha.0 @@ -144,8 +144,8 @@ importers: '@types/offscreencanvas': 2019.6.4 '@types/react-is': ^17.0.3 '@visactor/vchart': workspace:2.0.0 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': ~1.0.6 '@vitejs/plugin-react': 3.1.0 eslint: ~8.18.0 @@ -164,8 +164,8 @@ importers: vite: 3.2.6 dependencies: '@visactor/vchart': link:../vchart - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': 1.0.6 react-is: 18.3.1 devDependencies: @@ -208,8 +208,8 @@ importers: '@types/react-is': ^17.0.3 '@visactor/vchart': workspace:2.0.0 '@visactor/vchart-extension': workspace:2.0.0 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': ~1.0.6 '@vitejs/plugin-react': 3.1.0 eslint: ~8.18.0 @@ -230,8 +230,8 @@ importers: dependencies: '@visactor/vchart': link:../vchart '@visactor/vchart-extension': link:../vchart-extension - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': 1.0.6 react-is: 18.3.1 devDependencies: @@ -371,10 +371,10 @@ importers: '@types/offscreencanvas': 2019.6.4 '@visactor/vdataset': ~1.0.6 '@visactor/vlayouts': ~1.0.6 - '@visactor/vrender-animate': 1.0.7 - '@visactor/vrender-components': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-animate': 1.0.8 + '@visactor/vrender-components': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vscale': ~1.0.6 '@visactor/vutils': ~1.0.6 '@visactor/vutils-extension': workspace:2.0.0 @@ -413,10 +413,10 @@ importers: dependencies: '@visactor/vdataset': 1.0.6 '@visactor/vlayouts': 1.0.6 - '@visactor/vrender-animate': 1.0.7 - '@visactor/vrender-components': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-animate': 1.0.8 + '@visactor/vrender-components': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vscale': 1.0.6 '@visactor/vutils': 1.0.6 '@visactor/vutils-extension': link:../vutils-extension @@ -478,10 +478,10 @@ importers: '@visactor/vchart': workspace:2.0.0 '@visactor/vdataset': ~1.0.6 '@visactor/vlayouts': ~1.0.6 - '@visactor/vrender-animate': 1.0.7 - '@visactor/vrender-components': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-animate': 1.0.8 + '@visactor/vrender-components': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': ~1.0.6 '@vitejs/plugin-react': 3.1.0 canvas: 2.11.2 @@ -503,10 +503,10 @@ importers: '@visactor/vchart': link:../vchart '@visactor/vdataset': 1.0.6 '@visactor/vlayouts': 1.0.6 - '@visactor/vrender-animate': 1.0.7 - '@visactor/vrender-components': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-animate': 1.0.8 + '@visactor/vrender-components': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': 1.0.6 devDependencies: '@internal/bundler': link:../../tools/bundler @@ -878,9 +878,9 @@ importers: '@typescript-eslint/eslint-plugin': 5.30.0 '@typescript-eslint/parser': 5.30.0 '@visactor/vchart': workspace:2.0.0 - '@visactor/vrender': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': ~1.0.6 cross-env: ^7.0.3 eslint: ~8.18.0 @@ -893,9 +893,9 @@ importers: vite: 3.2.6 dependencies: '@visactor/vchart': link:../../packages/vchart - '@visactor/vrender': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vutils': 1.0.6 devDependencies: '@internal/bundler': link:../bundler @@ -4884,10 +4884,10 @@ packages: '@visactor/vutils': 1.0.4 dev: false - /@visactor/vrender-animate/1.0.7: - resolution: {integrity: sha512-G9xyW1+4DaYqa0U3eus4h7yuU3kZAJmsDL9VL+H77YgkaozUdJOUo0qGvwIgB1WzjKwGnxbbygIi7GBzxOZ8YQ==} + /@visactor/vrender-animate/1.0.8: + resolution: {integrity: sha512-JWxK+bcD2Pyd0rvFVyV13UicwrViz7OiQmzqVbGPcRmMS3rEktFhq5gK9Cggr4cTeTCDnlGTljLuXVPikR9mRQ==} dependencies: - '@visactor/vrender-core': 1.0.7 + '@visactor/vrender-core': 1.0.8 '@visactor/vutils': 1.0.6 dev: false @@ -4901,12 +4901,12 @@ packages: '@visactor/vutils': 1.0.4 dev: false - /@visactor/vrender-components/1.0.7: - resolution: {integrity: sha512-EgfCYPf5dNv9xZt8zgJhIxW3GtGIglyyfJjt5pNsv90XDyXplMpCngPwA/kwr8hYRs/gt3Rdynfs49alDnClAQ==} + /@visactor/vrender-components/1.0.8: + resolution: {integrity: sha512-QxzOIbvn5+sZi+I6EFCwGzxAEtSVFhFhKp+xcXpOomQ5q8+3JKCIGMuxEsqB6uDR5SV4oWNxzsoxAFRuhJxZ2g==} dependencies: - '@visactor/vrender-animate': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-animate': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 '@visactor/vscale': 1.0.6 '@visactor/vutils': 1.0.6 dev: false @@ -4918,8 +4918,8 @@ packages: color-convert: 2.0.1 dev: false - /@visactor/vrender-core/1.0.7: - resolution: {integrity: sha512-1ncnFf6gRQXARDLGuRoqhVOfb8RB0zvBIHlIQ5tqYnjoFSbowgLmQ87xSatt3BlirRqLcPYSRLi48jKYOox0/w==} + /@visactor/vrender-core/1.0.8: + resolution: {integrity: sha512-KTlh3Q2sNNlhBfsw6ABunH1ifSmMow6mdk85Qu00ISW+YC+BXFUNExL05/mJMsNqPoFund2uCDDgXJ82o9GsoQ==} dependencies: '@visactor/vutils': 1.0.6 color-convert: 2.0.1 @@ -4936,23 +4936,23 @@ packages: roughjs: 4.5.2 dev: false - /@visactor/vrender-kits/1.0.7: - resolution: {integrity: sha512-SZr0GaQM8JJB7dHr8MmQ4EDMW+m9LAWO0N83i1pD5cvDCzMtc9iIUl8MfEI1tyre08hhCLRZZaM3yW06I5MoIQ==} + /@visactor/vrender-kits/1.0.8: + resolution: {integrity: sha512-eUGp6b/aRssWcUV6RRWOJnG/QXNPmW45YLmXCHFWyJnVDS+8aL4H1KwyGVqTl6GJF9Lf6124sx+CJdqZN4jwkw==} dependencies: '@resvg/resvg-js': 2.4.1 - '@visactor/vrender-core': 1.0.7 + '@visactor/vrender-core': 1.0.8 '@visactor/vutils': 1.0.6 gifuct-js: 2.1.2 lottie-web: 5.13.0 roughjs: 4.5.2 dev: false - /@visactor/vrender/1.0.7: - resolution: {integrity: sha512-GI7OgNCsb5/xepqcztx6f8N1dEaojDSVCN9NQ6cN4uTU5F6IvnMaS9K+RUbmK+Y0qaT8aupGC3BK8PMkcWJ3zw==} + /@visactor/vrender/1.0.8: + resolution: {integrity: sha512-+3vYsSZCTOdrYyhU3Qqm8Mo5Ya/+pMzwHoYASIAzVAFWWCs7upZm4wBLKIu78UDuPvpQwS/PUKo9fAohcBXN6w==} dependencies: - '@visactor/vrender-animate': 1.0.7 - '@visactor/vrender-core': 1.0.7 - '@visactor/vrender-kits': 1.0.7 + '@visactor/vrender-animate': 1.0.8 + '@visactor/vrender-core': 1.0.8 + '@visactor/vrender-kits': 1.0.8 dev: false /@visactor/vscale/0.18.18: diff --git a/docs/package.json b/docs/package.json index dde2f21d88..adb1efd8a7 100644 --- a/docs/package.json +++ b/docs/package.json @@ -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.7", - "@visactor/vrender-kits": "1.0.7", + "@visactor/vrender": "1.0.8", + "@visactor/vrender-kits": "1.0.8", "@visactor/vtable": "1.19.0-alpha.0", "@visactor/vtable-editors": "1.19.0-alpha.0", "@visactor/vtable-gantt": "1.19.0-alpha.0", diff --git a/packages/openinula-vchart/package.json b/packages/openinula-vchart/package.json index 0d73ab8ee6..cc8632a6ea 100644 --- a/packages/openinula-vchart/package.json +++ b/packages/openinula-vchart/package.json @@ -30,8 +30,8 @@ "dependencies": { "@visactor/vchart": "workspace:2.0.0", "@visactor/vutils": "~1.0.6", - "@visactor/vrender-core": "1.0.7", - "@visactor/vrender-kits": "1.0.7", + "@visactor/vrender-core": "1.0.8", + "@visactor/vrender-kits": "1.0.8", "react-is": "^18.2.0" }, "devDependencies": { diff --git a/packages/react-vchart/package.json b/packages/react-vchart/package.json index f4dec9c2f3..3db25feb2f 100644 --- a/packages/react-vchart/package.json +++ b/packages/react-vchart/package.json @@ -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.7", - "@visactor/vrender-kits": "1.0.7", + "@visactor/vrender-core": "1.0.8", + "@visactor/vrender-kits": "1.0.8", "react-is": "^18.2.0" }, "devDependencies": { diff --git a/packages/vchart-extension/package.json b/packages/vchart-extension/package.json index e0535554fb..98a529668d 100644 --- a/packages/vchart-extension/package.json +++ b/packages/vchart-extension/package.json @@ -21,10 +21,10 @@ "start": "ts-node __tests__/runtime/browser/scripts/initVite.ts && vite serve __tests__/runtime/browser" }, "dependencies": { - "@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/vrender-core": "1.0.8", + "@visactor/vrender-kits": "1.0.8", + "@visactor/vrender-components": "1.0.8", + "@visactor/vrender-animate": "1.0.8", "@visactor/vutils": "~1.0.6", "@visactor/vdataset": "~1.0.6", "@visactor/vlayouts": "~1.0.6", diff --git a/packages/vchart/package.json b/packages/vchart/package.json index df37d12a25..cf4b5e527b 100644 --- a/packages/vchart/package.json +++ b/packages/vchart/package.json @@ -122,10 +122,10 @@ "@visactor/vdataset": "~1.0.6", "@visactor/vscale": "~1.0.6", "@visactor/vlayouts": "~1.0.6", - "@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/vrender-core": "1.0.8", + "@visactor/vrender-kits": "1.0.8", + "@visactor/vrender-components": "1.0.8", + "@visactor/vrender-animate": "1.0.8", "@visactor/vutils-extension": "workspace:2.0.0" }, "publishConfig": { diff --git a/packages/vchart/src/compile/compiler.ts b/packages/vchart/src/compile/compiler.ts index 0cebcf2520..a46a7b795a 100644 --- a/packages/vchart/src/compile/compiler.ts +++ b/packages/vchart/src/compile/compiler.ts @@ -138,6 +138,7 @@ export class Compiler implements ICompiler { this._option.beforeRender?.(stage); }, afterRender: this._option.afterRender, + afterClearScreen: this._option.afterClearScreen, disableDirtyBounds: true, autoRender: true, ticker: this._option.ticker, diff --git a/packages/vchart/src/compile/interface/compiler.ts b/packages/vchart/src/compile/interface/compiler.ts index fe06dc7e3f..3a1fd5512f 100644 --- a/packages/vchart/src/compile/interface/compiler.ts +++ b/packages/vchart/src/compile/interface/compiler.ts @@ -130,6 +130,12 @@ export interface IRenderOption { * 绘制之后的钩子函数 */ afterRender?: IStageParams['afterRender']; + + /** + * 渲染层清除屏幕之后的钩子函数,这个钩子在实际渲染之前 + * @since 2.0.1 + */ + afterClearScreen?: IStageParams['afterClearScreen']; /** * 绘图区域背景色设置 */ diff --git a/packages/vstory/package.json b/packages/vstory/package.json index d750e26255..90a9868ee4 100644 --- a/packages/vstory/package.json +++ b/packages/vstory/package.json @@ -21,9 +21,9 @@ }, "dependencies": { "@visactor/vchart": "workspace:1.11.0", - "@visactor/vrender-core": "1.0.7", - "@visactor/vrender-kits": "1.0.7", - "@visactor/vrender-components": "1.0.7", + "@visactor/vrender-core": "1.0.8", + "@visactor/vrender-kits": "1.0.8", + "@visactor/vrender-components": "1.0.8", "@visactor/vutils": "~1.0.6" }, "devDependencies": { diff --git a/tools/story-player/package.json b/tools/story-player/package.json index 605cf7b3d4..bc037ecf1b 100644 --- a/tools/story-player/package.json +++ b/tools/story-player/package.json @@ -56,10 +56,10 @@ "vite": "3.2.6" }, "dependencies": { - "@visactor/vrender-core": "1.0.7", - "@visactor/vrender-kits": "1.0.7", + "@visactor/vrender-core": "1.0.8", + "@visactor/vrender-kits": "1.0.8", "@visactor/vchart": "workspace:2.0.0", - "@visactor/vrender": "1.0.7", + "@visactor/vrender": "1.0.8", "@visactor/vutils": "~1.0.6" } } \ No newline at end of file From f07f9797fa0db63a3fd14bb238d6052bd51d32c3 Mon Sep 17 00:00:00 2001 From: "lixuefei.1313" Date: Wed, 23 Jul 2025 19:27:45 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...upport-hook-afterClearScreen_2025-07-23-11-27.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vchart/feat-support-hook-afterClearScreen_2025-07-23-11-27.json diff --git a/common/changes/@visactor/vchart/feat-support-hook-afterClearScreen_2025-07-23-11-27.json b/common/changes/@visactor/vchart/feat-support-hook-afterClearScreen_2025-07-23-11-27.json new file mode 100644 index 0000000000..2d8c53b7d4 --- /dev/null +++ b/common/changes/@visactor/vchart/feat-support-hook-afterClearScreen_2025-07-23-11-27.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "feat: add the afterClearScreen hook of render\n\n", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "lixuef1313@163.com" +} \ No newline at end of file