Commit fb401b9c authored by Fintan Mc Gee's avatar Fintan Mc Gee

reworked highlighing to be more consistent

parent 65278dce
......@@ -131,6 +131,10 @@
stroke-width: 2.5px;
}
.highlightIntraNeighbour{
stroke: #fc9272;
stroke-width: 2.5px;
}
.highlightClickInterNeighbour{
stroke: #3182bd;
......
......@@ -305,23 +305,7 @@ angular.module('blizaarModule.controllers')
$scope.initializeDHListView();
// $scope.expandNode = function(selectedNode) {
// console.log(" in Digital Humanities Expand Node");
// // over wrinting the Application level expoand node as we want to reassign nodes to layers
// dataService.expandNode(masterDataConstraintsService.getNodeTypes(), masterDataConstraintsService.getRelationshipTypes(), selectedNode,false,masterDataConstraintsService.getRelationshipAttributeConstraints(),edgeSetLabel).then(function (data) {
// // dataService.expandNode(filteringService.getFilterNodeList(), filteringService.getFilterEdgeList(), selectedNode,true).then(function () {
// // $scope.model.expandNodeMessage = data;
// graphLayeringService.layerDHGraph(false); //true implies do layout
//
// //$scope.createDefaultLayers();
// // tooltipService.showTextAsTooltip(data, $scope.model.mouseEvent);
// // Send the message once the dom is ready
// $scope.createGraphSummaryData();
// angular.element(document).ready(function () {
// $rootScope.$broadcast ('refreshGraph');
// });
// });
// };
/**************************************
* filterName()
* Functionality: Provides a new docuement order using the BLZ_order field of nodes
......@@ -489,7 +473,7 @@ angular.module('blizaarModule.controllers')
if(basicTypes.indexOf(layer.name) < 0) {
nonBasicLayers.push(layer.name);
}
})
});
if(layerName ==="people" || layerName ==="organizations" || layerName ==="locations" ) {
// $scope.orderDocumentsByFrequency(node);
......@@ -510,6 +494,88 @@ angular.module('blizaarModule.controllers')
}
}
$scope.getExpandedListHighlightData = function (highlightData,expandLayerName,targetLayerNames) {
// It expands the highlight List by adding all neighbout of
// highlighted nodes in exapnd Layer name that are in the laaers specified by target Layer Name
var layer = multiLayerGraphService.getLayerByName(expandLayerName);
var masterLayer = multiLayerGraphService.getGraph();
var secondOrderNeighbours = []
if(highlightData.neighbourLayers.hasOwnProperty(expandLayerName)) {
highlightData.neighbourLayers[expandLayerName].forEach(function (firtsorderNeighbour) {
var neighbourUids = masterLayer.getNeighboursByUid(firtsorderNeighbour);
secondOrderNeighbours = secondOrderNeighbours.concat(neighbourUids);
});
targetLayerNames.forEach(function (layerName) {
if (!highlightData.secondOrderNeighbourLayers.hasOwnProperty(layerName)) {
highlightData.secondOrderNeighbourLayers[layerName] = []
}
secondOrderNeighbours.forEach(function (uid) {
if (masterLayer.getLayerByName(layerName).nodeExists(uid)) {
highlightData.secondOrderNeighbourLayers[layerName].push(uid);
}
})
});
}
}
$scope.getListClickHighlightData = function(highlightData) {
if ($scope.getGlobalSelectedAspect() === "EntityType") {
$scope.getExpandedListHighlightData(highlightData, ["documents"], ["people", "organizations", "locations"]);
}
return highlightData
}
$scope.getListHighlightData = function (node, layername, otherLayernames) {
// data structuter:
//distand layers are anythign beyond neigbours
var layer = multiLayerGraphService.getLayerByName(layername);
var masterLayer = multiLayerGraphService.getGraph();
var highlightData = {
currentNode:[{layerName:layername, uid: node.uid}],
currentLayer: {layerName:layername, uids: []},
neighbourLayers: {},
secondOrderNeighbourLayers: {}
};
highlightData.currentLayer.uids = layer.getNeighboursByUid(node.uid);
// edgeList.forEach(function (a) {
// graphBounds.selectAll("#" + edgeIdPrefix + a.id).attr("class", "highlightedLink")
// });
var neighbourUids =masterLayer.getNeighboursByUid(node.uid);
// neighbours in other Layers
otherLayernames.forEach(function(otherLayerName) {
var otherLayer = multiLayerGraphService.getLayerByName(otherLayerName)
var otherLayerNeighbours
if(layer.name !== otherLayer.name) {
if (otherLayer.nodeExists(node.uid)) {
// heighlisgh the current node if it appears in other layers
highlightData.currentNode.push({layerName:otherLayerName, uid: node.uid});
}
highlightData.neighbourLayers[otherLayer.name] = [];
neighbourUids.forEach(function(nUid) {
if (otherLayer.nodeExists(nUid)) {
highlightData.neighbourLayers[otherLayer.name].push(nUid)
}
});
}
});
return highlightData;
}
$scope.controllerHandleDoubleClick = function(node, layerName){
$scope.model.inputName = node.name;
......@@ -551,6 +617,8 @@ angular.module('blizaarModule.controllers')
}
$scope.getShowMasterLayer = function(){
return $scope.model.showMasterLayer;
}
......
......@@ -713,7 +713,7 @@ angular.module('blizaarModule.controllers', [])
// get the set of node Neighbours in Layer
var highlightNodeIds = multiLayerGraphService.getGraph().getLayerByName(layerName).getNeighboursByUid(nodeUid);
highlightNodeIds.push(nodeUid)
highlightNodeIds.push(nodeUid);
$scope.highlightNodeIds = angular.copy(highlightNodeIds);
$scope.$broadcast("highlightNodeSet",{ nodeUidArray: highlightNodeIds});
......
This diff is collapsed.
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