|
|
@ -304,7 +304,6 @@ class ClusterEngine { |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
_cluster(childNodesObj, childEdgesObj, options, refreshData = true) { |
|
|
|
console.log(childNodesObj) |
|
|
|
// kill condition: no children so cant cluster
|
|
|
|
if (Object.keys(childNodesObj).length === 0) {return;} |
|
|
|
|
|
|
@ -457,8 +456,8 @@ class ClusterEngine { |
|
|
|
*/ |
|
|
|
openCluster(clusterNodeId, options, refreshData = true) { |
|
|
|
// kill conditions
|
|
|
|
if (clusterNodeId === undefined) {throw new Error("No clusterNodeId supplied to openCluster.");} |
|
|
|
if (this.body.nodes[clusterNodeId] === undefined) {throw new Error("The clusterNodeId supplied to openCluster does not exist.");} |
|
|
|
if (clusterNodeId === undefined) {throw new Error("No clusterNodeId supplied to openCluster.");} |
|
|
|
if (this.body.nodes[clusterNodeId] === undefined) {throw new Error("The clusterNodeId supplied to openCluster does not exist.");} |
|
|
|
if (this.body.nodes[clusterNodeId].containedNodes === undefined) { |
|
|
|
console.log("The node:" + clusterNodeId + " is not a cluster."); |
|
|
|
return |
|
|
@ -468,7 +467,7 @@ class ClusterEngine { |
|
|
|
let containedEdges = clusterNode.containedEdges; |
|
|
|
|
|
|
|
// allow the user to position the nodes after release.
|
|
|
|
if (options.releaseFunction !== undefined) { |
|
|
|
if (options !== undefined && options.releaseFunction !== undefined && typeof options.releaseFunction === 'function') { |
|
|
|
let positions = {}; |
|
|
|
let clusterPosition = {x:clusterNode.x, y:clusterNode.y}; |
|
|
|
for (let nodeId in containedNodes) { |
|
|
|