Skip to content

Commit

Permalink
Small performance improvement #16
Browse files Browse the repository at this point in the history
Consider multiple edges between a node pair as one edge
  • Loading branch information
hasanbalci committed Oct 5, 2017
1 parent bdba224 commit ed8c0a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions cytoscape-cose-bilkent.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ _CoSELayout.prototype.run = function () {
var edge = edges[i];
var sourceNode = this.idToLNode[edge.data("source")];
var targetNode = this.idToLNode[edge.data("target")];
var e1 = gm.add(layout.newEdge(), sourceNode, targetNode);
e1.id = edge.id();
if(sourceNode.getEdgesBetween(targetNode).length == 0){
var e1 = gm.add(layout.newEdge(), sourceNode, targetNode);
e1.id = edge.id();
}
}

var getPositions = function(ele, i){
Expand Down

0 comments on commit ed8c0a4

Please sign in to comment.