Add an edge label with Cytoscape.js

帅比萌擦擦* 提交于 2019-11-29 05:36:33

问题


How can I add a label on an edge using Cytoscape.js?


回答1:


Map the label style property to a data field:

e.g. in the stylesheet on init

...

{
  selector: 'edge',
  style: {
    'label': 'data(label)' // maps to data.label
  }
} 

...

http://cytoscape.github.com/cytoscape.js/#style/properties

Older versions use content: in place of label:. Newer versions of 2.x allow label and also content for backwards compatibility.



来源:https://stackoverflow.com/questions/15172427/add-an-edge-label-with-cytoscape-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!