4

Is there a way to filter links and nodes in vis.js network?
I have set a DataSet for both nodes and edges like so:

function drawNetwork(container){
     var nodes = new vis.DataSet();
     populateNodes(nodes); // code ommited for bravity
     var edges = new vis.DataSet();
     populateEdges(edges); // code ommited for bravity

     var data = {
                nodes: nodes,
                edges: edges
            };

     // create the network
     var options = {...}
     var network = new vis.Network(container, data, options);
}

Thanks.

laaposto
  • 11,835
  • 15
  • 54
  • 71
user3711529
  • 171
  • 1
  • 5

1 Answers1

3

You should be able to filter the DataSet using the filtering functions described at http://visjs.org/docs/data/dataset.html#Data_Filtering

Once you get your filtered data, set that as the graph to be viewed.

Ankush Dharkar
  • 424
  • 1
  • 4
  • 17