如何使用cola在cytoscape.js中设置边缘的长度?

问题描述 投票:0回答:1

我正在使用最新版本的cytoscape.js和cola.js。当我更改“ edgelength”时,什么也没有发生。

我该怎么做?

javascript graph-theory cytoscape.js
1个回答
0
投票

您可以在布局选项中指定edgeLengthedgeSymDiffLengthedgeJaccardLength之一。

来自the docs

// different methods of specifying edge length
// each can be a constant numerical value or a function like `function( edge ){ return 2; }`
edgeLength: undefined, // sets edge length directly in simulation
edgeSymDiffLength: undefined, // symmetric diff edge length in simulation
edgeJaccardLength: undefined, // jaccard edge length in simulation

由于这是一种力导向的布局,您可以设置多个约束,所以如果过度约束系统,可能无法获得所需的效果-这很容易做到。考虑到某些边缘长度的约束可能与其他边缘长度的约束相矛盾。

© www.soinside.com 2019 - 2024. All rights reserved.