Skip to content
Snippets Groups Projects
Commit bc4a3ea6 authored by Marc Feger's avatar Marc Feger
Browse files

Unify edges by adding only distinct edge ids to the graph

parent 3c23b078
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ export class Graph { ...@@ -12,6 +12,7 @@ export class Graph {
addEdge(newEdge){ addEdge(newEdge){
this.edges.push(newEdge); this.edges.push(newEdge);
this.edges = this.getUnique(this.edges, "id");
} }
getUnique(arr, comp) { getUnique(arr, comp) {
......
...@@ -35,6 +35,7 @@ export class GraphCreator { ...@@ -35,6 +35,7 @@ export class GraphCreator {
element.forEach(function (relation) { element.forEach(function (relation) {
if (relation instanceof neo4j.types.Relationship) { if (relation instanceof neo4j.types.Relationship) {
var newEdge = { var newEdge = {
"id": relation.identity.toInt(),
"source": relation.start.toInt(), "source": relation.start.toInt(),
"target": relation.end.toInt(), "target": relation.end.toInt(),
"type": relation.type "type": relation.type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment