使用Cytoscape.js进行节点集群 [英] Node clustering with Cytoscape.js
问题描述
有人知道是否有可能以vis.js支持cytoscape.js的方式进行聚类?以下是一些示例:
Does anyone know if it is possible to do clustering in the way that vis.js supports it with cytoscape.js? Here are some examples:
http://visjs.org/examples/network/other/clusteringByZoom.html
http://visjs.org/examples/network/other/clustering.html
基本思想是节点可以代表一组子节点,并且缩放或双击该节点将爆炸它以显示所有子节点。
The basic idea is that a node can represent a cluster of child nodes and zooming or double clicking on the node will "explode" it to show all the children.
推荐答案
使用 cy.on('zoom')
和 cy.add()可以达到相同的效果
和 cy.remove()
。此类功能不会包含在lib库中,因为它破坏了图的语义。
You can achieve the same effect using cy.on('zoom')
with cy.add()
and cy.remove()
. That sort of feature would not be included in the lib proper, because it breaks graph semantics.
这篇关于使用Cytoscape.js进行节点集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!