Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Svg Cytoscape.js如何将节点塑造成圆形矩形?_Svg_Shape_Cytoscape.js - Fatal编程技术网

Svg Cytoscape.js如何将节点塑造成圆形矩形?

Svg Cytoscape.js如何将节点塑造成圆形矩形?,svg,shape,cytoscape.js,Svg,Shape,Cytoscape.js,当尝试将cytoscape.js中的节点形状设置为roundrectangle时,我只得到一个普通矩形,没有圆角。我甚至在cytoscape.js的“实时代码示例”中尝试了它。代码如下: $(loadCy = function(){ options = { showOverlay: false, minZoom: 0.5, maxZoom: 2, style: cytoscape.stylesheet() .selector('node')

当尝试将cytoscape.js中的节点形状设置为roundrectangle时,我只得到一个普通矩形,没有圆角。我甚至在cytoscape.js的“实时代码示例”中尝试了它。代码如下:

$(loadCy = function(){

  options = {
    showOverlay: false,
    minZoom: 0.5,
    maxZoom: 2,

    style: cytoscape.stylesheet()
      .selector('node')
        .css({
          'content': 'data(name)',
          'font-family': 'helvetica',
          'font-size': 14,
          'text-outline-width': 3,
          'text-outline-color': '#888',
          'text-valign': 'center',
          'color': '#fff',
          'width': 'mapData(weight, 30, 80, 20, 50)',
          'height': 'mapData(height, 0, 200, 10, 45)',
          'border-color': '#fff',
          'shape':'roundrectangle'
        })
      .selector(':selected')
        .css({
          'background-color': '#000',
          'line-color': '#000',
          'target-arrow-color': '#000',
          'text-outline-color': '#000'
        })
      .selector('edge')
        .css({
          'width': 2,
          'target-arrow-shape': 'triangle'
        })
    ,

    elements: {
      nodes: [
        {
          data: { id: 'j', name: 'Jerry', weight: 65, height: 174 }
        },

        {
          data: { id: 'e', name: 'Elaine', weight: 48, height: 160 }
        },

        {
          data: { id: 'k', name: 'Kramer', weight: 75, height: 185 }
        },

        {
          data: { id: 'g', name: 'George', weight: 70, height: 150 }
        }
      ],

      edges: [
        { data: { source: 'j', target: 'e' } },
        { data: { source: 'j', target: 'k' } },
        { data: { source: 'j', target: 'g' } },

        { data: { source: 'e', target: 'j' } },
        { data: { source: 'e', target: 'k' } },

        { data: { source: 'k', target: 'j' } },
        { data: { source: 'k', target: 'e' } },
        { data: { source: 'k', target: 'g' } },

        { data: { source: 'g', target: 'j' } }
      ],
    },

    ready: function(){
      cy = this;
    }
  };

  $('#cy').cytoscape(options);

});

有什么帮助吗?

虽然有文档记录,但显然渲染器中缺少一些东西。正在调查中-Max

我相信自2.0.2版以来,此问题已得到解决