How do I get the name of a clicked node in cytoscape.js ?

118 views
Skip to first unread message

prabh...@gmail.com

unread,
Feb 11, 2015, 9:22:50 PM2/11/15
to cytoscapew...@googlegroups.com
How do I get the name of a clicked node in cytoscape.js ?

When adding a new edge How Do I specify the source( clicked node Currently) and destination node ?

In all the example what I see the adding nodes, deleting nodes, adding edges are related to static content (hardcoded), I want the code to dynamically create a node, delete a node, create an edge.......as belo
================================
vis.addContextMenuItem("Add Edge", "nodes", 
        function (evt) {
           var data = { id: "n5",
             source: "1",
             target: "n4",
             directed: false };
 
var edge = vis.addEdge(data, true);
        }
    );
================================
Please solve my doubts.
Reply all
Reply to author
Forward
0 new messages