antvis / layout

Layout algorithms for graphs.
193 stars 55 forks source link

dagreCompound布局计算的combos的offsetX,offsetY不准确 #185

Open pg54 opened 11 months ago

pg54 commented 11 months ago

offsetX,offsetY不准确,fixSize是准确的,群组大小不能包裹住群组内的节点 image

demo地址: https://codesandbox.io/s/beautiful-dirac-wylrwm?file=/index.ts

simplejason commented 10 months ago

dagreCompound 布局目前针对 G6 进行了兼容优化,可能存在节点位置问题,我会跟进看下如何优化

simplejason commented 9 months ago

总结: G6 和 X6 在节点位置渲染方面有差异,dagreCompound 采用 G6 节点中心为 x y 相对位置来计算,x6 节点是左下角为 x y 渲染,因此我们在 x6 中使用时需要手动复位节点位置,我在 demo 里增加了描述,可以参考看下 :) DEMO LINK