I have a requirement to hide or unhide some nodes and edges depending on 
some data. I can achieve it by traversing through visjs's data but that 
will trigger stabilization everytime one hides or unhides (this overwrite 
existing data). 

I found this example <http://visjs.org/examples/network/data/datasets.html> 
which 
*adds*, *updates *and *removes *a node by directly changing *nodes* value 
by using add, update & remove 
functions. This dynamically does these operations without stabilizing, but 
when I try the same thing in angularjs it says 
org_nodes.update is not a function

Snippet taken from source of this example 
<http://visjs.org/examples/network/data/datasets.html>


function addNode() {
        var newId = (Math.random() * 1e7).toString(32);
        nodes.add({id:newId, label:"I'm new!"});
        nodeIds.push(newId);
    }


    function changeNode1() {
        var newColor = '#' + Math.floor((Math.random() * 255 * 255 * 255)).
toString(16);
        nodes.update([{id:1, color:{background:newColor}}]);
    }


    function removeRandomNode() {
        var randomNodeId = nodeIds[Math.floor(Math.random() * nodeIds.length
)];
        nodes.remove({id:randomNodeId});


        var index = nodeIds.indexOf(randomNodeId);
        nodeIds.splice(index,1);
    }

 Please help, I am providing a plunker link here 
<http://plnkr.co/edit/oBjYUURG39swCVLMV4mI?p=preview>, what is it that I am 
missing here? Using angular-visjs <https://github.com/visjs/angular-visjs>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to