使用Cytoscape.js添加边缘标签 [英] Add an edge label with Cytoscape.js

查看:1294
本文介绍了使用Cytoscape.js添加边缘标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

标签样式属性到数据字段:



例如在init的样式表中

  ... 

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

...

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



旧版本使用 content:代替 label:。为了向后兼容,2.x的新版本允许 label content 。


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

解决方案

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.

这篇关于使用Cytoscape.js添加边缘标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆