Commit 1e74d714 authored by Fintan Mc Gee's avatar Fintan Mc Gee

addded fucntionality for resorting nodes in the lsit view foir bio use case...

addded fucntionality for resorting  nodes in the lsit view foir bio use case and made sure that two hop nodes dont overwrite 1 hop nodes when highlihted
parent 9692b714
......@@ -261,14 +261,7 @@ angular.module('blizaarModule.controllers')
//
});
//dataService.queryGraph(targetLabels, relationshipTypes, cleanName,null, true, null,neighbourhoodSize , true).then(function() {
//
// $scope.createGraphSummaryData();
// angular.element(document).ready(function () {
// $rootScope.$broadcast('refreshGraph');
//
// });
// });
});
}
};
......
......@@ -409,4 +409,74 @@ angular.module('blizaarModule.controllers')
}
});
$scope.orderEntitiesMasterDistance = function(node,layerNames) {
console.log("orderEntitiesMasterDistance called");
var ordering = multiLayerGraphService.getGraph().getNodeOrderBFS(node.uid);
var targetLayers = [];
layerNames.forEach(function(layerName) {
if(multiLayerGraphService.getGraph().getLayerByName(layerName) !== null) {
targetLayers.push(multiLayerGraphService.getGraph().getLayerByName(layerName));
}
});
targetLayers.forEach(function(targetLayer) {
var orderIDArrary = [];
targetLayer.nodes.forEach(function(n){
orderIDArrary.push(n.uid)
});
orderIDArrary.sort(function(a,b) {
return ordering[a] - ordering[b];
} );
orderIDArrary.forEach(function(IdN,index){
var nodeRef = targetLayer.node[IdN];
//console.log("Updating position of node " + nodeRef.name + " in layer " + targetLayer.name +" from " + nodeRef.BLZ_order + " to " + index );
targetLayer.node[IdN].BLZ_order = index;
});
$scope.$broadcast('animatePositionRefresh', {layerName: targetLayer.name});
});
// $scope.$broadcast('animatePositionRefresh', {layerName: layerName});
}
$scope.controllerHandleClick = function(node, layerName){
var allLayers = [];
// all other layers that are not in the basic types
multiLayerGraphService.getGraph().getLayers().forEach(function (layer) {
allLayers.push(layer.name);
});
$scope.orderEntitiesMasterDistance(node,allLayers );
}
$scope.controllerHandleDoubleClick = function(node, layerName){
$scope.model.inputName = node.name;
$scope.model.inputType = node.label;
var nameSearch = binarySearchTextArray($scope.model.inputName,$scope.model.availableNames);
var name , name_before, name_after;
var nameIndex = -1
if(nameSearch < 0) {
nameIndex = Math.abs(nameSearch +1);
name = $scope.model.availableNames[nameIndex];
if(name.indexOf(node.name > -1) ){
$scope.model.inputName = name;
$scope.loadEntityData();
}
} else {
$scope.loadEntityData();
}
}
}]);
\ No newline at end of file
......@@ -313,8 +313,15 @@ angular.module('blizaarModule.directives')
currentLayerIDs = getIntraLayerNeighbourIds(n);
neighbourLayerNodes = getInterLayerNeighbours(n, layer.name);
var neighbourLayerNodesLookup = {};
neighbourLayerNodes.forEach(function(neighbourNodeLayerPair) {
secondNeighbourLayerNodes = secondNeighbourLayerNodes.concat(getInterLayerNeighbours(neighbourNodeLayerPair.node,neighbourNodeLayerPair.layer));
neighbourLayerNodesLookup[neighbourNodeLayerPair.node.uid] = true;
});
neighbourLayerNodes.forEach(function(neighbourNodeLayerPair) {
if( !neighbourLayerNodesLookup.hasOwnProperty(neighbourNodeLayerPair.node.uid)) {
secondNeighbourLayerNodes = secondNeighbourLayerNodes.concat(getInterLayerNeighbours(neighbourNodeLayerPair.node, neighbourNodeLayerPair.layer));
}
});
......@@ -385,7 +392,7 @@ angular.module('blizaarModule.directives')
});
}
//tooltipService.showTooltipForNode(n);
tooltipService.showCustomTooltipForNode(n);
//tooltipService.showCustomTooltipForNode(n);
tooltipService.showCustomTooltipForNode(n);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment