-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
171 lines (156 loc) · 9.1 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<html>
<head>
<title>Graph Simulator</title>
<link rel="stylesheet" type="text/css" href="./Asset/main.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="icon" href="./Asset/logo/logo.png" type="image/icon type">
</head>
<body>
<!-- The modal for showing the answers of the calculations : Starts Here -->
<div class="modal fade" id="answerModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">Answer</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="closeAnswerModal()"></button>
</div>
<div class="modal-body" id="answerModalBody">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" onclick="closeAnswerModal()">Close</button>
</div>
</div>
</div>
</div>
<!-- The modal for showing the answers of the calculations : Ends Here -->
<!-- The modal for taking weight of edge : Starts Here -->
<div class="modal fade" id="weightModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5">Enter Weight of an Edge</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="closeWeightModal()"></button>
</div>
<div class="modal-body">
<form>
<div class="mb-3">
<label for="edge-weight" class="col-form-label">Edge Weight:</label>
<input type="text" class="form-control" id="edge-weight">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" onclick="closeWeightModal()">Close</button>
<button type="button" class="btn btn-primary" onclick="closeWeightModal()">Set Weight</button>
</div>
</div>
</div>
</div>
<!-- The modal for taking weight of edge : Ends Here -->
<!-- The modal for showing the matrix : Starts Here -->
<div class="modal fade" tabindex="-1" id="matModal">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Matrix Generated!</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="closeMatModal()"></button>
</div>
<div class="modal-body" id="matModalBody">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" onclick="closeMatModal()">Close</button>
<!-- If this button, may be needed in the future -->
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
</div>
</div>
</div>
</div>
<!-- The modal for showing the matrix : Ends Here -->
<!-- TOP PANEL -->
<div id="panel_top">
<div><img src="./Asset/Images/icon_info.png" alt="Icon_Info"></div>
<div id="label_info">Select some tool to start making Graph!</div>
</div>
<!-- TOP PANEL ENDS HERE -->
<!-- ======================================================================================= -->
<!-- TOOL AND CONFIG PANEL STARTS -->
<div id="panel_parent">
<div id="panel_tools">
<!-- Container for Tools Menu -->
<div class="container_menu">
<div class="container_menu_title"><h1>Tools:</h1></div>
<!-- Container for Three Elements Only -->
<div class="container_tool">
<!-- NOTE : The function should use the string that are mentioned in toolManager.js to call selectTool function -->
<div class="item_tool">
<div class="item_tool_icon"><img src="./Asset/Images/icon_node.png" alt="icon_node" onclick='selectTool("Node")''></div>
<div class="item_tool_name">Node Tool</div>
</div>
<div class="item_tool">
<div class="item_tool_icon"><img src="./Asset/Images/icon_udEdge.png" alt="icon_node" onclick='selectTool("UdEdge")''></div>
<div class="item_tool_name">Undirected Edge</div>
</div>
<div class="item_tool">
<div class="item_tool_icon"><img src="./Asset/Images/icon_weEdge.png" alt="icon_node" onclick='selectTool("WeEdge")''></div>
<div class="item_tool_name">Weighted Edge</div>
</div>
</div>
</div>
<!-- Container for Tools Ends -->
<!-- Container for Simulations Menu -->
<div class="container_menu">
<div class="container_menu_title"><h1>Functionalities:</h1></div>
<!-- Container for Three Elements Only -->
<div class="container_tool">
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary" onclick="formMatrix()" id="matButton">Matrix Formation</button>
<button type="button" class="btn btn-primary" onclick="formPrimsMST()" id="">Prim's MST</button>
<button type="button" class="btn btn-primary" onclick="formKruskalsMST()" id="">Kruskal's MST</button>
</div>
</div>
</div>
<!-- Container for Simulations Ends -->
<!-- Container for Simulations Menu -->
<div class="container_menu">
<div class="container_menu_title"><h1>Simulations:</h1></div>
<!-- Container for Three Elements Only -->
<div class="container_tool">
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary" onclick="applyPrims(true)">Prims Algorithm</button>
<button type="button" class="btn btn-primary" onclick="applyKruskals(true)">Kruskal's Algorithm</button>
</div>
</div>
</div>
<!-- Container for Simulations Ends -->
</div>
</div>
<!-- TOOL AND CONFIG PANEL ENDS -->
<!-- ======================================================================================= -->
<!-- CANVAS STARTS HERE -->
<canvas id="canvas">
<b>Sorry! Canvas is not supported in your browser.</b>
</canvas>
<!-- CANVAS ENDS HERE -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
<!-- Odering the scripts import is important in Vanilla JS -->
<!-- The GuiHelpers -->
<script src="./Asset/Scripts/GuiHelpers/NodeHelper.js"></script>
<script src="./Asset/Scripts/GuiHelpers/EdgeHelper.js"></script>
<script src="./Asset/Scripts/GuiHelpers/WeightedEdge.js"></script>
<!-- Something Else and/or main script -->
<script src="./Asset/Scripts/ToolHelpers/toolManager.js"></script>
<script src="./Asset/main.js"></script>
<script src="./Asset/Scripts/ToolHelpers/weightedEdgeManager.js"></script>
<script src="./Asset/Scripts/SimulationsHelper/answerModalManagement.js"></script>
<!-- The animation Helpers -->
<script src="./Asset/Scripts/AnimationHelpers/KruskalsMstAnimation.js"></script>
<script src="./Asset/Scripts/AnimationHelpers/PrimsMstAnimation.js"></script>
<!-- The functionalities -->
<script src="./Asset/Scripts/Functionalities/matrixFormation.js"></script>
<script src="./Asset/Scripts/Functionalities/primsMstFormation.js"></script>
<script src="./Asset/Scripts/Functionalities/kruskalsMstFormation.js"></script>
<!-- The Simulation Helpers -->
<script src="./Asset/Scripts/SimulationsHelper/primsAlgo.js"></script>
<script src="./Asset/Scripts/SimulationsHelper/kruskalsAlgo.js"></script>
</html>