在cytoscape.js中的节点之间填充

时间:2015-01-21 05:29:30

标签: cytoscape.js

使用层次结构中的cytoscape.js创建图表。我在节点的右侧位置的每个节点附近放置一些图表和标签,但它在层次结构中与较近的节点重叠。有没有办法在节点之间腾出空间?

enter image description here

2 个答案:

答案 0 :(得分:1)

您可以使用layout选项。如果这还不够,请file a feature request如果您想申请新功能或选项。

答案 1 :(得分:1)

nodeSep选项中使用layout属性 例如:

var cy = window.cy = cytoscape({
        container: document.getElementById('cy'),

        layout: {
          stop: function () {
            cy.automove({
              nodesMatching: cy.$(':parent *'),
              reposition: 'drag',
              dragWith: cy.$(':parent *')
            });
          },
          name: 'cose-bilkent',
          animate: 'end',
          nodeSep: 20, // >>>>>>YOUR TARGET PROPERTY<<<<<<<
          animationEasing: 'ease-out',
          animationDuration: 2000
        }});