Mugges
Mugges

Reputation: 13

Prevent VIS.js from crossing edges when positioning new nodes in a hierarchical network

I create a hierarchical network with Vis.js. I have defined that a node can have children, but they are not displayed if I want them to be. With one click I can load the data for the children from the backend and insert the loaded nodes and edges.

The problem is that new nodes are sometimes positioned so that the edges cross, even though this is not necessary.

Can I define some option to affect the positioning in any way?

I found this 6y old thread vis.js hierarchical network graph layout.
This is about version 4.x. an i am now on v9.1.9. Maybe there is a solution out there and i don't want to warm up any dead bodies :-)

If i open Node 5 first and Node 6 later, VIS.js crosses the edges.

If i open Node 6 first and Nodes 18 and 28 are inserted and then i open Node 5 with inserted Nodes 19 and 29 it look ok

checked official documentation, google and stackoverflow
https://visjs.github.io/vis-network/docs/network/

Upvotes: 0

Views: 28

Answers (0)

Related Questions