Ebikeneser
Ebikeneser

Reputation: 2374

Cytoscape.js orphan nodes position

I am using Cytoscape.js to visualize networks.

I am currently using the cola layout which works a treat when one network (with zero orphan nodes) is generated.

However if I add an additional network on screen that is unaffiliated to the first with zero connections, on visualization the two separate networks a re positioned miles apart.

I have to manually grab one of the networks as a cluster and drag it for ages until it is closer to the other network.

My assumption is there is a way to set the distance between two graphs manually however how can I do this?

Upvotes: 0

Views: 215

Answers (1)

maxkfranz
maxkfranz

Reputation: 12250

As far as I know, Cola does not have a component-packing algorithm. That would conflict with its live-animated, n-body physics simulation. Components are naturally repelled from one another, unless there is a strong gravity force to the screen's centre.

Component packing is typically a separate step for force-directed layouts, so it would give a jittery result when coupled with live animation. You may have better luck with other force-directed layouts with different trade-offs, such as FCOSE.

Upvotes: 2

Related Questions