RV.
RV.

Reputation: 2998

How to get all node Ids from VIS.js network

I want to retrieve ids of all the nodes of already rendered vis.js network. How can I do that?

// I want to do something similar to this.
nodeIdArray:String[]= this.network.getAllNodeIds()

Any pointer for this is appreciated.

Upvotes: 2

Views: 3087

Answers (1)

RV.
RV.

Reputation: 2998

Found the solution to this:

this.nodes = new DataSet(data.nodes)//Get the nodes
this.nodes.getIds() //This gives the string array of the node Id's

Upvotes: 4

Related Questions