简体   繁体   English

Cytoscape.js 孤立节点 position

[英]Cytoscape.js orphan nodes position

I am using Cytoscape.js to visualize networks.我正在使用Cytoscape.js来可视化网络。

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?我的假设是有一种方法可以手动设置两个图形之间的距离但是我该怎么做呢?

As far as I know, Cola does not have a component-packing algorithm.据我所知,Cola 没有组件打包算法。 That would conflict with its live-animated, n-body physics simulation.这将与其实时动画的 n 体物理模拟相冲突。 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.组件打包通常是强制导向布局的一个单独步骤,因此与实时 animation 结合使用时会产生抖动的结果。 You may have better luck with other force-directed layouts with different trade-offs, such as FCOSE.对于其他具有不同权衡的强制导向布局,例如 FCOSE,您可能会有更好的运气。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM