Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Overlapped nodes in hierarchical layout #1631

Closed
atima opened this issue Feb 3, 2016 · 9 comments
Closed

Overlapped nodes in hierarchical layout #1631

atima opened this issue Feb 3, 2016 · 9 comments

Comments

@atima
Copy link

atima commented Feb 3, 2016

Some nodes are overlapped after update to v.4.13.0. Please see https://jsfiddle.net/atima/dtmz8otj/
Node 11 appears behind node 12 (try dragging node 12 around and you should see node 11). I also expect node 7,8,9 to be in triangle (try dragging node 8).

I think the problem is in _setPositionForHierarchy (lib/network/modules/LayoutEngine.js). There is no overlapped nodes if I force doNotUpdate = true (that is identical to I roll back just this part to the previous version).

Could you fix this? or any suggestion about how to fix this is appreciated. I don't want to simply force doNotUpdate because it makes network.fit() weird.

Best regards.

@josdejong
Copy link
Contributor

That can indeed happen with force directed layouts. You can try to use non-physics based layouts, like in the following example: http://visjs.org/examples/network/layout/hierarchicalLayoutWithoutPhysics.html

@AlexDM0
Copy link
Contributor

AlexDM0 commented Feb 4, 2016

The full overlap was an older issue, which version of vis are you using?

Regards

On 04 Feb 2016, at 14:43, Jos de Jong [email protected] wrote:

That can indeed happen with force directed layouts. You can try to use non-physics based layouts, like in the following example: http://visjs.org/examples/network/layout/hierarchicalLayoutWithoutPhysics.html


Reply to this email directly or view it on GitHub.

@atima
Copy link
Author

atima commented Feb 4, 2016

I use the most recent one (v.4.13.0). My problem didn't exist in the previous version (v.4.12.0). I tried disable physics but had no luck. Physics-based layout seems to provide a better graph since they will not overlap again after I dragged the overlapped node out of its initial position.

@JoeKehr
Copy link

JoeKehr commented Feb 6, 2016

I have the same problem here.
I've seen that the issue was resolved one year and a half, so I forked the jsfiddle provided by the one who reported the issue and the bug seems to be back.
Here is the forked jsfiddle, so you will have several samples for your tests :)

AlexDM0 pushed a commit that referenced this issue Feb 13, 2016
… no longer occur.

- Added parentCentralization option for hierarchical layout.
@AlexDM0
Copy link
Contributor

AlexDM0 commented Feb 13, 2016

Hi all,

I've fixed this on the develop branch. Both your examples allowed me to find two different causes for this so thanks a lot!

Regards

@ThaDafinser
Copy link

@AlexDM0 i tried the develop branch and some things are fixed there, but not all.

I added an example here with the latest tag, but maybe you can try it with develop as well?
https://jsfiddle.net/q2dcnq2p/

With develop it looks this way:
image

@AlexDM0
Copy link
Contributor

AlexDM0 commented Feb 23, 2016

Hi,

Thanks for catching this. Guess it was messed up after fixing another bug. Its a tricky system... It should be fixed on develop now.

Regards

@ThaDafinser
Copy link

Really awesome @AlexDM0 👍

I can only imagine how complex that was ...

@mojoaxel mojoaxel added this to the v4.17 milestone Sep 4, 2016
@mojoaxel
Copy link
Member

This looks fixes in the current version v4.16.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants