angular2-servicesvis.jsvis.js-network

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.


Solution

  • 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