Node clustering with Cytoscape.js

2019-09-12 08:45发布

问题:

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.

回答1:

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.