【发布时间】:2019-10-02 19:29:06
【问题描述】:
我有一个 cytoscape.js 模型,其中节点之间的边代表不同的关系。
我希望有可能在边缘中间显示圆形或按钮之类的东西,用户可以单击并弹出来更改关系类型。
到目前为止,我在基本包中看到没有显示圆形的选项。
我正在使用 dagre 布局,这是我当前的边缘配置:
{
selector: "edge",
style: {
width: 1,
"font-size": "20px",
//opacity: "0.5",
label: "data(type)",
color: function(ele) {
return getEdgeColor(ele.data("type"));
},
"line-color": function(ele) {
return getEdgeColor(ele.data("type"));
},
"target-arrow-color": function(ele) {
return getEdgeColor(ele.data("type"));
},
"curve-style": "straight",
"target-arrow-shape": "triangle"
}
},
您能推荐我任何简单的解决方案吗?
【问题讨论】:
-
请提供您迄今为止尝试过的任何代码,并指出您遇到困难或需要帮助的地方。
-
嗨 RyanNerd,我添加了详细信息。但是,我的问题很简单。我认为我想要的不是标准包中提供的,所以要么有我可以使用的其他人的扩展,要么希望以某种方式标准 cytoscape 包允许它,我只是错过了如何做到这一点。
标签: cytoscape.js