visNetwork icon indicating copy to clipboard operation
visNetwork copied to clipboard

Physics layout for rectangular (non 1:1 aspect ratio) canvas

Open sneumann opened this issue 4 years ago • 7 comments

Hi, I'd like a visualisation of a medium-sized network (~100 nodes) with ~7 disconnected subcomponents, and have a standard visNetwork() with standard visPhysics() and standard visLayout(). The resulting network after a while settles into a square-ish shape, i.e. 1:1 aspect ratio.

For publication I want a wide layout, but setting visNetwork(width = xxx, height = yyy) just changes the canvas. I guess what I am looking for is to extend centralGravity to have different gravity in x and y dimensions. Maybe using non-euclidean distance (mahalanobis ?) for the force calculations.

Did I miss something obvious ? I am also happy to use visIgraphLayout() if there is a way to pass the desired aspect ratio.

Thanks in advance, yours, Steffen

sneumann avatar Jul 23 '19 08:07 sneumann