diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 18541613a..aa7514eed 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9,16 +9,16 @@ importers: specifiers: '@internal/eslint-config': workspace:* '@internal/ts-config': workspace:* - '@visactor/vgrammar': workspace:0.16.12 - '@visactor/vgrammar-coordinate': workspace:0.16.12 - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-hierarchy': workspace:0.16.12 - '@visactor/vgrammar-plot': workspace:0.16.12 - '@visactor/vgrammar-projection': workspace:0.16.12 - '@visactor/vgrammar-sankey': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 - '@visactor/vgrammar-wordcloud': workspace:0.16.12 - '@visactor/vgrammar-wordcloud-shape': workspace:0.16.12 + '@visactor/vgrammar': workspace:0.16.13 + '@visactor/vgrammar-coordinate': workspace:0.16.13 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-hierarchy': workspace:0.16.13 + '@visactor/vgrammar-plot': workspace:0.16.13 + '@visactor/vgrammar-projection': workspace:0.16.13 + '@visactor/vgrammar-sankey': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 + '@visactor/vgrammar-wordcloud': workspace:0.16.13 + '@visactor/vgrammar-wordcloud-shape': workspace:0.16.13 '@visactor/vrender': 0.22.17 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 @@ -60,17 +60,17 @@ importers: '@types/markdown-it': ^13.0.0 '@types/react': ^18.0.0 '@types/react-dom': ^18.0.0 - '@visactor/vgrammar': workspace:0.16.12 - '@visactor/vgrammar-coordinate': workspace:0.16.12 - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-hierarchy': workspace:0.16.12 - '@visactor/vgrammar-plot': workspace:0.16.12 - '@visactor/vgrammar-projection': workspace:0.16.12 - '@visactor/vgrammar-sankey': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 - '@visactor/vgrammar-venn': workspace:0.16.12 - '@visactor/vgrammar-wordcloud': workspace:0.16.12 - '@visactor/vgrammar-wordcloud-shape': workspace:0.16.12 + '@visactor/vgrammar': workspace:0.16.13 + '@visactor/vgrammar-coordinate': workspace:0.16.13 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-hierarchy': workspace:0.16.13 + '@visactor/vgrammar-plot': workspace:0.16.13 + '@visactor/vgrammar-projection': workspace:0.16.13 + '@visactor/vgrammar-sankey': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 + '@visactor/vgrammar-venn': workspace:0.16.13 + '@visactor/vgrammar-wordcloud': workspace:0.16.13 + '@visactor/vgrammar-wordcloud-shape': workspace:0.16.13 '@visactor/vrender': 0.22.17 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 @@ -153,7 +153,7 @@ importers: '@types/d3-geo': ^1.11.1 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 d3-array: 1.x eslint: ~8.18.0 jest: ~29.5.0 @@ -191,7 +191,7 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vutils': ~0.19.5 eslint: ~8.18.0 jest: ~29.5.0 @@ -229,8 +229,8 @@ importers: '@types/jest': ~29.5.0 '@types/node': '*' '@visactor/vdataset': ~0.19.5 - '@visactor/vgrammar-coordinate': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-coordinate': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vrender-components': 0.22.17 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 @@ -279,14 +279,14 @@ importers: '@types/jest': ~29.5.0 '@types/node': '*' '@types/node-fetch': 2.6.4 - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-hierarchy': workspace:0.16.12 - '@visactor/vgrammar-plot': workspace:0.16.12 - '@visactor/vgrammar-projection': workspace:0.16.12 - '@visactor/vgrammar-sankey': workspace:0.16.12 - '@visactor/vgrammar-venn': workspace:0.16.12 - '@visactor/vgrammar-wordcloud': workspace:0.16.12 - '@visactor/vgrammar-wordcloud-shape': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-hierarchy': workspace:0.16.13 + '@visactor/vgrammar-plot': workspace:0.16.13 + '@visactor/vgrammar-projection': workspace:0.16.13 + '@visactor/vgrammar-sankey': workspace:0.16.13 + '@visactor/vgrammar-venn': workspace:0.16.13 + '@visactor/vgrammar-wordcloud': workspace:0.16.13 + '@visactor/vgrammar-wordcloud-shape': workspace:0.16.13 d3-array: 1.x eslint: ~8.18.0 form-data: ~4.0.0 @@ -338,8 +338,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 '@visactor/vutils': ~0.19.5 @@ -382,9 +382,9 @@ importers: '@types/d3-geo': ^1.11.1 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-coordinate': workspace:0.16.12 - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-coordinate': workspace:0.16.13 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vrender-components': 0.22.17 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 @@ -435,8 +435,8 @@ importers: '@types/d3-geo': ^1.11.1 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vutils': ~0.19.5 d3-array: 1.x d3-geo: ^1.12.1 @@ -479,8 +479,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 '@visactor/vutils': ~0.19.5 @@ -559,8 +559,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 '@visactor/vutils': ~0.19.5 @@ -602,8 +602,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 '@visactor/vutils': ~0.19.5 @@ -645,8 +645,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.16.12 - '@visactor/vgrammar-util': workspace:0.16.12 + '@visactor/vgrammar-core': workspace:0.16.13 + '@visactor/vgrammar-util': workspace:0.16.13 '@visactor/vrender-core': 0.22.17 '@visactor/vrender-kits': 0.22.17 '@visactor/vscale': ~0.19.5 diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index 7426f78e5..149a0fbc9 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -1 +1 @@ -[{"definitionName":"lockStepVersion","policyName":"vgrammarMain","version":"0.16.12","mainProject":"@visactor/vgrammar-core","nextBump":"patch"}] +[{"definitionName":"lockStepVersion","policyName":"vgrammarMain","version":"0.16.13","mainProject":"@visactor/vgrammar-core","nextBump":"patch"}] diff --git a/docs/dev-demos/package.json b/docs/dev-demos/package.json index dd8ae7a8f..2d241575a 100644 --- a/docs/dev-demos/package.json +++ b/docs/dev-demos/package.json @@ -12,14 +12,14 @@ "@internal/eslint-config": "workspace:*", "@internal/ts-config": "workspace:*", "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar": "workspace:0.16.12", - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-hierarchy": "workspace:0.16.12", - "@visactor/vgrammar-sankey": "workspace:0.16.12", - "@visactor/vgrammar-projection": "workspace:0.16.12", - "@visactor/vgrammar-wordcloud": "workspace:0.16.12", - "@visactor/vgrammar-wordcloud-shape": "workspace:0.16.12", - "@visactor/vgrammar-plot": "workspace:0.16.12", + "@visactor/vgrammar": "workspace:0.16.13", + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-hierarchy": "workspace:0.16.13", + "@visactor/vgrammar-sankey": "workspace:0.16.13", + "@visactor/vgrammar-projection": "workspace:0.16.13", + "@visactor/vgrammar-wordcloud": "workspace:0.16.13", + "@visactor/vgrammar-wordcloud-shape": "workspace:0.16.13", + "@visactor/vgrammar-plot": "workspace:0.16.13", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17", "@visactor/vrender": "0.22.17", @@ -27,8 +27,8 @@ "lodash": "4.17.21", "typescript": "4.9.5", "vite": "3.2.6", - "@visactor/vgrammar-util": "workspace:0.16.12", - "@visactor/vgrammar-coordinate": "workspace:0.16.12", + "@visactor/vgrammar-util": "workspace:0.16.13", + "@visactor/vgrammar-coordinate": "workspace:0.16.13", "@vitejs/plugin-react": "3.1.0" } } diff --git a/docs/site/package.json b/docs/site/package.json index 59fd92521..b98783deb 100644 --- a/docs/site/package.json +++ b/docs/site/package.json @@ -14,17 +14,17 @@ "dependencies": { "@arco-design/web-react": "2.46.1", "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar": "workspace:0.16.12", - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-hierarchy": "workspace:0.16.12", - "@visactor/vgrammar-sankey": "workspace:0.16.12", - "@visactor/vgrammar-projection": "workspace:0.16.12", - "@visactor/vgrammar-wordcloud": "workspace:0.16.12", - "@visactor/vgrammar-wordcloud-shape": "workspace:0.16.12", - "@visactor/vgrammar-plot": "workspace:0.16.12", - "@visactor/vgrammar-util": "workspace:0.16.12", - "@visactor/vgrammar-coordinate": "workspace:0.16.12", - "@visactor/vgrammar-venn": "workspace:0.16.12", + "@visactor/vgrammar": "workspace:0.16.13", + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-hierarchy": "workspace:0.16.13", + "@visactor/vgrammar-sankey": "workspace:0.16.13", + "@visactor/vgrammar-projection": "workspace:0.16.13", + "@visactor/vgrammar-wordcloud": "workspace:0.16.13", + "@visactor/vgrammar-wordcloud-shape": "workspace:0.16.13", + "@visactor/vgrammar-plot": "workspace:0.16.13", + "@visactor/vgrammar-util": "workspace:0.16.13", + "@visactor/vgrammar-coordinate": "workspace:0.16.13", + "@visactor/vgrammar-venn": "workspace:0.16.13", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17", "@visactor/vrender": "0.22.17", diff --git a/packages/vgrammar-coordinate/package.json b/packages/vgrammar-coordinate/package.json index d7e59ec85..25f72b7ce 100644 --- a/packages/vgrammar-coordinate/package.json +++ b/packages/vgrammar-coordinate/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-coordinate", - "version": "0.16.12", + "version": "0.16.13", "description": "Coordinates for VGrammar", "keywords": [ "coordinate", @@ -35,7 +35,7 @@ }, "dependencies": { "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar-util": "workspace:0.16.12" + "@visactor/vgrammar-util": "workspace:0.16.13" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vgrammar-core/CHANGELOG.json b/packages/vgrammar-core/CHANGELOG.json index 942aa0df0..4e1eef2ec 100644 --- a/packages/vgrammar-core/CHANGELOG.json +++ b/packages/vgrammar-core/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/vgrammar-core", "entries": [ + { + "version": "0.16.13", + "tag": "@visactor/vgrammar-core_v0.16.13", + "date": "Sun, 24 Aug 2025 00:52:09 GMT", + "comments": { + "none": [ + { + "comment": "fix: fix bug of wordcloud layout\n\n" + } + ] + } + }, { "version": "0.16.12", "tag": "@visactor/vgrammar-core_v0.16.12", diff --git a/packages/vgrammar-core/CHANGELOG.md b/packages/vgrammar-core/CHANGELOG.md index cbca905df..17cdb4d14 100644 --- a/packages/vgrammar-core/CHANGELOG.md +++ b/packages/vgrammar-core/CHANGELOG.md @@ -1,6 +1,15 @@ # Change Log - @visactor/vgrammar-core -This log was last generated on Thu, 21 Aug 2025 12:09:08 GMT and should not be manually modified. +This log was last generated on Sun, 24 Aug 2025 00:52:09 GMT and should not be manually modified. + +## 0.16.13 +Sun, 24 Aug 2025 00:52:09 GMT + +### Updates + +- fix: fix bug of wordcloud layout + + ## 0.16.12 Thu, 21 Aug 2025 12:09:08 GMT diff --git a/packages/vgrammar-core/package.json b/packages/vgrammar-core/package.json index bb411fffc..30c77d70a 100644 --- a/packages/vgrammar-core/package.json +++ b/packages/vgrammar-core/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-core", - "version": "0.16.12", + "version": "0.16.13", "description": "VGrammar is a visual grammar library", "keywords": [ "grammar", @@ -37,8 +37,8 @@ "dependencies": { "@visactor/vutils": "~0.19.5", "@visactor/vdataset": "~0.19.5", - "@visactor/vgrammar-coordinate": "workspace:0.16.12", - "@visactor/vgrammar-util": "workspace:0.16.12", + "@visactor/vgrammar-coordinate": "workspace:0.16.13", + "@visactor/vgrammar-util": "workspace:0.16.13", "@visactor/vscale": "~0.19.5", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17", diff --git a/packages/vgrammar-full/package.json b/packages/vgrammar-full/package.json index 3f609f9f8..1a28a7b62 100644 --- a/packages/vgrammar-full/package.json +++ b/packages/vgrammar-full/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-full", - "version": "0.16.12", + "version": "0.16.13", "description": "full packages of vgrammar.", "keywords": [ "visualization", @@ -33,14 +33,14 @@ "test": "" }, "dependencies": { - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-hierarchy": "workspace:0.16.12", - "@visactor/vgrammar-plot": "workspace:0.16.12", - "@visactor/vgrammar-projection": "workspace:0.16.12", - "@visactor/vgrammar-sankey": "workspace:0.16.12", - "@visactor/vgrammar-wordcloud": "workspace:0.16.12", - "@visactor/vgrammar-wordcloud-shape": "workspace:0.16.12", - "@visactor/vgrammar-venn": "workspace:0.16.12" + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-hierarchy": "workspace:0.16.13", + "@visactor/vgrammar-plot": "workspace:0.16.13", + "@visactor/vgrammar-projection": "workspace:0.16.13", + "@visactor/vgrammar-sankey": "workspace:0.16.13", + "@visactor/vgrammar-wordcloud": "workspace:0.16.13", + "@visactor/vgrammar-wordcloud-shape": "workspace:0.16.13", + "@visactor/vgrammar-venn": "workspace:0.16.13" }, "devDependencies": { "d3-array": "1.x", diff --git a/packages/vgrammar-hierarchy/package.json b/packages/vgrammar-hierarchy/package.json index b82f5bb1b..af5477bc9 100644 --- a/packages/vgrammar-hierarchy/package.json +++ b/packages/vgrammar-hierarchy/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-hierarchy", - "version": "0.16.12", + "version": "0.16.13", "description": "Layout of hierarchical data for VGrammar", "keywords": [ "hierarchy", @@ -39,8 +39,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-util": "workspace:0.16.12", + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-util": "workspace:0.16.13", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17" }, diff --git a/packages/vgrammar-plot/package.json b/packages/vgrammar-plot/package.json index 104774217..40cdef35d 100644 --- a/packages/vgrammar-plot/package.json +++ b/packages/vgrammar-plot/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-plot", - "version": "0.16.12", + "version": "0.16.13", "description": "Plots of vgrammar.", "keywords": [ "plot", @@ -36,9 +36,9 @@ "dependencies": { "@visactor/vscale": "~0.19.5", "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar-util": "workspace:0.16.12", - "@visactor/vgrammar-coordinate": "workspace:0.16.12", - "@visactor/vgrammar-core": "workspace:0.16.12", + "@visactor/vgrammar-util": "workspace:0.16.13", + "@visactor/vgrammar-coordinate": "workspace:0.16.13", + "@visactor/vgrammar-core": "workspace:0.16.13", "@visactor/vrender-components": "0.22.17", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17" diff --git a/packages/vgrammar-projection/package.json b/packages/vgrammar-projection/package.json index 7c38cf7be..eb6b7a994 100644 --- a/packages/vgrammar-projection/package.json +++ b/packages/vgrammar-projection/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-projection", - "version": "0.16.12", + "version": "0.16.13", "description": "Projections for map, used in VGrammar.", "keywords": [ "projection", @@ -35,8 +35,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar-util": "workspace:0.16.12", - "@visactor/vgrammar-core": "workspace:0.16.12", + "@visactor/vgrammar-util": "workspace:0.16.13", + "@visactor/vgrammar-core": "workspace:0.16.13", "d3-geo": "^1.12.1" }, "devDependencies": { diff --git a/packages/vgrammar-sankey/package.json b/packages/vgrammar-sankey/package.json index 2ae601e49..8f1c631a9 100644 --- a/packages/vgrammar-sankey/package.json +++ b/packages/vgrammar-sankey/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-sankey", - "version": "0.16.12", + "version": "0.16.13", "description": "Layout of sankey chart, used by VGrammar", "keywords": [ "sankey", @@ -37,8 +37,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-util": "workspace:0.16.12", + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-util": "workspace:0.16.13", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17" }, diff --git a/packages/vgrammar-util/package.json b/packages/vgrammar-util/package.json index 56d552157..8ced0c7c3 100644 --- a/packages/vgrammar-util/package.json +++ b/packages/vgrammar-util/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-util", - "version": "0.16.12", + "version": "0.16.13", "description": "The common utils functions of VGrammar", "keywords": [ "utils", diff --git a/packages/vgrammar-venn/package.json b/packages/vgrammar-venn/package.json index 8d4cd9322..a342faa35 100644 --- a/packages/vgrammar-venn/package.json +++ b/packages/vgrammar-venn/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-venn", - "version": "0.16.12", + "version": "0.16.13", "description": "Venn layout transform for VGrammar", "keywords": [ "venn", @@ -34,8 +34,8 @@ "test-check": "DEBUG=jest jest --forceExit --detectOpenHandles --silent false --verbose false --runInBand" }, "dependencies": { - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-util": "workspace:0.16.12", + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-util": "workspace:0.16.13", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17", "@visactor/vutils": "~0.19.5" diff --git a/packages/vgrammar-wordcloud-shape/package.json b/packages/vgrammar-wordcloud-shape/package.json index 7b2cc7b37..f417feeaf 100644 --- a/packages/vgrammar-wordcloud-shape/package.json +++ b/packages/vgrammar-wordcloud-shape/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-wordcloud-shape", - "version": "0.16.12", + "version": "0.16.13", "description": "Layout WordCloud in specified shape, this is a transform for VGrammar.", "keywords": [ "wordcloud", @@ -36,8 +36,8 @@ "dependencies": { "@visactor/vutils": "~0.19.5", "@visactor/vscale": "~0.19.5", - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-util": "workspace:0.16.12", + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-util": "workspace:0.16.13", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17" }, diff --git a/packages/vgrammar-wordcloud/package.json b/packages/vgrammar-wordcloud/package.json index e3e74d287..f52eae85a 100644 --- a/packages/vgrammar-wordcloud/package.json +++ b/packages/vgrammar-wordcloud/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-wordcloud", - "version": "0.16.12", + "version": "0.16.13", "description": "WordCloud layout transform for VGrammar", "keywords": [ "wordcloud", @@ -35,8 +35,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.5", - "@visactor/vgrammar-core": "workspace:0.16.12", - "@visactor/vgrammar-util": "workspace:0.16.12", + "@visactor/vgrammar-core": "workspace:0.16.13", + "@visactor/vgrammar-util": "workspace:0.16.13", "@visactor/vrender-core": "0.22.17", "@visactor/vrender-kits": "0.22.17" }, diff --git a/packages/vgrammar-wordcloud/src/cloud-layout.ts b/packages/vgrammar-wordcloud/src/cloud-layout.ts index 7fe2980b5..1ee78dffe 100644 --- a/packages/vgrammar-wordcloud/src/cloud-layout.ts +++ b/packages/vgrammar-wordcloud/src/cloud-layout.ts @@ -90,7 +90,7 @@ export class CloudLayout extends BaseLayout implements IPro _dy: number = 0; contextAndRatio?: { context: CanvasRenderingContext2D; ratio: number; canvas: HTMLCanvasElement }; - _board: number[]; + _board: Uint32Array; /** 已经绘制文字的最小包围盒 */ _bounds: Bounds; @@ -189,20 +189,20 @@ export class CloudLayout extends BaseLayout implements IPro const distSize0 = Math.max(d.width, d.height); if (distSize0 <= maxSize0) { // 扩大尺寸满足最小字体要求 =》 按照要求扩大board - this.expandBoard(this._board, this._bounds, distSize0 / this._size[0]); + this._board = this.expandBoard(this._board, this._bounds, distSize0 / this._size[0]); } else if (this.options.clip) { // 扩大尺寸不满足最小字体要求,但支持裁剪 =》 按最大尺寸扩大,裁剪词语 - this.expandBoard(this._board, this._bounds, maxSize0 / this._size[0]); + this._board = this.expandBoard(this._board, this._bounds, maxSize0 / this._size[0]); } else { // 扩大尺寸不满足最小字体要求,且不支持裁剪 =》 丢弃词语 return true; } } else if (this._placeStatus === 3) { // 扩大画布 - this.expandBoard(this._board, this._bounds); + this._board = this.expandBoard(this._board, this._bounds); } else { // 扩大画布 - this.expandBoard(this._board, this._bounds); + this._board = this.expandBoard(this._board, this._bounds); } // 更新一次状态,下次大尺寸词语进入裁剪 this.updateBoardExpandStatus(d.fontSize); @@ -223,7 +223,7 @@ export class CloudLayout extends BaseLayout implements IPro this._originSize = [...this._size]; const contextAndRatio = this.getContext(vglobal.createCanvas({ width: 1, height: 1 })); this.contextAndRatio = contextAndRatio; - this._board = new Array((this._size[0] >> 5) * this._size[1]).fill(0); + this._board = new Uint32Array((this._size[0] >> 5) * this._size[1]).fill(0); // 已经绘制文字的最小包围盒 this._bounds = null; @@ -340,34 +340,68 @@ export class CloudLayout extends BaseLayout implements IPro this._size = this._size.map(v => v * (1 - minRatio)) as any; } - // 扩充 bitmap - private expandBoard(board: number[], bounds: Bounds, factor?: any) { - const expandedLeftWidth = (this._size[0] * (factor || 1.1) - this._size[0]) >> 5; + /** + * [已优化] 通过重建法高效扩展画板,添加边框。 + * + * @returns {number[]} 返回一个全新的、尺寸更大的画板数组。 + * @notice 这是一个重大变更:此函数不再原地修改 board,而是返回一个新数组。 + * 调用方需要相应地更新其引用,例如:this.board = this.expandBoard(...); + */ + private expandBoard(board: Uint32Array, bounds: Bounds, factor?: any): Uint32Array { + // --- 1. 计算所有尺寸和偏移量 --- + const oldW = this._size[0]; + const oldH = this._size[1]; + const oldRowStride = oldW >> 5; // 每行的“块”数 + + // 计算水平和垂直方向需要增加的“块”数 + const expandedLeftWidth = (oldW * (factor || 1.1) - oldW) >> 5; let diffWidth = expandedLeftWidth * 2 > 2 ? expandedLeftWidth : 2; if (diffWidth % 2 !== 0) { - diffWidth++; + diffWidth++; // 确保为偶数,以便左右对称 } - let diffHeight = Math.ceil((this._size[1] * (diffWidth << 5)) / this._size[0]); + + let diffHeight = Math.ceil((oldH * (diffWidth << 5)) / oldW); if (diffHeight % 2 !== 0) { - diffHeight++; + diffHeight++; // 确保为偶数,以便上下对称 } - const w = this._size[0]; - const h = this._size[1]; - const widthArr = new Array(diffWidth).fill(0); - - const heightArr = new Array((diffHeight / 2) * (diffWidth + (w >> 5))).fill(0); - this.insertZerosToArray(board, h * (w >> 5), heightArr.length + diffWidth / 2); - for (let i = h - 1; i > 0; i--) { - this.insertZerosToArray(board, i * (w >> 5), widthArr.length); + + const newW = oldW + (diffWidth << 5); + const newH = oldH + diffHeight; + const newRowStride = newW >> 5; + + const paddingLeft = diffWidth / 2; + const paddingTop = diffHeight / 2; + + // --- 2. 创建并填充新画板 --- + const newBoard = new Uint32Array(newH * newRowStride).fill(0); + + // --- 3. 一次性将旧数据复制到新画板中心 --- + for (let y = 0; y < oldH; y++) { + // 计算旧画板中当前行的读取位置 + const sourceStartIndex = y * oldRowStride; + const sourceEndIndex = sourceStartIndex + oldRowStride; + + // 计算新画板中当前行的写入位置(考虑顶部和左侧边框) + const destStartIndex = (y + paddingTop) * newRowStride + paddingLeft; + + // 使用 slice 提取行数据(高效),用 set 写入新位置(最高效) + const rowData = board.slice(sourceStartIndex, sourceEndIndex); + newBoard.set(rowData, destStartIndex); } - this.insertZerosToArray(board, 0, heightArr.length + diffWidth / 2); - this._size = [w + (diffWidth << 5), h + diffHeight]; + + // --- 4. 更新尺寸和边界信息 --- + this._size = [newW, newH]; if (bounds) { - bounds[0].x += (diffWidth << 5) / 2; - bounds[0].y += diffHeight / 2; - bounds[1].x += (diffWidth << 5) / 2; - bounds[1].y += diffHeight / 2; + const offsetX = (diffWidth << 5) / 2; + const offsetY = diffHeight / 2; + bounds[0].x += offsetX; + bounds[0].y += offsetY; + bounds[1].x += offsetX; + bounds[1].y += offsetY; } + + // --- 5. 返回新创建的画板 --- + return newBoard; } // 分组扩充填充数组, 一次填充超过大概126000+会报stack overflow,worker环境下大概6w,这边取个比较小的 @@ -402,7 +436,7 @@ export class CloudLayout extends BaseLayout implements IPro return { context: context, ratio: ratio, canvas }; } - private place(board: number[], tag: TagItem, bounds: Bounds, maxRadius: number) { + private place(board: Uint32Array, tag: TagItem, bounds: Bounds, maxRadius: number) { let isCollide = false; // 情况1,超长词语 if (this.shouldShrinkContinue() && (tag.width > this._size[0] || tag.height > this._size[1])) { @@ -725,7 +759,7 @@ function cloudSprite(contextAndRatio: any, d: TagItem, data: TagItem[], di: numb } // Use mask-based collision detection. -function cloudCollide(tag: TagItem, board: number[], size: [number, number]) { +function cloudCollide(tag: TagItem, board: Uint32Array, size: [number, number]) { const sw = size[0] >> 5; const sprite = tag.sprite; const w = tag.width >> 5; diff --git a/packages/vgrammar/package.json b/packages/vgrammar/package.json index d247a1853..83b016a13 100644 --- a/packages/vgrammar/package.json +++ b/packages/vgrammar/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar", - "version": "0.16.12", + "version": "0.16.13", "description": "simple package of vgrammar.", "keywords": [ "visualization", @@ -30,7 +30,7 @@ "test": "" }, "dependencies": { - "@visactor/vgrammar-core": "workspace:0.16.12" + "@visactor/vgrammar-core": "workspace:0.16.13" }, "devDependencies": { "d3-array": "1.x",