VivaGraphJS
VivaGraphJS copied to clipboard
layout.pinNode does not seem to work inside a webgl event
trafficstars
I am trying to pin a node after dragging ends and unpin the node on double click. However, using layout.pinNode does not seem to work from inside the webgl input events.
You can use a hack using setTimeout.
var events = Viva.Graph.webglInputEvents(graphics, graph);
events.click(function (node) {
setTimeout(function () {
layout.pinNode(node, true);
}, 50);
});