In vis javascript library, how do I get a node from its node id?

So, I create such nodes ...

var nodes = new vis.DataSet([ {id: 1, label: 'Peter'}, {id: 2, label: 'John'}, {id: 3, label: 'Sally'}, ]); 

and then in the event handler after clicking on node I get the node identifier that I clicked. How do I get a node object from its identifier?

+7
javascript
source share
1 answer

I really found documentation here; http://visjs.org/docs/data/dataset.html

 node = nodes.get(nodeId); 
+11
source share

All Articles