4.7.9版本dagre布局自定义节点,出现重叠情况
- Dominant language
- TypeScript
- Stars
- 12.3k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug / 问题描述
4.7.9版本dagre布局自定义节点,会出现重叠情况。对应布局代码
layout: {
type: 'dagre',
rankdir: 'LR',
nodesep: 5,
ranksepFunc: (node) => {
// 获取节点的宽度
const nodeWidth = node.attr.computeWidth; // 如果模型中没有宽度,设为默认值
if(nodeWidth > 200) {
return nodeWidth/2;
}
return 100;
},
controlPoints: false,
preventOverlap: true, // 防止节点重叠
}

### Reproduction link / 重现链接
_No response_
### Steps to Reproduce the Bug or Issue / 重现步骤
_No response_
### G6 Version / G6 版本
4.x
### Operating System / 操作系统
Windows
### Browser / 浏览器
Chrome
### Additional context / 补充说明
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the G6 4.7.9 dagre layout configuration in the issue, focusing on custom nodes, preventOverlap, nodesep, and ranksepFunc. Reproduce the reported overlap in Chrome on Windows using the supplied settings; done means custom nodes no longer overlap, with behavior checked against the provided screenshot.
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