antvis/G6

Settting the inner and outer layout for a ComboCombined layout causes the combos to overlap even when relayout is true #5030

bsansone posted onGitHub

Describe the bug

Settting the inner and outer layout for a ComboCombined layout causes the combos to overlap even when relayout is true

Your Example Website or App

https://codesandbox.io/s/combo-combined-prevent-overlap-yqjtps

Steps to Reproduce the Bug or Issue

  1. Go to https://codesandbox.io/s/combo-combined-prevent-overlap-yqjtps
  2. Double click on a combo to expand it
  3. Notice that it overlaps the other nodes and combos, it also does not seem to relayout many of the nodes at all

Expected behavior

I expect that when a combo is expanded, it should prevent intself from overlapping other nodes and combos when relayout is set to true. This seems to work "ok" when you have the layout type set to just comboCombined without using outerLayout and innerLayout.

Screenshots or Videos

Screencast from 10-05-2023 10:43:31 AM.webm

Platform

  • OS: Ubuntu Linux
  • Browser: Chrome
  • Version: 116.0.5845.187 (Official Build) (64-bit)

Additional context

No response


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

posted by github-actions[bot] over 1 year ago

Try this configuration for outerLayout:

outerLayout: new G6.Layout["gForce"]({
  gravity: 10,
  minMovement: 0.1,
  factor: 2,
  linkDistance: (edge, source, target) => {
    const nodeSize = ((source.size?.[0] || 30) + (target.size?.[0] || 30)) / 2;
    return Math.min(nodeSize * 1.5, 700);
  }
})
posted by Yanyan-Wang over 1 year ago

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。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests