2

I am using visNetwork package for creating small networks. Below script creates a simple network graph as shown in the visualization. My issue is that every time I execute the script, the positioning of the nodes keeps on changing. My requirement is that every time I run the script, I want the visualization to appear fixed and in order like the visual below, currently I had to manually move the edges to show what is needed. Also, I will take more nodes into the network, please help me with a scalable approach. Please help and thanks.

library(visNetwork)
visNetwork(dot = 'dinetwork {1 -> 1 -> 2; 2 -> 4; 2 -- 3; 2 -> 1 }', width = 
"100%")

Snapshot Visual

Adam Shaw
  • 519
  • 9
  • 24
  • This is not a graphviz issue, too many layers in between. I briefly checked and could imagine that studying the documentation would help I found some hints in the `visNodes` item (page 63). – vaettchen Jan 05 '18 at 05:06
  • @vaettchen, Thank you so much for replying Sir, I being new to this package, don't have much information regarding the difference in these packages, kindly suggest a possible approach that I can follow to get this done, some reference I found on the community is this, Please help. https://stackoverflow.com/questions/47630378/how-to-specify-nodes-positions-in-visnetwork-package-in-r – Adam Shaw Jan 05 '18 at 05:17

1 Answers1

0

I believe you need to use randomSeed in visLayout(). Decription here:

https://datastorm-open.github.io/visNetwork/layout.html

Example of syntax here:

https://datastorm-open.github.io/visNetwork/options.html

jtr13
  • 1,225
  • 11
  • 25