Cytoscape 同心布局开始和结束角度

Cytoscape Concentric layout start and end angles

在 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; } 
});

文档中没有提到 endAngle。仔细阅读文档并仅使用支持的字段。

来自文档:

startAngle: 3 / 2 * Math.PI, // where nodes start in radians
sweep: undefined, // how many radians should be between the first and last node (defaults to full circle)

所以您可以指定开始和增量,而不是像您尝试过的那样指定开始和结束。

例如cy.layout({ name: 'concentric', startAngle: 0, sweep: Math.PI/2 }).run();