-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdebug.html
70 lines (61 loc) · 2.16 KB
/
debug.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!doctype html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/7.2.4/pixi.min.js" integrity="sha512-Ch/O6kL8BqUwAfCF7Ie5SX1Hin+BJgYH4pNjRqXdTEqMsis1TUYg+j6nnI9uduPjGaj7DN4UKCZgpvoExt6dkw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script data-require="jquery@*" data-semver="2.1.4" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script data-require="jquery-mousewheel@*" data-semver="3.1.13" src="//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"></script>
</head>
<body>
<div style="display: inline-flex;">
<div id="canvas"></div>
<div id="debug"></div>
</div>
<script type="module">
import UNLE from './src/main.js'
let graph = new UNLE({
"canvas": document.getElementById("canvas"),
"debug": document.getElementById("debug"),
"show_id": false,
"node_radius": 7,
"node_color": 0x000000,
"edge_length": 100
});
let nodes = 10;
let edges = 20;
graph.generateRandomGraph(graph, nodes, edges);
/*
let nodes = 10;
let edges = 50;
for (let i = 0; i < nodes; i++) {
graph.add_node(i);
}
for (let i = 0; i < edges; i++) {
let a = Math.floor(Math.random() * nodes);
let b = Math.floor(Math.random() * nodes);
graph.add_edge(a, b);
}
*/
/*
var input = `
nodes: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
1 -> 2
2 -> 3
3 -> 4
4 -> 5
5 -> 6
6 -> 7
7 -> 8
8 -> 9
9 -> 10
10 -> 1
5 -> 1
5 -> 2
5 -> 3
5 -> 4
5 -> 6
`
graph.from_node_language(input)
*/
</script>
</body>
</html>