cytoscape-cose-bilkent
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "cytoscape-cose-bilkent", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "The CoSE layout for Cytoscape.js by Bilkent", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -89,3 +89,4 @@ var FDLayout = require('./FDLayout'); | ||
CoSELayout.prototype.classicLayout = function () { | ||
this.calculateNodesToApplyGravitationTo(); | ||
this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(); | ||
this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity); | ||
this.calcNoOfChildrenForAllNodes(); | ||
@@ -111,2 +112,8 @@ this.graphManager.calcLowestCommonAncestors(); | ||
this.reduceTrees(); | ||
// Update nodes that gravity will be applied | ||
this.graphManager.resetAllNodesToApplyGravitation(); | ||
var allNodes = new Set(this.getAllNodes()); | ||
var intersection = this.nodesWithGravity.filter(x => allNodes.has(x)); | ||
this.graphManager.setAllNodesToApplyGravitation(intersection); | ||
this.positionNodesRandomly(); | ||
@@ -156,3 +163,9 @@ } | ||
this.updateGrid(); | ||
this.growTree(this.prunedNodesAll, this.isFirstGrowth); | ||
this.growTree(this.prunedNodesAll); | ||
// Update nodes that gravity will be applied | ||
this.graphManager.resetAllNodesToApplyGravitation(); | ||
var allNodes = new Set(this.getAllNodes()); | ||
var intersection = this.nodesWithGravity.filter(x => allNodes.has(x)); | ||
this.graphManager.setAllNodesToApplyGravitation(intersection); | ||
this.graphManager.updateBounds(); | ||
@@ -250,3 +263,3 @@ this.updateGrid(); | ||
this.graphManager.setAllNodesToApplyGravitation(nodeList); | ||
return nodeList; | ||
}; | ||
@@ -253,0 +266,0 @@ |
@@ -183,10 +183,7 @@ var Layout = require('./Layout'); | ||
var node; | ||
var allNodes = new Set(this.getAllNodes()); | ||
var lNodes = this.getAllNodesToApplyGravitation(); | ||
var intersection = lNodes.filter(x => allNodes.has(x)); | ||
for (var i = 0; i < intersection.length; i++) | ||
for (var i = 0; i < lNodes.length; i++) | ||
{ | ||
node = intersection[i]; | ||
node = lNodes[i]; | ||
this.calcGravitationalForce(node); | ||
@@ -567,3 +564,3 @@ } | ||
// Grow tree one step | ||
FDLayout.prototype.growTree = function(prunedNodesAll, isFirstGrowth) | ||
FDLayout.prototype.growTree = function(prunedNodesAll) | ||
{ | ||
@@ -570,0 +567,0 @@ var lengthOfPrunedNodesInStep = prunedNodesAll.length; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
726342
10828