-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
212 lines (193 loc) · 7.38 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Graphs App</title>
<!-- ICONS -->
<script src="https://kit.fontawesome.com/31bac16aff.js" crossorigin="anonymous"></script>
<!-- STYLES -->
<link rel="stylesheet" href="/src/styles/ui.css" />
<link rel="stylesheet" href="/src/styles/graph.css" />
</head>
<body>
<main>
<header>
<h1>ezGraphs | Draw graphs and execute search algorithms</h1>
<div class="links">
<a href="https://github.com/Emanuel-Palestino/graphs-drawing-app-with-search-algorithm" target="_blank" title="Repository">
<i class="fa-brands fa-github"></i>
</a>
</div>
</header>
<!-- TOOLS MENU -->
<menu>
<!-- GRAPH -->
<section id="graph">
<span class="section-title">Graph</span>
<ul>
<li>
<button id="btn-new_graph" title="Create new graph">
<i class="fa-solid fa-circle-plus"></i>
</button>
</li>
<li>
<button id="btn-clear_graph" title="Clear canvas" disabled>
<i class="fa-solid fa-trash fa-sm"></i>
</button>
</li>
</ul>
</section>
<!-- DRAWING -->
<section id="drawing">
<span class="section-title">Drawing</span>
<ul>
<li>
<button id="btn-draw_node" title="Draw node" disabled>
<i class="fa-regular fa-circle"></i>
</button>
</li>
<li>
<button id="btn-draw_edge" title="Draw edge" disabled>
<i class="fa-solid fa-slash fa-sm"></i>
</button>
</li>
<li>
<button id="btn-delete_element" title="Delete element" disabled>
<i class="fa-regular fa-circle-xmark"></i>
</button>
</li>
</ul>
</section>
<!-- ALGORITHM EXECUTION -->
<section id="execution">
<span class="section-title">Algorithm Execution</span>
<ul>
<li>
<select id="algorithm_execution" title="Select search algorithm" disabled>
<option value="bfs">BFS</option>
<option value="dfs">DFS</option>
</select>
</li>
<li>
<button id="btn-play_execution" title="Play execution" disabled>
<i class="fa-solid fa-play"></i>
</button>
</li>
<li>
<button id="btn-pause_execution" title="Pause execution" disabled>
<i class="fa-solid fa-pause"></i>
</button>
</li>
<li>
<button id="btn-stop_execution" title="Stop execution" disabled>
<i class="fa-solid fa-stop"></i>
</button>
</li>
<li>
<button id="btn-clean_execution" title="Clean execution" disabled>
<i class="fa-solid fa-eraser"></i>
</button>
</li>
<li>
<button id="btn-show_results" title="Show/Hide result" disabled>
<i class="fa-solid fa-table"></i>
</button>
</li>
</ul>
</section>
</menu>
<div id="editor_body">
<!-- CANVAS -->
<svg id="canvas" width="100%" height="100%" viewBox="0 0 1200 700">
<defs>
<marker id="arrowhead" orient="auto" markerUnits="userSpaceOnUse" markerWidth="19" markerHeight="15" refX="39"
refY="7.5">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M2.00686 14.4884H1.43619C1.09138 14.423 0.776803 14.24 0.569826 13.9598C0.201536 13.4613 0.272124 12.7994 0.741694 12.3757L6.14329 7.50152L0.741695 2.62733C0.272125 2.20361 0.198466 1.53895 0.569826 1.04322C0.941185 0.547492 1.64708 0.353632 2.26089 0.586263L17.4836 6.34666C17.9992 6.54052 18.3337 6.99748 18.3337 7.50152C18.3337 8.00555 17.9992 8.46251 17.4836 8.65637L2.26089 14.4168C2.1776 14.4483 2.09256 14.4721 2.00686 14.4884Z"
fill="#303952" />
</marker>
<marker id="arrowhead_temp" orient="auto" markerUnits="userSpaceOnUse" markerWidth="19" markerHeight="15"
refX="18" refY="7.5">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M2.00686 14.4884H1.43619C1.09138 14.423 0.776803 14.24 0.569826 13.9598C0.201536 13.4613 0.272124 12.7994 0.741694 12.3757L6.14329 7.50152L0.741695 2.62733C0.272125 2.20361 0.198466 1.53895 0.569826 1.04322C0.941185 0.547492 1.64708 0.353632 2.26089 0.586263L17.4836 6.34666C17.9992 6.54052 18.3337 6.99748 18.3337 7.50152C18.3337 8.00555 17.9992 8.46251 17.4836 8.65637L2.26089 14.4168C2.1776 14.4483 2.09256 14.4721 2.00686 14.4884Z"
fill="#303952" />
</marker>
</defs>
<g id="edges"></g>
<g id="nodes"></g>
</svg>
<div id="algorithm_results">
<h2>Results</h2>
<table></table>
</div>
</div>
<!-- MODALS -->
<dialog id="new_graph_modal">
<div class="header">
<h3>Create New Graph</h3>
</div>
<div class="body">
<form id="new_graph_form">
<div class="form-input">
<label for="graph_type">Graph Type:</label>
<select id="graph_type" name="graph_type">
<option value="undirected">Undirected</option>
<option value="directed">Directed</option>
</select>
</div>
<div class="form-input">
<label for="weighted_graph">Weighted Graph:</label>
<input type="checkbox" name="weighted_graph" id="weighted_graph">
</div>
<div class="form-input">
<label for="autoname">Naming Nodes Automatically:</label>
<input type="checkbox" name="autoname" id="autoname" checked>
</div>
</form>
<div class="buttons">
<button class="secondary" modal-cancel>Cancel</button>
<button form="new_graph_form" class="primary" modal-accept>Create</button>
</div>
</div>
</dialog>
<dialog id="name_node_modal">
<div class="header">
<h3>Create a Node</h3>
</div>
<div class="body">
<form id="name_node_form">
<div class="form-input">
<label for="node_name">Node Name:</label>
<input type="text" name="node_name" id="node_name" autocomplete="off">
</div>
</form>
<div class="buttons">
<button class="secondary" modal-cancel>Cancel</button>
<button form="name_node_form" class="primary" modal-accept>Create Node</button>
</div>
</div>
</dialog>
<dialog id="edge_weight_modal">
<div class="header">
<h3>Create an Edge</h3>
</div>
<div class="body">
<form id="edge_weight_form">
<div class="form-input">
<label for="edge_weight">Edge Weight:</label>
<input type="number" name="edge_weight" id="edge_weight">
</div>
</form>
<div class="buttons">
<button class="secondary" modal-cancel>Cancel</button>
<button form="edge_weight_form" class="primary" modal-accept>Create Edge</button>
</div>
</div>
</dialog>
</main>
<script type="module" src="/src/editor.ts"></script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>