Skip to content
Snippets Groups Projects
Commit 499a8de2 authored by Dorus's avatar Dorus
Browse files

hack: hacky way to bypass existing code resetting cluster colors from community detection udf

parent 7e34c815
No related branches found
No related tags found
No related merge requests found
Pipeline #147746 failed
......@@ -51,10 +51,14 @@ export function processCommunityDetection(ml: ML, graph: GraphType): GraphType {
}
return graph;
}
export function processML(ml: ML, graph: GraphType): GraphType {
// TODO processCommunityDetection is bypasses in a hacky way here, because it resets clusters that are assigned manually in the community
// detection udf
export function processML(ml: ML, graph: GraphType, bypass_community_detection: Boolean): GraphType {
let ret = processLinkPrediction(ml, graph);
ret = processCommunityDetection(ml, ret);
if (!bypass_community_detection) {
console.log("bypassing community detection")
ret = processCommunityDetection(ml, ret);
}
return ret;
}
......
......@@ -142,6 +142,8 @@ export function parseQueryResult(queryResult: GraphQueryResult, ml: ML, options:
radius: radius,
defaultX: (options.defaultX || 0) + Math.random() * radius * 20 - radius * 10,
defaultY: (options.defaultY || 0) + Math.random() * radius * 20 - radius * 10,
// hacky way of passing cluster label on #TODO find a better wy
cluster: node.cluster !== undefined ? node.cluster : undefined
};
// let mlExtra = {};
......@@ -168,6 +170,9 @@ export function parseQueryResult(queryResult: GraphQueryResult, ml: ML, options:
ret.nodes[data._id] = data;
}
// Filter unique edges and transform to LinkTypes
// List for all links
......@@ -224,5 +229,5 @@ export function parseQueryResult(queryResult: GraphQueryResult, ml: ML, options:
// }
// return toBeReturned;
return processML(ml, ret);
return processML(ml, ret, true);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment