javascript - Infovis JIT: add click listener to edge -


i'm trying capture click event on edge of sunburst graph. i've captured click events on nodes. i'm trying:

//..sunburst example code events: {     enable: true,     enableforedges: true,     type: 'native',     onclick: function(node, eventinfo, e){       if (!node) return;       if(node.nodefrom){         console.log("target edge");       }else{         console.log("target node");       }     }   

but captures node clicks. what's wrong? thank in advance.

the problem 'contains' method, edge type 'hyperline'(which sunburst uses) not yet implemented in infovis library.

contains method used library know if position specified in parameters within edge or not. can not events without contains method. so, can either implement own contains method type hyperline in jit.js or can change edge type 'line' 'hyperline' in init method.

edge: {   overridable: true,   type: 'line',  //'hyperline'   linewidth: 2,   color: '#777' }  

you able capture events edge type 'line' because contains method defined 'line' type.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -