INNER CODE UNIT · JavaScript
initDragCapabilities
Brbb/graphql-rover · js/utils.js:12
function initDragCapabilities(g,svg){
svg.selectAll("g.node rect")
.attr("id", function (d) {
return "node" + d;
});
svg.selectAll("g.edgePath path")
.attr("id", function (e) {
return e.v + "-" + e.w;
})
g.nodes().forEach(function (v) {
var node = g.node(v);
node.customId = "node" + v;
})
g.edges().forEach(function (e) {
var edge = g.edge(e.v, e.w);
edge.customId = e.v + "-" + e.w
});