antvis/G6
The issue has been closed
indented 布局节点高度不一致时会出现重叠的情况 #4070
hengistchan posted onGitHub
Describe the bug
indented 布局节点高度不一致时会出现重叠的情况 <img width="718" alt="image" src="https://user-images.githubusercontent.com/46242125/202368763-793fcfe0-cfef-468c-9f29-fe34b893dd93.png">
Your Example Website or App
https://stackblitz.com/edit/react-ts-thygty?file=G6.tsx
Steps to Reproduce the Bug or Issue
节点高度由每个节点自行配置,在 draw 函数中读取 height 属性并设置 container keyshape 高度
{
id: '2',
label: '2',
height: 34,
}
<img width="740" alt="image" src="https://user-images.githubusercontent.com/46242125/202369052-72712b43-6676-4ba8-9083-dee887fb05fc.png"> 如上,这个框应该出现在下面 在 layout 配置中有配置了 getHeight 函数
getHeight(cfg: any) {
const height = cfg?.height;
return height ?? 34;
}
Expected behavior
自适应节点高度
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: Chrome
- Version: 版本 107.0.5304.110(正式版本) (arm64)
Additional context
No response