-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
40 lines (36 loc) · 1.44 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html lang="en">
<head>
<title>Force layout</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="style.css">
<script>
cookieStore.get("theme")
.then(c => c.value)
.catch(e => window.matchMedia("(prefers-color-scheme: dark)").matches && "dark")
.then(v => (v == "dark") && document.head.classList.toggle("dark-mode"))
</script>
</head>
<body>
<div id="board">
<canvas></canvas>
</div>
<script src="PicoVector/vector2D.js"></script>
<script src="physics.js"></script>
<script src="drawing.js"></script>
<script src="formal.js"></script>
<script src="app.js"></script>
<script>
const graph = Graph.genWithinSphere(200, 2, .2)
//const graph = Graph.genWithinSphere(140, 3, .22).masked((n, g) => g.neighbors(n).length > 0)
//const graph = Graph.genErosRenyi(50, 100)
//const graph = Graph.genTree(3, 3)
//const graph = Graph.genPath(4)
//const graph = Graph.genPath(5, true).product(Graph.genPath(2), "tensor")
//const graph = Graph.genPath(4).product(Graph.genPath(4))
//const graph = Graph.genPath(3, true).product(Graph.genPath(3), "cartesian")
//const graph = Graph.genPath(4).product(Graph.genPath(2), "strong")
const app = new App({graph: graph, repulsion: 200., stiffness: 500, damping: 0.22, energy_threshold: 0.01, max_speed: 1});
</script>
</body>
</html>