G6 icon indicating copy to clipboard operation
G6 copied to clipboard

dagre布局,自定义node时(jsx或者react组件),边位置错乱

Open yongchaoo opened this issue 1 year ago • 5 comments

Describe the bug

dagre布局,自定义node时(jsx或者react组件)有问题:

  • 边位置错乱
  • 有时边折线拐弯

如图:

WeChatWorkScreenshot_63c4dab2-d8ef-4082-902a-32e3f27a31e2

Snipaste_2023-10-30_18-01-06

和这个问题类似,他的问题我也遇到过:https://github.com/antvis/G6/issues/4435

Your Example Website or App

https://jsfiddle.net/xiaohei001/0jt97cxk/43/

Steps to Reproduce the Bug or Issue

https://jsfiddle.net/xiaohei001/0jt97cxk/43/

Expected behavior

边能完整画出来,有三角,位置正确

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS]
  • Browser: [e.g. Chrome]
  • Version: [e.g. 91.1]

Additional context

No response

yongchaoo avatar Oct 30 '23 09:10 yongchaoo

hi @yongchaoo, welcome!

github-actions[bot] avatar Oct 30 '23 09:10 github-actions[bot]

Hi @yongchaoo, Please star this repo if you find it useful! Thanks :star:! 你好 @yongchaoo。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

github-actions[bot] avatar Oct 30 '23 09:10 github-actions[bot]

我这里看到的你发的 demo 每个节点左侧有一大块空白,像是边没连到位,原因是箭头的偏移量设置问题,直线缩短给箭头的偏移量留出位置导致。如下修改: image

如果是你截图中的问题,尝试给节点设置 anchorPoints,即边连入的位置,边也可以设置选择对应的连入位置,参考文档:https://g6.antv.antgroup.com/manual/middle/elements/nodes/anchorpoint

image

Yanyan-Wang avatar Nov 02 '23 08:11 Yanyan-Wang

@Yanyan-Wang 我也有同样的问题,然后在例子里试了一下,试出来的效果跟你的不太一样,可以帮忙看看是差在哪里吗? 怎么能让连线分布的比较均匀? 111111

Dawnwangzi avatar Nov 13 '23 08:11 Dawnwangzi

我这里看到的你发的 demo 每个节点左侧有一大块空白,像是边没连到位,原因是箭头的偏移量设置问题,直线缩短给箭头的偏移量留出位置导致。如下修改: image

如果是你截图中的问题,尝试给节点设置 anchorPoints,即边连入的位置,边也可以设置选择对应的连入位置,参考文档:https://g6.antv.antgroup.com/manual/middle/elements/nodes/anchorpoint

image

我这里看到的你发的 demo 每个节点左侧有一大块空白,像是边没连到位,原因是箭头的偏移量设置问题,直线缩短给箭头的偏移量留出位置导致。如下修改: image

如果是你截图中的问题,尝试给节点设置 anchorPoints,即边连入的位置,边也可以设置选择对应的连入位置,参考文档:https://g6.antv.antgroup.com/manual/middle/elements/nodes/anchorpoint

image

似乎不好使

yongchaoo avatar Nov 16 '23 06:11 yongchaoo

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

github-actions[bot] avatar Jul 05 '24 05:07 github-actions[bot]