multi labels cytoscape js

时间秒杀一切 提交于 2019-12-13 02:33:16

问题


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.

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.

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

Tks!!


回答1:


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' } }
]


来源:https://stackoverflow.com/questions/33831483/multi-labels-cytoscape-js

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