Changes for client/js/services/graphutils.js: 100 added lines, 2 removed lines.
Original line number
Diff line number
Diff line
@@ -2,8 +2,7 @@ angular
.module('kg-app')
.service('GraphUtils',[function(){
return{
// Maybe add function to app to export adjacency matrix?
// Maybe in some standardized format such as GraphMD?
/*
createAdjacencyMatrix: function(nodes, edges) {
var edgeHash = {};
edges.forEach(function(x){
@@ -27,6 +26,38 @@ angular
});
return matrix;
},
*/
createAdjacencyMatrix:function(nodes,edges){
constedgeHash={};
constmatrix=[];
edges.forEach(function(x){
constid=x.from+"-"+x.to;
edgeHash[id]=x;
});
//create all possible edges
nodes.forEach(function(a){
constadjacencyvector=[];
nodes.forEach(function(b){
constgridid=a.id+"-"+b.id;
constgridid2=b.id+"-"+a.id;// because we can justify treating our graph as undirected (since relation directions are irrelevant for social dimension of graph)
<labelclass="checkbox-inline pull-left"><inputtype="checkbox"ng-model="vissettings.allPaths"ng-true-value="true"ng-false-value="false"> Show all paths</label>