Open
Conversation
1cadc1c to
77c5204
Compare
2de1621 to
00834b3
Compare
xile611
approved these changes
Sep 23, 2025
xuefei1313
commented
Mar 20, 2026
Contributor
Author
xuefei1313
left a comment
There was a problem hiding this comment.
整体实现逻辑清晰,充分利用了 VChart 的扩展机制。但有以下建议:
- 完善测试:该功能涉及复杂的布局和交互逻辑,建议在
__tests__中增加相应的单元测试或集成测试。 - 文档与示例:建议补充该图表类型的数据结构说明(特别是
subNode的组织方式)以及对应的 Demo 示例。 - 交互性能:在
_handleNodeRelatedClick中存在较多的大数组遍历和getDatumOfGraphic调用,对于数据量较大的场景可能存在性能隐患,建议关注。
| const sourceNode = nodeDatum.sourceNode; | ||
| // 上游路径始终只选取第一个 | ||
| const firstTarget = sourceNode.targetLinks[0]; | ||
| if (!firstTarget) { |
Contributor
Author
There was a problem hiding this comment.
这里只选取了第一个 targetLink 进行处理。在桑基图中,一个节点可能有多个输入边。如果只取第一个,是否会丢失其他输入路径的对比信息?建议确认此处逻辑。
| // 同时需要清除 hover | ||
| const allNodeElements = this._nodeMark.getGraphics(); | ||
| if (allNodeElements || !allNodeElements.length) { | ||
| allNodeElements.forEach(el => { |
Contributor
Author
There was a problem hiding this comment.
此处的判断条件 allNodeElements || !allNodeElements.length 逻辑上有些奇怪。通常应该是 if (allNodeElements && allNodeElements.length)。目前的写法在 allNodeElements 为空数组时也会进入。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
🔗 Related PR link
🐞 Bugserver case id
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough