多标签cytoscape js [英] multi labels cytoscape js

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

问题描述

我想使用cytoscape.js在每个节点上使用两个标签.节点的内部和外部,例如此链接图像 http://gcuculi.com/imagens/labels-constelation.png .

I'd like use two labels per node using cytoscape.js. One inside and another outside of the node, like this link image http://gcuculi.com/imagens/labels-constelation.png.

我将qtip用作外部标签,但是我需要打印(ctrl + p)此页面,并且qtip div位置是绝对的(来自文档),因此它们不会出现在正确的位置.

I used qtip for external labels, but I need to print (ctrl+p) this page and qtip div positions are absolute (from document), so they don't appear in right place.

有一种方法可以修改两个标签的cytoscape.js或如何防止qtip从 这种行为吗?

There is a way to modify cytoscape.js for two labels or how I prevent qtip from this behavior?

谢谢!

推荐答案

获取多个不同标签的一种方法是使用复合节点,即通过父子关系包含其他节点的节点.

One way to get multiple distinct labels is to use compound nodes, i.e. nodes that contain other nodes via a parent-child relationship.

如果为每个节点提供自己的父节点,则可以为子节点和父节点提供不同的标签,并且它们始终会在一起出现.

If you gave every node its own parent node, you could provide different labels for the child and parent nodes and they would always appear together.

具有这种表示形式的节点定义可能看起来像这样:

Node definitions with this representation might look like this:

[
  { data: { id: 'childId', parent: 'parentId' } },
  { data: { id: 'parentId' } }
]

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

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