[Bug]: 缩进树展示异常
- Dominant language
- TypeScript
- Stars
- 12.3k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug / 问题描述
1. 缩进树初始化后,由于节点多,树本身不会把根节点展示在左上角,而是整个树的中间区域,导致看到的是无效信息
可以通过translateTo去定位根节点到左上角,但这样用起来不友好,还会多一段画面变化。希望可以有配置,初始化时能决定根节点的位置
2. 树中某个节点,收缩之后,会留白很大一部分空间,不会重新利用这段空间。希望能自动重新计算一下部局。目前也没有办法监听到collapse和expand事件,让我自己来调用layout()。
展开的图:
收缩了一个节点的图
3. 如果我把一些节点在初始化时collapsed设置为true,当我在画布点击这个节点展开时,子节点的位置会错乱。看起来位置是在第一次初始化时就计算好了,
4. await this.graph.render(); 永远不会返回。后面的代码无法执行。看源代码render()声明是async的但是最终不会返回一个promise
### Reproduction link / 复现链接
_No response_
### Steps to Reproduce the Bug or Issue / 重现步骤
_No response_
### Version / 版本
🆕 5.x
### OS / 操作系统
- [ ] macOS
- [x] Windows
- [ ] Linux
- [ ] Others / 其他
### Browser / 浏览器
- [ ] Chrome
- [x] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the indentation-tree cases in G6: initial root positioning, collapse and expand layout updates, nodes initially marked collapsed, and the await graph.render() behavior. Inspect the tree layout entry points and the translateTo, layout(), and render() APIs mentioned in the report. Done means these cases behave predictably, space is reclaimed after collapsing, expanded nodes are positioned correctly, and render() resolves.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100