javascripthtmlvis.jsvis.js-network

vis.js hierarchical network graph layout


I've found this strange layout in hierarchical network graph by using vis.js. As you can see, the edges are messed up. Any suggestion would be nice. Thanks. Or is it possible to change the sort function by the parent node position?

Figure 1: The current network

enter image description here

Figure 2: The expected network

enter image description here


Solution

  • This is a known bug introduced between 4.19.1 and 4.20 according to this question (there's also an issue on github).

    An easy way is to downgrade vis.js to 4.19.1.

    The hard way is to analyse the changes between the versions, contribute to the issue by reporting what you have found, forking the repo and making some rollback about those changes (and maybe making a pull request).