Commit 134f7d45 authored by Fintan Mc Gee's avatar Fintan Mc Gee

added functionality to make attibute names configurable on the server

parent e39a8c68
......@@ -724,6 +724,10 @@ var getIcons_cb = function(req,res){
var getRightNodes_cb = function(req,res){
graphDB.setRightNodes(req.body.graphSource,res);
}
var getBarChartAttributes_cb = function (req,res) {
graphDB.getBarChartAttributes( req.body.graphSource,res);
}
/* PATH DEFINITIONS TO ROUTE ALL INBOUND CAlLS TO SPECIFIC FUNCTIONS
* User Login Functionality *
*/
......@@ -796,6 +800,7 @@ simple_serve.post('/completeGraphEdgeSet',blizaarSystem.ensureAuthenticated, com
simple_serve.post('/getLabelsRadialMenu', blizaarSystem.ensureAuthenticated, getLabelsRadialMenu_cb);
simple_serve.post('/getNumbersRadialMenu', blizaarSystem.ensureAuthenticated, getNumbersRadialMenu_cb);
simple_serve.get('/getIcons',blizaarSystem.ensureAuthenticated, getIcons_cb);
simple_serve.post('/getBarChartAttributes',blizaarSystem.ensureAuthenticated, getBarChartAttributes_cb);
simple_serve.post('/getRightNodes',blizaarSystem.ensureAuthenticated, getRightNodes_cb);
// Analytics capabilities lists
......
......@@ -571,6 +571,44 @@ angular.module('blizaarModule.services')
return false;
});
},
/**************************************
* getBarChartAttributes
* Functionality: List of attributes from server descibring what should be used
*
* Created By : Fintan McGee (LIST)
* Date: 11/04/2019
*******************************/
getBarChartAttributes : function(graphSource){
var self = this;
//self.merge=merge;
return $http({
method: 'post',
url: '/getBarChartAttributes', // url where to get data.
headers: { 'Content-Type': 'application/json' }, // set the headers so angular passing info as form data (not request payload)
data: {
graphSource: graphSource,
}
})
// Success case
.then(function (response) {
// do the mege
//return response.data.links.length;
// return the set of edges in case thex need to be added to specific layers
return response.data.barChartAttributes;
},
// Error handling
function (err) {
alert(err.data);
console.log("getBarChartAttributes" + JSON.stringify(err));
return false;
});
},
/**************************************
* getEdgeSet
* Functionality: Removes a temporary tag label, that may have been used to mark a node set in a previous call
......
......@@ -260,12 +260,17 @@ angular.module('blizaarModule.services')
multiLayerGraphService.getGraph().buildAdjacencyList();
attributeDisplayService.clearDisplayAttributes();
attributeDisplayService.addDisplayAttributes(["BLZ_betweenness","BLZ_normalized_betweenness","BLZ_closeness","BLZ_eigenvector",
"BLZ_clustering_coefficient", "BLZ_degree","creation_time","celebrity","df",
"BLZ_degree_back_end","score","specificity","status","BLZ_order","depth",
"firstMentionDate","lastMentionDate","birth_time","death_time", "creation_time","score",
"tf","tdf","tfidf","frequency","df","jaccard","overlapping","cdiff","union",
"intersections","type","weight"])
var displayAttributes = dataService.getBarChartAttributes("histograph").then (function(barChartAttributes){
attributeDisplayService.addDisplayAttributes(barChartAttributes);
//[("BLZ_betweenness", "BLZ_normalized_betweenness", "BLZ_closeness", "BLZ_eigenvector",
// "BLZ_clustering_coefficient", "BLZ_degree", "creation_time", "celebrity", "df",
// "BLZ_degree_back_end", "score", "specificity", "status", "BLZ_order", "depth",
// "firstMentionDate", "lastMentionDate", "birth_time", "death_time", "creation_time", "score",
// "tf", "tdf", "tfidf", "frequency", "df", "jaccard", "overlapping", "cdiff", "union",
// "intersections", "type", "weight"])
});
// if we are layering the grpah this will replace the previous layering for type and temproal values
var oldLayeringNameList = [] ; // names of layers form previous laying to bve deltinged before relayering the graph
......
......@@ -88,6 +88,15 @@ module.exports = {
},
dataSetRelevantEdges:{
histograph:["appears_in","appear_in_same_document","belongs_to","is_part_of"]
}
},
dataSetBarChartAttributes:{
default: [],
histograph:["BLZ_betweenness","BLZ_normalized_betweenness","BLZ_closeness","BLZ_eigenvector",
"BLZ_clustering_coefficient", "BLZ_degree","creation_time","celebrity","df",
"BLZ_degree_back_end","score","specificity","status","BLZ_order","depth",
"firstMentionDate","lastMentionDate","birth_time","death_time", "creation_time","score",
"tf","tdf","tfidf","frequency","df","jaccard","overlapping","cdiff","union",
"intersections","type","weight"]
}
};
......@@ -248,7 +248,6 @@ function cypherRow(query, params, cb) {
}
}
if (!encounteredError) {
//sLog.log_debug_file("\n\n\n*************Neo4j Data Received************** "+ JSON.stringify(res.body.results[0].data), "Cypher Reply", new Date() );
cb(err, res.body);
} else {
......@@ -1865,7 +1864,6 @@ function getQueryForOneNode(user,links,nodes,id,res){
* Date: 21/06/2018
*******************************/
function getAnEasyQuery(user,entity,res) {
var params = {limit: 10000};
var cb = function (err, data) { // call back function for DB call
......@@ -2640,6 +2638,17 @@ function completeGraphEdgeSet(user, graphName,nodeIdArray, nodeTypes, relationsh
};
cypher(query, params, cb);
}
function getBarChartAttributes(dataSource,response) {
var barChartAttributes = [];
if(cfg.neo4j.dataSetBarChartAttributes.hasOwnProperty(dataSource)) {
barChartAttributes = cfg.neo4j.dataSetBarChartAttributes[dataSource];
} else {
barChartAttributes = cfg.neo4j.dataSetBarChartAttributes["default"];
}
response.json( {barChartAttributes: barChartAttributes});
}
// List of functions which are exported for use by other modules
module.exports.doNeo4Login = doNeo4Login;
module.exports.getGraphDataByTypes = getGraphDataByTypes;
......@@ -2676,4 +2685,5 @@ module.exports.setIcons = setIcons;
module.exports.setRightNodes = setRightNodes;
module.exports.getEdgeSet = getEdgeSet;
module.exports.removeTempTagLabel = removeTempTagLabel;
module.exports.removeAllTempTagLabel=removeAllTempTagLabel;
\ No newline at end of file
module.exports.removeAllTempTagLabel=removeAllTempTagLabel;
module.exports.getBarChartAttributes = getBarChartAttributes;
\ No newline at end of file
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