Vis.js: How to get a cluster node from the network

2.1k Views Asked by At

Is there a way to get the Node data for a cluster by its id?

According to the documentation:

Clustered Nodes when created are not contained in the original data.nodes passed on network creation

So it's not possible to get it from the vis dataset like we do with normal nodes.

There is the method network.clustering.updateClusteredNode() to update a cluster node, but none to get the cluster node.

1

There are 1 best solutions below

1
TERMIN On BEST ANSWER

There is this way (quite simple). if the node id is 7 for example. you can get its data like this.

network.body.nodes[7]

Hope it helps you.