Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connected nodes overlapping other edges or nodes

I'm using vis.js to display nodes, not all nodes are connected to each other, but they are overlapping as shown in the picture, is there a way with the option to avoid this, I went through the configure options but could not find.

enter image description here

like image 881
Noor Avatar asked Feb 16 '16 11:02

Noor


People also ask

What is vis network?

visNetwork is a R package for network visualization, using vis. js javascript library (https://visjs.org). All the remarks and bugs returns are welcome on github : https://github.com/datastorm-open/visNetwork.


2 Answers

I would recommend using manual configuration for physics and layout:

configure: {
  enabled: true,
  filter: 'physics, layout',
  showButton: true
}

and try to play with nodeDistance and nodeSpacing.

like image 132
Andrej Hucko Avatar answered Oct 28 '22 06:10

Andrej Hucko


I managed to get it working by using the configure option:

configure: {
        enabled: true,
        showButton: true
}

This shows you a modal to configure all the options until the graph looks nice.

In my case with hierarchical view, I had to disable physics and set the layout like this:

layout: {
  hierarchical: {
    enabled: true,
    nodeSpacing: 425,
    blockShifting: false,
    edgeMinimization: false,
    sortMethod: "directed"
  }
}
like image 33
Christian Vielma Avatar answered Oct 28 '22 06:10

Christian Vielma