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

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -