So I create the nodes like this...
var nodes = new vis.DataSet([
{id: 1, label: 'Peter'},
{id: 2, label: 'John'},
{id: 3, label: 'Sally'},
]);
then later on in an event handler after clicking on a node I get the id of the node i clicked. How do I get node object from its id?
I actually found the documentation here; https://visjs.github.io/vis-data/data/dataset.html#Getting_Data
node = nodes.get(nodeId);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With