Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.7.9版本dagre布局自定义节点,出现重叠情况 #6183

Open
nancyzhan opened this issue Aug 14, 2024 · 3 comments
Open

4.7.9版本dagre布局自定义节点,出现重叠情况 #6183

nancyzhan opened this issue Aug 14, 2024 · 3 comments
Labels
layout Issue about layout v4

Comments

@nancyzhan
Copy link

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, // 防止节点重叠
}
企业微信截图_17236230006043

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

@salt-SeeSea
Copy link

可能得设置一下节点的size属性

@yvonneyx yvonneyx added v4 layout Issue about layout labels Oct 25, 2024
@halaproliu
Copy link

5.0.24 dagre布局自定义节点也有类似问题,请问如何解决

@Cherry860
Copy link

4.8.15也遇到这个问题了,另外设置了layer 有时候层级也是错乱的 有解决方案吗 裂开了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
layout Issue about layout v4
Projects
None yet
Development

No branches or pull requests

5 participants