【发布时间】:2018-04-23 12:36:55
【问题描述】:
在 Cytoscape 中,我想构建一个具有同心布局的图形,但不是一个完整的圆,更像是一个半圆或四分之一圆,一个元素位于图形的中心,所有其他元素位于外侧。
有没有办法从http://js.cytoscape.org 替换现有的同心布局? 问题是,我显然不能使用 endAngle,而且我在网上也找不到任何关于它的信息。我搜索这样的东西:
layout = cy.elements().layout({
name: 'concentric',
fit: true,
padding: 30,
startAngle: 3/2 * Math.PI, // where nodes start in radians
endAngle: 5/2 * Math.PI,// this doesn't work
sweep: undefined,
clockwise: true,
equidistant: false,
minNodeSpacing: 10,
boundingBox: undefined,
avoidOverlap: true,
nodeDimensionsIncludeLabels: false,
height: undefined,
width: undefined,
spacingFactor: undefined,
concentric: function (node) { return node.degree();},
levelWidth: function (nodes) { return nodes.maxDegree() / 4;},
animate: false,
animationDuration: 500,
animationEasing: undefined,
animateFilter: function (node, i) { return true; },
ready: undefined,
stop: undefined,
transform: function (node, position) { return position; }
});
【问题讨论】:
标签: javascript html layout cytoscape.js