Skip to content

Commit 00355eb

Browse files
committed
feat: Switch to fCose layout
1 parent 75fe7df commit 00355eb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

graph.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ function selectionChanged() {
3939

4040
function layoutNodes() {
4141
cy_layout = cy.layout({
42-
name: "cola",
42+
name: "fcose",
4343
animate: "end",
4444
padding: 50,
4545
avoidOverlap: true,
4646
nodeDimensionsIncludeLabels: true,
4747
centerGraph: false,
48+
numIter: 10000,
4849
});
4950
cy_layout.run();
5051
}

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
77
<link rel="stylesheet" type="text/css" href="assets/style.css">
88
<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.28.1/cytoscape.min.js"></script>
9-
<script src="https://unpkg.com/webcola@3.3.8/WebCola/cola.min.js"></script>
10-
<script src="https://cdn.jsdelivr.net/npm/cytoscape-cola@2.5.1/cytoscape-cola.min.js"></script>
9+
<script src="https://unpkg.com/layout-base/layout-base.js"></script>
10+
<script src="https://unpkg.com/cose-base/cose-base.js"></script>
11+
<script src="https://unpkg.com/cytoscape-fcose/cytoscape-fcose.js"></script>
1112
<script src="graph.js"></script>
1213
<script src="table.js"></script>
1314
<script src="index.js"></script>

0 commit comments

Comments
 (0)