Commit 9a192432 authored by Fintan Mc Gee's avatar Fintan Mc Gee

added inita type sorrt to tmeporal lit view and fixed issue with drawing ourside of svg

parent 626eaf90
......@@ -463,7 +463,7 @@ angular.module('blizaarModule.controllers')
}
$scope.controllerHandleClick = function(node, layerName){
var currentAspect = $scope.getGlobalSelectedAspect();
var basicTypes = ["documents", "people", "organizations", "locations"];
var nonBasicLayers = [];
var allLayers = [];
......@@ -475,20 +475,25 @@ angular.module('blizaarModule.controllers')
}
});
if(layerName ==="people" || layerName ==="organizations" || layerName ==="locations" ) {
// $scope.orderDocumentsByFrequency(node);
$scope.orderEntitiesByFrequency(node, ["documents"] );
$scope.orderEntitiesLayerDistance (node,layerName);
$scope.orderEntitiesByMultipleEntityFrequency(node,layerName) ;
$scope.orderEntitiesMasterDistance(node,nonBasicLayers );
} else if(layerName === "documents") {
$scope.orderEntitiesByFrequency(node, ["people", "organizations", "locations"] );
if(currentAspect === "EntityType") {
if (layerName === "people" || layerName === "organizations" || layerName === "locations") {
// $scope.orderDocumentsByFrequency(node);
$scope.orderEntitiesByFrequency(node, ["documents"]);
$scope.orderEntitiesLayerDistance(node, layerName);
$scope.orderEntitiesByMultipleEntityFrequency(node, layerName);
$scope.orderEntitiesMasterDistance(node, nonBasicLayers);
} else if (layerName === "documents") {
$scope.orderEntitiesByFrequency(node, ["people", "organizations", "locations"]);
$scope.orderEntitiesMasterDistance(node, ["documents"])
}
}
else {
//
//TODO Revisit to use a node type specific ordering
$scope.orderEntitiesMasterDistance(node,nonBasicLayers );
var layerList = multiLayerGraphService.getGraph().getAspectLayerNames(currentAspect);
$scope.orderEntitiesMasterDistance(node,layerList );
}
......@@ -564,6 +569,7 @@ angular.module('blizaarModule.controllers')
if (otherLayer.nodeExists(node.uid)) {
// heighlisgh the current node if it appears in other layers
highlightData.currentNode.push({layerName:otherLayerName, uid: node.uid});
highlightData.currentNode.push({layerName:otherLayerName, uid: node.uid});
}
highlightData.neighbourLayers[otherLayer.name] = [];
neighbourUids.forEach(function(nUid) {
......@@ -647,7 +653,8 @@ angular.module('blizaarModule.controllers')
$scope.controllerDrawFinished = function() {
// this function excutes whenever the dunderlying directives draw function completes
if ($scope.getGlobalSelectedAspect() === "temporal") {
multiLayerGraphService.getGraph().orderNodesGlobally("BLZ_label", false);
multiLayerGraphService.getGraph().orderNodes("BLZ_label", false);
multiLayerGraphService.getGraph().orderNodesGlobally("type", false);
$scope.triggerAnimatePositionRefresh("All_Layers");
}
......
......@@ -1039,14 +1039,14 @@ angular.module('blizaarModule.directives')
});
// if the nodes are now drawn off the SVG resize it
if( max_list_view_y > svgHeight){ svg.attr("height",max_list_view_y + (drawnNodeHeight * 3) + 100) };
if( max_list_view_y > svgHeight){ svg.attr("height",max_list_view_y + (drawnNodeHeight * 10) + 200) };
var layerGroup = svg.select("#layer_" +layerName);
var layerHeight = layerGroup.select("rect").attr("height")
if( layerHeight < max_list_view_y ) {
var layerBorder = layerGroup.select("rect");
var yPos = parseTranslation(layerGroup.attr("transform"))[1];
layerBorder.attr("height", max_list_view_y + (drawnNodeHeight * 3));
layerBorder.attr("height", max_list_view_y + (drawnNodeHeight * 10));
}
var animationNodes = layerGroup.selectAll(".nodeList").data(layer.nodes);
animationNodes.exit().remove();//remove unneeded elements
......
......@@ -3446,11 +3446,19 @@ var MultiLayerGraph = function (nodes, links, layerName) {
}
g.getAspectLayerNames = function(aspectName) {
var namesArray = [],
layers= g.GetAspectLayers(aspectName);
layers.forEach(function(layer) {
namesArray.push(layer.name);
});
var namesArray= [];
if(!g.aspects.hasOwnProperty(aspectName)) {
console.log("Warning in GetAspectLayers: unrecognised layer name" + aspectName);
} else {
g.aspects[aspectName].forEach(function(aspectLayer) {
if(typeof(aspectLayer) === "string") {
namesArray.push(aspectLayer);
} else {
namesArray.push(aspectLayer.name);
}
})
}
return namesArray;
}
......
......@@ -65,7 +65,7 @@ var MultiLayerGraph = function (nodes, links, layerName) {
g.linkTypeList = [];
g.interLayerEdgeMap = null;
g.aspectCombinations = []; //aspect combinatinas are a sungle layer difded by other layers.
g.aspectCombinations = []; //aspect combinatinas are a single layer divded by other layers ( ane array of new layers, every new combination overwrites the old one.
// utility functions
......@@ -313,6 +313,29 @@ var MultiLayerGraph = function (nodes, links, layerName) {
return g.adjacencyList[inputNode.id];
};
/**************************************
* getNeighboursByUid
* Functionality: returns refs to all nodes adjacent to input
* builds adjacencyList if it does not exist
* Created By : Fintan McGee (LIST)
* Date: 11/07/2017
********************************/
g.getNeighboursByUid = function (inputNodeUid) {
if(!g.adjacencyList ) {
g.buildAdjacencyList();
}
if(!g.adjacencyList.hasOwnProperty(inputNodeUid)) {
console.log("ERROR getNeighbours could not find node in adjacently List " + JSON.stringify(inputNode));
return [];
}
var nUIds = [];
g.adjacencyList[inputNodeUid].forEach(function(n) {
nUIds.push(n.uid)
});
return nUIds;
};
/**************************************
* getNeighboursInTargetLayer
* Functionality: returns all neighbours of the specified node Uid in the target other Layer
......@@ -3445,11 +3468,19 @@ var MultiLayerGraph = function (nodes, links, layerName) {
}
g.getAspectLayerNames = function(aspectName) {
var namesArray = [],
layers= g.GetAspectLayers(aspectName);
layers.forEach(function(layer) {
namesArray.push(layer.name);
});
var namesArray= [];
if(!g.aspects.hasOwnProperty(aspectName)) {
console.log("Warning in GetAspectLayers: unrecognised layer name" + aspectName);
} else {
g.aspects[aspectName].forEach(function(aspectLayer) {
if(typeof(aspectLayer) === "string") {
namesArray.push(aspectLayer);
} else {
namesArray.push(aspectLayer.name);
}
})
}
return namesArray;
}
......
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