VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

layout.pinNode does not seem to work inside a webgl event

Open MarkHarper opened this issue 8 years ago • 1 comments
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.

MarkHarper avatar Jun 12 '17 22:06 MarkHarper

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);
});

mzachariadis avatar Feb 24 '18 00:02 mzachariadis