Skip to content

Commit 8c6806b

Browse files
authored
INTLV-10: Create a mathematical formula to stop the graph layout that depends on no. of results
INTLV-10: Create a mathematical formula to stop the graph layout that depends on no. of results
2 parents 77f90b3 + fdaac2f commit 8c6806b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

application-interactive-link-visualizer-ui/src/main/resources/Interactive Link Visualizer/Panel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ The aim for the panel is to show the network graph visualization centered around
385385
edges: edges
386386
};
387387

388-
visualisationAPI.visualize(graphData, "sigma-container-panel", themeColors, isPanel = true);
388+
visualisationAPI.visualize(graphData, "sigma-container-panel", themeColors, isPanel = true, nb);
389389

390390
});
391391
}

application-interactive-link-visualizer-ui/src/main/resources/Interactive Link Visualizer/WebHome.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
$('#sigma-container').empty();
223223
$('#node-count').text('Displaying ' + nodes.length + ' documents & ');
224224
$('#edge-count').text(edges.length + ' links');
225-
visualisationAPI.visualize(graphData, "sigma-container", themeColors, isPanel = false);
225+
visualisationAPI.visualize(graphData, "sigma-container", themeColors, isPanel = false, nb);
226226

227227
});
228228
});

application-interactive-link-visualizer-webjar/src/main/resources/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface ThemeColors {
4141
nodeColor: string
4242
}
4343

44-
export function visualize(data: DirectedGraph, sigmaContainer: string, themeColors: ThemeColors, isPanel = false) {
44+
export function visualize(data: DirectedGraph, sigmaContainer: string, themeColors: ThemeColors, isPanel = false, nb : number = null) {
4545
const graph = new DirectedGraph();
4646
graph.import(data);
4747

@@ -102,7 +102,7 @@ const EdgeArrowProgram = createEdgeCompoundProgram([
102102
}
103103
function startFA2() {
104104
fa2Layout.start();
105-
setTimeout(stopFA2, (isPanel ? 2000 : 8000));
105+
setTimeout(stopFA2, (isPanel ? 1500 : (Math.log(nb) * 1200)));
106106
}
107107
startFA2();
108108

0 commit comments

Comments
 (0)