-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
87 lines (87 loc) · 2.98 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
<!DOCTYPE html>
<html>
<head>
<title>Dijkstra's Algorithm Solver</title>
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" href="css/style.css" />
</head>
<body class="container">
<div class="dg">
<h1 class="main-title">Dijkstra's Algorithm Solver</h1>
</div>
<div class="df jc gap-2">
<canvas id="canvas" width="800" height="600">
<span class="error"
>Your browser does not support<br />the HTML5 <canvas>
element</span
>
</canvas>
<div class="df flex-col ac">
<div class="box" id="toolbox">
<label for="presetSelector">Preset</label>
<select class="select form-control" id="presetSelector">
<option value="">-- Select --</option>
<option value="dag_clrs.json">DAG CLRS</option>
<option value="5vertices.json">5 Vertices</option>
<option value="8vertices.json">8 Vertices</option>
</select>
<button class="btn btn-primary" id="computeShortestPath">
Shortest Path
</button>
<button class="btn btn-primary" id="clearCanvas">Clear Canvas</button>
<p class="center">
Export : <a href="javascript:saveAsPNG()">PNG</a> |
<a href="javascript:saveAsSVG()">SVG</a> |
<a href="javascript:saveAsLaTeX()">LaTeX</a>
</p>
</div>
<div class="box" id="result"></div>
</div>
</div>
<div class="row">
<pre class="code" id="output"></pre>
<h2 class="secondary-title">Instructions</h2>
<p>
The big white box above is the where you can draw vertices and edges.
Here's how to use it:
</p>
<ul>
<li><b>Add a vertex (node):</b> double-click on the canvas</li>
<li><b>Make source vertex:</b> double-click on an existing vertex</li>
<li>
<b>Add an edge:</b> shift-drag on the canvas from one vertex to
another
</li>
<li><b>Move something:</b> drag it around</li>
<li>
<b>Delete something:</b> click it and press the delete key (not the
backspace key)
</li>
<li>
<b>Type numeric subscript:</b> put an underscore before the number
(like "S_0")
</li>
<li>
<b>Type greek letter:</b> put a backslash before it (like "\beta")
</li>
</ul>
</div>
<div class="row">
<footer>
<p>
Created by Gopal Adhikari. Powered by FSM Designer by
<a href="http://madebyevan.com/fsm">Evan Wallace</a>
</p>
<p>
<a href="https://github.com/qubbit/dijkstra"
>Fork this project on GitHub</a
>
</p>
</footer>
</div>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/dijkstra.js"></script>
<script type="text/javascript" src="js/fsm.js"></script>
</body>
</html>