(d, i)
| 117 | |
| 118 | //d is data, i is index according to selection |
| 119 | function removeNode(d, i) { |
| 120 | //to make ctrl-drag works for mac/osx users |
| 121 | if (d3.event.ctrlKey) return; |
| 122 | var linksToRemove = links.filter(function(l) { |
| 123 | return l.source === d || l.target === d; |
| 124 | }); |
| 125 | linksToRemove.map(function(l) { |
| 126 | l.source.degree--; |
| 127 | l.target.degree--; |
| 128 | links.splice(links.indexOf(l), 1); |
| 129 | }); |
| 130 | nodes.splice(nodes.indexOf(d), 1); |
| 131 | d3.event.preventDefault(); |
| 132 | restart(); |
| 133 | showGraphLatex(); |
| 134 | } |
| 135 | |
| 136 | function removeEdge(d, i) { |
| 137 | d.source.degree--; |
nothing calls this directly
no test coverage detected