-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
179 lines (159 loc) · 7.31 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
<!doctype html>
<html lang="en" prefix="og: https://ogp.me/ns#">
<head>
<meta charset="utf-8">
<title>Interactive Graph Theory • Learn Graphs and Graph Algorithms</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Ahmet Sait">
<meta name="description" content="Learn graph theory while having fun by drawing graphs and animating algorithms!">
<meta name="keywords" content="visual, interactive, graph, theory, algorithm">
<meta name="theme-color" content="#fafafa">
<link rel="canonical" href="https://ahmetsait.com/interactive-graph-theory">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="favicon/favicon-blue-192.png">
<meta property="og:url" content="https://ahmetsait.com/interactive-graph-theory">
<meta property="og:type" content="website">
<meta property="og:title" content="Interactive Graph Theory • Learn Graphs and Graph Algorithms">
<meta property="og:description" content="Learn graph theory while having fun by drawing graphs and animating algorithms!">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://ahmetsait.com/interactive-graph-theory/img/opengraph.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://ahmetsait.com/interactive-graph-theory/img/twitter.png">
<script type="application/ld+json">
{
"@type": "WebPage",
"url": "https://ahmetsait.com/interactive-graph-theory",
"headline": "Interactive Graph Theory • Learn Graphs and Graph Algorithms",
"description": "Learn graph theory while having fun by drawing graphs and animating algorithms!",
"image": {
"@type": "imageObject",
"url": "https://ahmetsait.com/interactive-graph-theory/favicon/favicon-blue-512.png",
"height": "512",
"width": "512"
},
"author": {
"@type": "Person",
"name": "Ahmet Sait"
},
"@context": "https://schema.org"
}
</script>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="assets/fontawesome/css/all.css">
</head>
<body>
<header class="site-header container">
<h1 class="site-title"><a href="">Interactive Graph Theory</a></h1>
<button class="help-button" onclick="showDialog('help-dialog')"><i class="fa-regular fa-circle-question"></i></button>
</header>
<div class="container toolbar">
<div>
<button class="dropdown-button"><i class="fa-solid fa-circle-nodes"></i><span> Graph <i class="fa-solid fa-caret-down"></i></button>
<div class="dropdown hidden">
<button onclick="importDialog()"><i class="fa-solid fa-file-import"></i> Import JSON</button>
<button onclick="exportDialog()"><i class="fa-solid fa-file-export"></i> Export JSON</button>
</div>
</div>
<div>
<button class="dropdown-button"><i class="fa-solid fa-gears"></i><span> Algorithms <i class="fa-solid fa-caret-down"></i></span></button>
<div class="dropdown hidden">
<button onclick="dijkstra()">Shortest Path via Dijkstra's Algorithm</button>
<button onclick="BFS()">Breadth First Search</button>
<button onclick="DFS()">Depth First Search</button>
<!--
<button>Minimum Spanning Tree: Prim</button>
<button>Minimum Spanning Tree: Kruskal</button>
<button>Graph Coloring</button>
<button>Page Rank</button>
-->
</div>
</div>
<!--
<button><i class="fa-regular fa-circle-play"></i><span> Force Directed</span></button>
<button><i class="fa-solid fa-arrow-right-arrow-left"></i><span> Edge Mode</span></button>
<button><i class="fa-solid fa-rotate-left"></i><span> Undo</span></button>
<button><i class="fa-solid fa-rotate-right"></i><span> Redo</span></button>
<button><i class="fa-solid fa-scissors"></i><span> Cut</span></button>
<button><i class="fa-regular fa-copy"></i><span> Copy</span></button>
<button><i class="fa-regular fa-clipboard"></i><span> Paste</span></button>
<button><i class="fa-regular fa-clone"></i><span> Clone</span></button>
-->
<button onclick="selectAll()"><i class="fa-regular fa-object-group"></i><span> Select All</span></button>
<button onclick="deleteSelected()"><i class="fa-solid fa-xmark"></i><span> Delete</span></button>
<button onclick="resetAll()"><i class="fa-solid fa-eraser"></i><span> Clear</span></button>
</div>
<div id="help-dialog" class="modal-layer hidden">
<div class="modal-window">
<div class="modal-header">
<div class="modal-title">Help</div>
<button class="modal-close-button"><i class="fa-regular fa-circle-xmark"></i></button>
</div>
<div class="modal-content">
<h2>Keyboard & Mouse Controls</h2>
<ul>
<li>Left click on blank space to add new nodes.</li>
<li>Left click a node and drag mouse to another node to make an edge connection.</li>
<li>Right click on a node and drag across nodes to delete them.</li>
<li>Right click on blank space and drag across edges to delete them.</li>
<li>Shift + Left click on a node and drag across nodes to select them.</li>
<li>Shift + Left click and drag over the canvas to rectangular select.</li>
<li>Ctrl + Left click and drag to move nodes.</li>
<li>Alt + Left click and drag to move the camera.</li>
<li>Ctrl + A to select / deselect all nodes.</li>
<li>Press delete key to delete selected nodes.</li>
</ul>
<h2>Touch Screen Controls</h2>
<ul>
<li>Tap on blank space to add nodes.</li>
<li>Tap on a node to select / deselect it.</li>
<li>Swipe between nodes to make edge connections.</li>
<li>Double tap on a node and swipe across nodes to delete them.</li>
<li>Tap + Hold on blank space and swipe across edges to delete them.</li>
<li>Tap + Hold on nodes to move them.</li>
<li>Swipe with two fingers to move the camera.</li>
</ul>
</div>
</div>
</div>
<div id="import-dialog" class="modal-layer hidden">
<div class="modal-window">
<div class="modal-header">
<div class="modal-title">Import JSON</div>
<button class="modal-close-button"><i class="fa-regular fa-circle-xmark"></i></button>
</div>
<div class="modal-content">
<textarea id="import"></textarea>
</div>
<div class="modal-footer">
<button onclick="importConfirm()" class="modal-ok">Import</button>
<button onclick="closeDialog('import-dialog')" class="modal-cancel">Cancel</button>
</div>
</div>
</div>
<div id="export-dialog" class="modal-layer hidden">
<div class="modal-window">
<div class="modal-header">
<div class="modal-title">Export JSON</div>
<button class="modal-close-button"><i class="fa-regular fa-circle-xmark"></i></button>
</div>
<div class="modal-content">
<textarea id="export"></textarea>
</div>
<div class="modal-footer">
<button onclick="exportToClipboard()" class="modal-ok">Copy</button>
<button onclick="closeDialog('export-dialog')" class="modal-cancel">Cancel</button>
</div>
</div>
</div>
<canvas id="canvas"></canvas>
<div id="statusbar" class="container statusbar"></div>
<script src="js/vendor/modernizr-custom.js"></script>
<script src="js/algorithms.js"></script>
<script src="js/main.js"></script>
</body>
</html>