简体   繁体   English

使用Cytoscape.js添加边缘标签

[英]Add an edge label with Cytoscape.js

如何使用Cytoscape.js在边缘添加标签?

Map the label style property to a data field: label样式属性映射到数据字段:

eg in the stylesheet on init 例如在init上的样式表中

...

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

...

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

Older versions use content: in place of label: . 旧版本使用content:代替label: Newer versions of 2.x allow label and also content for backwards compatibility. 较新版本的2.x允许labelcontent以实现向后兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM