forked from vvkbhshn/graph-algo-visualization-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
80 lines (79 loc) · 4.49 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
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
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Graph Algo Visualization</title>
<link rel="stylesheet" href="style.css" />
<!-- CDN Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<!-- CDN JQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<!-- CDN cytoscape.js library -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.19.0/cytoscape.min.js"></script>
<!--CDN cytoscape-dagre layout -->
<script src="https://cdn.rawgit.com/cpettitt/dagre/v0.7.4/dist/dagre.min.js"></script>
<script src="https://cdn.rawgit.com/cytoscape/cytoscape.js-dagre/1.5.0/cytoscape-dagre.js"></script>
<!--CDN cytoscape-klay layout -->
<script src="https://unpkg.com/[email protected]/klay.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/cytoscape-klay.js"></script>
</head>
<body>
<h1>Graph Algorithm Visualizer</h1>
<div class="container">
<div class="row">
<div class="col col-12 col-lg-4">
<form action="/" class="form-control">
<div class="form-group"><br>
<label for="num-of-nodes">No. of nodes: </label>
<input type="number" class="form-control" id="num-of-nodes" name="num-of-nodes" min="1" max="100" required><br>
</div>
<div class="form-group">
<span> Type of edges: </span><br>
<div class="row">
<div class="col">
<select name="directed" class="form-control" id="directed">
<option value="directed">Directed</option>
<option value="undirected">Undirected</option>
</select>
</div>
<div class="col">
<select name="weighted" class="form-control" id="weighted">
<option value="unweighted">Unweighted</option>
<option value="weighted">Weighted</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<label for="algo">Algorithm: </label>
<select name="algo" class="form-control" id="algo" style="max-width: 90%;">
<option value="dfs">DFS</option>
<option value="bfs">BFS</option>
<option value="a-star">A*</option>
<option value="dijkstra">Dijkstra</option>
<option value="bellman-ford">Bellman Ford</option>
<option value="floyd-warshall">Floyd Warshall</option>
</select><br>
</div>
<div class="form-group">
<label for="start-node">Start node: </label>
<input type="number" class="form-control" id="start-node" name="start-node" min="1" value="1" required><br>
</div>
<div class="form-group">
<label for="end-node">End node: </label>
<input type="number" class="form-control" id="end-node" name="end-node" min="1">
<span>(for path finding algorithms)</span><br><br><br>
</div>
<input type="submit" class="btn btn-primary" id="visualize" value="Visualize">
<input type="reset" class="btn btn-secondary" id="reset" value="Reset"><br>
</form>
</div>
<div class="col col-12 col-lg-8" id="cy"></div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="index.js"></script>
</body>
</html>