diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 36009d494..c6c705dc3 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.15.6 - '@visactor/vgrammar-coordinate': workspace:0.15.6 - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-hierarchy': workspace:0.15.6 - '@visactor/vgrammar-plot': workspace:0.15.6 - '@visactor/vgrammar-projection': workspace:0.15.6 - '@visactor/vgrammar-sankey': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 - '@visactor/vgrammar-wordcloud': workspace:0.15.6 - '@visactor/vgrammar-wordcloud-shape': workspace:0.15.6 + '@visactor/vgrammar': workspace:0.15.7 + '@visactor/vgrammar-coordinate': workspace:0.15.7 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-hierarchy': workspace:0.15.7 + '@visactor/vgrammar-plot': workspace:0.15.7 + '@visactor/vgrammar-projection': workspace:0.15.7 + '@visactor/vgrammar-sankey': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 + '@visactor/vgrammar-wordcloud': workspace:0.15.7 + '@visactor/vgrammar-wordcloud-shape': workspace:0.15.7 '@visactor/vrender': 0.21.15 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 @@ -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.15.6 - '@visactor/vgrammar-coordinate': workspace:0.15.6 - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-hierarchy': workspace:0.15.6 - '@visactor/vgrammar-plot': workspace:0.15.6 - '@visactor/vgrammar-projection': workspace:0.15.6 - '@visactor/vgrammar-sankey': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 - '@visactor/vgrammar-venn': workspace:0.15.6 - '@visactor/vgrammar-wordcloud': workspace:0.15.6 - '@visactor/vgrammar-wordcloud-shape': workspace:0.15.6 + '@visactor/vgrammar': workspace:0.15.7 + '@visactor/vgrammar-coordinate': workspace:0.15.7 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-hierarchy': workspace:0.15.7 + '@visactor/vgrammar-plot': workspace:0.15.7 + '@visactor/vgrammar-projection': workspace:0.15.7 + '@visactor/vgrammar-sankey': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 + '@visactor/vgrammar-venn': workspace:0.15.7 + '@visactor/vgrammar-wordcloud': workspace:0.15.7 + '@visactor/vgrammar-wordcloud-shape': workspace:0.15.7 '@visactor/vrender': 0.21.15 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 @@ -153,7 +153,7 @@ importers: '@types/d3-geo': ^1.11.1 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 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.15.6 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vutils': ~0.19.4 eslint: ~8.18.0 jest: ~29.5.0 @@ -229,8 +229,8 @@ importers: '@types/jest': ~29.5.0 '@types/node': '*' '@visactor/vdataset': ~0.19.4 - '@visactor/vgrammar-coordinate': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-coordinate': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vrender-components': 0.21.15 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 @@ -279,14 +279,14 @@ importers: '@types/jest': ~29.5.0 '@types/node': '*' '@types/node-fetch': 2.6.4 - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-hierarchy': workspace:0.15.6 - '@visactor/vgrammar-plot': workspace:0.15.6 - '@visactor/vgrammar-projection': workspace:0.15.6 - '@visactor/vgrammar-sankey': workspace:0.15.6 - '@visactor/vgrammar-venn': workspace:0.15.6 - '@visactor/vgrammar-wordcloud': workspace:0.15.6 - '@visactor/vgrammar-wordcloud-shape': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-hierarchy': workspace:0.15.7 + '@visactor/vgrammar-plot': workspace:0.15.7 + '@visactor/vgrammar-projection': workspace:0.15.7 + '@visactor/vgrammar-sankey': workspace:0.15.7 + '@visactor/vgrammar-venn': workspace:0.15.7 + '@visactor/vgrammar-wordcloud': workspace:0.15.7 + '@visactor/vgrammar-wordcloud-shape': workspace:0.15.7 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.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 '@visactor/vutils': ~0.19.4 @@ -382,9 +382,9 @@ importers: '@types/d3-geo': ^1.11.1 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-coordinate': workspace:0.15.6 - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-coordinate': workspace:0.15.7 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vrender-components': 0.21.15 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 @@ -435,8 +435,8 @@ importers: '@types/d3-geo': ^1.11.1 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vutils': ~0.19.4 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.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 '@visactor/vutils': ~0.19.4 @@ -559,8 +559,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 '@visactor/vutils': ~0.19.4 @@ -602,8 +602,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 '@visactor/vutils': ~0.19.4 @@ -645,8 +645,8 @@ importers: '@rushstack/eslint-patch': ~1.1.4 '@types/jest': ~29.5.0 '@types/node': '*' - '@visactor/vgrammar-core': workspace:0.15.6 - '@visactor/vgrammar-util': workspace:0.15.6 + '@visactor/vgrammar-core': workspace:0.15.7 + '@visactor/vgrammar-util': workspace:0.15.7 '@visactor/vrender-core': 0.21.15 '@visactor/vrender-kits': 0.21.15 '@visactor/vscale': ~0.19.4 diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index bed1c87a3..606323bc5 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -1 +1 @@ -[{"definitionName":"lockStepVersion","policyName":"vgrammarMain","version":"0.15.6","mainProject":"@visactor/vgrammar-core","nextBump":"patch"}] +[{"definitionName":"lockStepVersion","policyName":"vgrammarMain","version":"0.15.7","mainProject":"@visactor/vgrammar-core","nextBump":"patch"}] diff --git a/docs/dev-demos/package.json b/docs/dev-demos/package.json index 437315dea..0970b51bc 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.4", - "@visactor/vgrammar": "workspace:0.15.6", - "@visactor/vgrammar-core": "workspace:0.15.6", - "@visactor/vgrammar-hierarchy": "workspace:0.15.6", - "@visactor/vgrammar-sankey": "workspace:0.15.6", - "@visactor/vgrammar-projection": "workspace:0.15.6", - "@visactor/vgrammar-wordcloud": "workspace:0.15.6", - "@visactor/vgrammar-wordcloud-shape": "workspace:0.15.6", - "@visactor/vgrammar-plot": "workspace:0.15.6", + "@visactor/vgrammar": "workspace:0.15.7", + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-hierarchy": "workspace:0.15.7", + "@visactor/vgrammar-sankey": "workspace:0.15.7", + "@visactor/vgrammar-projection": "workspace:0.15.7", + "@visactor/vgrammar-wordcloud": "workspace:0.15.7", + "@visactor/vgrammar-wordcloud-shape": "workspace:0.15.7", + "@visactor/vgrammar-plot": "workspace:0.15.7", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15", "@visactor/vrender": "0.21.15", @@ -27,8 +27,8 @@ "lodash": "4.17.21", "typescript": "4.9.5", "vite": "3.2.6", - "@visactor/vgrammar-util": "workspace:0.15.6", - "@visactor/vgrammar-coordinate": "workspace:0.15.6", + "@visactor/vgrammar-util": "workspace:0.15.7", + "@visactor/vgrammar-coordinate": "workspace:0.15.7", "@vitejs/plugin-react": "3.1.0" } } diff --git a/docs/site/assets/changelog/en/release.md b/docs/site/assets/changelog/en/release.md index 0d664defd..dda913b6c 100644 --- a/docs/site/assets/changelog/en/release.md +++ b/docs/site/assets/changelog/en/release.md @@ -1,3 +1,17 @@ +# v0.15.6 + +2025-02-26 + + +**🐛 Bug fix** + +- **@visactor/vgrammar-core**: upgrade vrender to 0.21.15, vutils to 0.19.14 +- **@visactor/vgrammar-core**: fix default param for animator stop + + + +[more detail about v0.15.6](https://github.com/VisActor/VGrammar/releases/tag/v0.15.6) + # v0.15.3 2025-01-09 diff --git a/docs/site/assets/changelog/zh/release.md b/docs/site/assets/changelog/zh/release.md index b5cf52131..ca51f10e9 100644 --- a/docs/site/assets/changelog/zh/release.md +++ b/docs/site/assets/changelog/zh/release.md @@ -1,3 +1,17 @@ +# v0.15.6 + +2025-02-26 + + +**🐛 功能修复** + +- **@visactor/vgrammar-core**: upgrade vrender to 0.21.15, vutils to 0.19.14 +- **@visactor/vgrammar-core**: fix default param for animator stop + + + +[更多详情请查看 v0.15.6](https://github.com/VisActor/VGrammar/releases/tag/v0.15.6) + # v0.15.3 2025-01-09 diff --git a/docs/site/package.json b/docs/site/package.json index b878297f3..236b3f2b4 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.4", - "@visactor/vgrammar": "workspace:0.15.6", - "@visactor/vgrammar-core": "workspace:0.15.6", - "@visactor/vgrammar-hierarchy": "workspace:0.15.6", - "@visactor/vgrammar-sankey": "workspace:0.15.6", - "@visactor/vgrammar-projection": "workspace:0.15.6", - "@visactor/vgrammar-wordcloud": "workspace:0.15.6", - "@visactor/vgrammar-wordcloud-shape": "workspace:0.15.6", - "@visactor/vgrammar-plot": "workspace:0.15.6", - "@visactor/vgrammar-util": "workspace:0.15.6", - "@visactor/vgrammar-coordinate": "workspace:0.15.6", - "@visactor/vgrammar-venn": "workspace:0.15.6", + "@visactor/vgrammar": "workspace:0.15.7", + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-hierarchy": "workspace:0.15.7", + "@visactor/vgrammar-sankey": "workspace:0.15.7", + "@visactor/vgrammar-projection": "workspace:0.15.7", + "@visactor/vgrammar-wordcloud": "workspace:0.15.7", + "@visactor/vgrammar-wordcloud-shape": "workspace:0.15.7", + "@visactor/vgrammar-plot": "workspace:0.15.7", + "@visactor/vgrammar-util": "workspace:0.15.7", + "@visactor/vgrammar-coordinate": "workspace:0.15.7", + "@visactor/vgrammar-venn": "workspace:0.15.7", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15", "@visactor/vrender": "0.21.15", diff --git a/packages/vgrammar-coordinate/package.json b/packages/vgrammar-coordinate/package.json index 52d0c64a4..38ad0c69e 100644 --- a/packages/vgrammar-coordinate/package.json +++ b/packages/vgrammar-coordinate/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-coordinate", - "version": "0.15.6", + "version": "0.15.7", "description": "Coordinates for VGrammar", "keywords": [ "coordinate", @@ -35,7 +35,7 @@ }, "dependencies": { "@visactor/vutils": "~0.19.4", - "@visactor/vgrammar-util": "workspace:0.15.6" + "@visactor/vgrammar-util": "workspace:0.15.7" }, "devDependencies": { "@internal/bundler": "workspace:*", diff --git a/packages/vgrammar-core/CHANGELOG.json b/packages/vgrammar-core/CHANGELOG.json index 8baf9a881..6e510f59a 100644 --- a/packages/vgrammar-core/CHANGELOG.json +++ b/packages/vgrammar-core/CHANGELOG.json @@ -1,6 +1,18 @@ { "name": "@visactor/vgrammar-core", "entries": [ + { + "version": "0.15.7", + "tag": "@visactor/vgrammar-core_v0.15.7", + "date": "Thu, 27 Feb 2025 04:26:31 GMT", + "comments": { + "none": [ + { + "comment": "fix: when sankey has `setNodeLayer`, the maxDepth should be updated by this\n\n" + } + ] + } + }, { "version": "0.15.6", "tag": "@visactor/vgrammar-core_v0.15.6", diff --git a/packages/vgrammar-core/CHANGELOG.md b/packages/vgrammar-core/CHANGELOG.md index b73e45f57..9e14b4626 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, 13 Feb 2025 09:57:00 GMT and should not be manually modified. +This log was last generated on Thu, 27 Feb 2025 04:26:31 GMT and should not be manually modified. + +## 0.15.7 +Thu, 27 Feb 2025 04:26:31 GMT + +### Updates + +- fix: when sankey has `setNodeLayer`, the maxDepth should be updated by this + + ## 0.15.6 Thu, 13 Feb 2025 09:57:00 GMT diff --git a/packages/vgrammar-core/package.json b/packages/vgrammar-core/package.json index b43896491..184d13c1d 100644 --- a/packages/vgrammar-core/package.json +++ b/packages/vgrammar-core/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-core", - "version": "0.15.6", + "version": "0.15.7", "description": "VGrammar is a visual grammar library", "keywords": [ "grammar", @@ -37,8 +37,8 @@ "dependencies": { "@visactor/vutils": "~0.19.4", "@visactor/vdataset": "~0.19.4", - "@visactor/vgrammar-coordinate": "workspace:0.15.6", - "@visactor/vgrammar-util": "workspace:0.15.6", + "@visactor/vgrammar-coordinate": "workspace:0.15.7", + "@visactor/vgrammar-util": "workspace:0.15.7", "@visactor/vscale": "~0.19.4", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15", diff --git a/packages/vgrammar-full/package.json b/packages/vgrammar-full/package.json index dec7c62f0..b209f079b 100644 --- a/packages/vgrammar-full/package.json +++ b/packages/vgrammar-full/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-full", - "version": "0.15.6", + "version": "0.15.7", "description": "full packages of vgrammar.", "keywords": [ "visualization", @@ -33,14 +33,14 @@ "test": "" }, "dependencies": { - "@visactor/vgrammar-core": "workspace:0.15.6", - "@visactor/vgrammar-hierarchy": "workspace:0.15.6", - "@visactor/vgrammar-plot": "workspace:0.15.6", - "@visactor/vgrammar-projection": "workspace:0.15.6", - "@visactor/vgrammar-sankey": "workspace:0.15.6", - "@visactor/vgrammar-wordcloud": "workspace:0.15.6", - "@visactor/vgrammar-wordcloud-shape": "workspace:0.15.6", - "@visactor/vgrammar-venn": "workspace:0.15.6" + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-hierarchy": "workspace:0.15.7", + "@visactor/vgrammar-plot": "workspace:0.15.7", + "@visactor/vgrammar-projection": "workspace:0.15.7", + "@visactor/vgrammar-sankey": "workspace:0.15.7", + "@visactor/vgrammar-wordcloud": "workspace:0.15.7", + "@visactor/vgrammar-wordcloud-shape": "workspace:0.15.7", + "@visactor/vgrammar-venn": "workspace:0.15.7" }, "devDependencies": { "d3-array": "1.x", diff --git a/packages/vgrammar-hierarchy/package.json b/packages/vgrammar-hierarchy/package.json index 7e74588ad..a63a5fc38 100644 --- a/packages/vgrammar-hierarchy/package.json +++ b/packages/vgrammar-hierarchy/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-hierarchy", - "version": "0.15.6", + "version": "0.15.7", "description": "Layout of hierarchical data for VGrammar", "keywords": [ "hierarchy", @@ -39,8 +39,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.4", - "@visactor/vgrammar-core": "workspace:0.15.6", - "@visactor/vgrammar-util": "workspace:0.15.6", + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-util": "workspace:0.15.7", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15" }, diff --git a/packages/vgrammar-plot/package.json b/packages/vgrammar-plot/package.json index 686a93195..6397aff1e 100644 --- a/packages/vgrammar-plot/package.json +++ b/packages/vgrammar-plot/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-plot", - "version": "0.15.6", + "version": "0.15.7", "description": "Plots of vgrammar.", "keywords": [ "plot", @@ -36,9 +36,9 @@ "dependencies": { "@visactor/vscale": "~0.19.4", "@visactor/vutils": "~0.19.4", - "@visactor/vgrammar-util": "workspace:0.15.6", - "@visactor/vgrammar-coordinate": "workspace:0.15.6", - "@visactor/vgrammar-core": "workspace:0.15.6", + "@visactor/vgrammar-util": "workspace:0.15.7", + "@visactor/vgrammar-coordinate": "workspace:0.15.7", + "@visactor/vgrammar-core": "workspace:0.15.7", "@visactor/vrender-components": "0.21.15", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15" diff --git a/packages/vgrammar-projection/package.json b/packages/vgrammar-projection/package.json index 7f7950b7f..ec29bd736 100644 --- a/packages/vgrammar-projection/package.json +++ b/packages/vgrammar-projection/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-projection", - "version": "0.15.6", + "version": "0.15.7", "description": "Projections for map, used in VGrammar.", "keywords": [ "projection", @@ -35,8 +35,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.4", - "@visactor/vgrammar-util": "workspace:0.15.6", - "@visactor/vgrammar-core": "workspace:0.15.6", + "@visactor/vgrammar-util": "workspace:0.15.7", + "@visactor/vgrammar-core": "workspace:0.15.7", "d3-geo": "^1.12.1" }, "devDependencies": { diff --git a/packages/vgrammar-sankey/package.json b/packages/vgrammar-sankey/package.json index ce28174d8..f3304bf39 100644 --- a/packages/vgrammar-sankey/package.json +++ b/packages/vgrammar-sankey/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-sankey", - "version": "0.15.6", + "version": "0.15.7", "description": "Layout of sankey chart, used by VGrammar", "keywords": [ "sankey", @@ -37,8 +37,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.4", - "@visactor/vgrammar-core": "workspace:0.15.6", - "@visactor/vgrammar-util": "workspace:0.15.6", + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-util": "workspace:0.15.7", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15" }, diff --git a/packages/vgrammar-sankey/src/layout.ts b/packages/vgrammar-sankey/src/layout.ts index fa75fd72b..16a1fe469 100644 --- a/packages/vgrammar-sankey/src/layout.ts +++ b/packages/vgrammar-sankey/src/layout.ts @@ -164,7 +164,7 @@ export class SankeyLayout { this.computeNodeEndDepths(nodes); } - if (this._maxDepth <= 1) { + if (this._maxDepth <= 0) { // empty data return null; } @@ -475,6 +475,8 @@ export class SankeyLayout { let next: SankeyNodeElement[]; let nextMap: Record; let depth = 0; + let maxDepth = -1; + const setNodeLayer = isFunction(this.options.setNodeLayer) ? this.options.setNodeLayer : null; while (current.length && depth < n) { next = []; @@ -484,7 +486,12 @@ export class SankeyLayout { const node = current[i]; if (node) { - node.depth = depth; + // 防止用户只设置了部分节点的层级 + node.depth = setNodeLayer ? setNodeLayer(node.datum) ?? depth : depth; + + if (setNodeLayer) { + maxDepth = Math.max(node.depth, maxDepth); + } if (node.sourceLinks && node.sourceLinks.length) { for (let j = 0, linkLen = node.sourceLinks.length; j < linkLen; j++) { const link = node.sourceLinks[j]; @@ -504,7 +511,7 @@ export class SankeyLayout { this._logger.warn('Error: there is a circular link'); } - this._maxDepth = depth; + this._maxDepth = setNodeLayer ? maxDepth + 1 : depth; } computeNodeEndDepths(nodes: SankeyNodeElement[]) { diff --git a/packages/vgrammar-util/package.json b/packages/vgrammar-util/package.json index a90d42474..d7730e6dc 100644 --- a/packages/vgrammar-util/package.json +++ b/packages/vgrammar-util/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-util", - "version": "0.15.6", + "version": "0.15.7", "description": "The common utils functions of VGrammar", "keywords": [ "utils", diff --git a/packages/vgrammar-venn/package.json b/packages/vgrammar-venn/package.json index 34e1ed243..4b3c5655e 100644 --- a/packages/vgrammar-venn/package.json +++ b/packages/vgrammar-venn/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-venn", - "version": "0.15.6", + "version": "0.15.7", "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.15.6", - "@visactor/vgrammar-util": "workspace:0.15.6", + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-util": "workspace:0.15.7", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15", "@visactor/vutils": "~0.19.4" diff --git a/packages/vgrammar-wordcloud-shape/package.json b/packages/vgrammar-wordcloud-shape/package.json index afe8a8588..72280c48a 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.15.6", + "version": "0.15.7", "description": "Layout WordCloud in specified shape, this is a transform for VGrammar.", "keywords": [ "wordcloud", @@ -36,8 +36,8 @@ "dependencies": { "@visactor/vutils": "~0.19.4", "@visactor/vscale": "~0.19.4", - "@visactor/vgrammar-core": "workspace:0.15.6", - "@visactor/vgrammar-util": "workspace:0.15.6", + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-util": "workspace:0.15.7", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15" }, diff --git a/packages/vgrammar-wordcloud/package.json b/packages/vgrammar-wordcloud/package.json index 5a97cc8d8..b6ceeebf4 100644 --- a/packages/vgrammar-wordcloud/package.json +++ b/packages/vgrammar-wordcloud/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar-wordcloud", - "version": "0.15.6", + "version": "0.15.7", "description": "WordCloud layout transform for VGrammar", "keywords": [ "wordcloud", @@ -35,8 +35,8 @@ }, "dependencies": { "@visactor/vutils": "~0.19.4", - "@visactor/vgrammar-core": "workspace:0.15.6", - "@visactor/vgrammar-util": "workspace:0.15.6", + "@visactor/vgrammar-core": "workspace:0.15.7", + "@visactor/vgrammar-util": "workspace:0.15.7", "@visactor/vrender-core": "0.21.15", "@visactor/vrender-kits": "0.21.15" }, diff --git a/packages/vgrammar/package.json b/packages/vgrammar/package.json index a76b1ab0b..98a00ea50 100644 --- a/packages/vgrammar/package.json +++ b/packages/vgrammar/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vgrammar", - "version": "0.15.6", + "version": "0.15.7", "description": "simple package of vgrammar.", "keywords": [ "visualization", @@ -30,7 +30,7 @@ "test": "" }, "dependencies": { - "@visactor/vgrammar-core": "workspace:0.15.6" + "@visactor/vgrammar-core": "workspace:0.15.7" }, "devDependencies": { "d3-array": "1.x",