jquery - Delete and add nodes with click on a node in d3.js -
how add or remove nodes , links onclick
event in code?
here (d3js) code fiddle.
how use: right click on node , click on delete remove nodes no link.
want remove 1 node , it's links click delete.
//right click menu items $('g.node').contextmenu('cntxtmenu', { itemstyle: { fontfamily : 'arial', fontsize: '13px' }, bindings: { 'open': function(t) { alert(t.__data__.name); }, 'email': function(t) { alert('trigger '+t.__data__.name+'\naction email'); }, 'save': function(t) { alert('trigger '+t.__data__.name+'\naction save'); }, 'delete': function(t) { $('g.node').remove(); //alert('trigger '+t.__data__.name+'\naction delete'); } } });
Comments
Post a Comment