使用toggleVisible方法实现展开/收起下游节点功能,设置节点的visible:true时,节点上相关联的边也会被设置为visible:true
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
### 问题描述
使用toggleVisible方法实现展开/收起下游节点功能,设置节点的visible:true时,节点上相关联的边也会被设置为visible:true。
### 重现链接
见重现步骤
### 重现步骤
问题重现视频:
https://github.com/antvis/X6/assets/24401313/aab65dcd-e57c-481b-8120-61c908ed1238
问题重现步骤描述:
1. 收起「t10_3-3 节点」的下游节点,隐藏所有下游边,由于「下游节点 dim_pub_shop_label_info_da」也是「t2_3-1 节点」的下游节点,所以该节点没有隐藏
2. 收起「t2_3-1 节点」的下游节点,隐藏所有下游边 和 下游节点
3. 展开「t2_3-1 节点」的下游节点,此时不仅显示了「t2_3-1 节点」的所有下游节点 和 下游边,还将「t10_3-3 节点」与其「下游节点 dim_pub_shop_label_info_da」之间的边也显示出来了
问题原因:
查看源码发现 X6 内部在处理 隐藏/显示 node时,会同步变更node上所有的 输入边&输出边的visible,从而实现node 隐藏/显示 时node上所有的 输入边&输出边 也 隐藏/显示

### 预期行为
在 变更 node 的 visible 时,不影响 node上所有的 输入边&输出边 的 visible
### 平台
- 操作系统: [macOS]
- 网页浏览器: [Google Chrome]
- X6 版本: [2.16.1]
### 屏幕截图或视频(可选)
_No response_
### 补充说明(可选)
_No response_
Contributor guide
Research direction
Start at the toggleVisible method and the internal node visibility handling described in the issue, then reproduce the three-node sequence from the listed steps. Done means changing a node's visible state no longer changes the visible state of its incoming or outgoing edges.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100