MCPcopy
hub / github.com/mrpandey/d3graphTheory / removeNode

Function removeNode

ch/graphic-sequence/app.js:119–134  ·  view source on GitHub ↗
(d, i)

Source from the content-addressed store, hash-verified

117
118//d is data, i is index according to selection
119function 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
136function removeEdge(d, i) {
137 d.source.degree--;

Callers

nothing calls this directly

Calls 2

restartFunction · 0.70
showGraphLatexFunction · 0.70

Tested by

no test coverage detected