-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
executable file
·220 lines (209 loc) · 12.3 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
213
214
215
216
217
218
219
220
<!DOCTYPE HTML>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dijkstra Explorer</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" media="all" href="assets/bootstrap-3.3.4/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" media="all" href="assets/bootstrap-3.3.4/css/bootstrap-docs.min.css"/>
<link rel="stylesheet" type="text/css" media="all" href="assets/stylesheets/style.css"/>
<link rel="stylesheet" type="text/css" media="all" href="assets/stylesheets/svg.css"/>
<script type="text/javascript" src="assets/javascripts/jquery-1.9.1.js"></script>
<script type="text/javascript" src="assets/bootstrap-3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/javascripts/d3.v3.min.js"></script>
<script type="text/javascript" src="assets/javascripts/sp.js"></script>
<script type="text/javascript" src="assets/javascripts/sp.ui.js"></script>
<script>
$(function() {
sp.setGraph("#graph");
sp.init();
});
</script>
</head>
<body>
<div class="container">
<div class="row">
<div class="page-header col-md-12">
<h2>
<span class="glyphicon glyphicon-road" aria-hidden="true"></span>
Dijkstra Explorer
</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="log well lead">
<span> </span>
<span id="info"></span>
</div>
</div>
</div>
<div class="row">
<div role="tabpanel">
<span class="form-inline pull-right">
<!-- load up example data -->
<div class="input-group">
<button id="load-example" class="btn btn-info" type="button" >
<span class="glyphicon glyphicon-education" aria-hidden="true"></span> Load Example
</button>
</div>
<!-- change map pin/node radius -->
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">
<span class="glyphicon glyphicon-pushpin" aria-hidden="true"></span>
</span>
<input class="form-control" type="number" min="10" max="50" id="node-radius" name="node-radius">
</div>
<!-- change background image (url) -->
<form id="graph-bg-url-form" class="form-inline">
<div class="input-group">
<span id="graph-bg-url-button" class="input-group-addon" id="basic-addon1">
<span class="glyphicon glyphicon-globe" aria-hidden="true"></span>
</span>
<input id="graph-bg-url-chooser" class="form-control" type="text" name="graph-bg-url-chooser" placeholder="background image url" >
</div>
</form>
<!-- change background image (file) -->
<div class="input-group">
<span id="graph-bg-file-button" class="input-group-addon" id="basic-addon1">
<span class="glyphicon glyphicon-open-file" aria-hidden="true"></span>
</span>
<input id="graph-bg-file-chooser" class="form-control hidden" type="file" name="graph-bg-file" enctype="multipart/form-data">
<input id="graph-bg-filename" class="form-control" type="text" placeholder="background image file" readonly="">
</div>
</span>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#graph-tab" id="graph-tab-trigger" aria-controls="home" role="tab" data-toggle="tab">
Graph
</a>
</li>
<li role="presentation">
<a href="#data-tab" id="data-tab-trigger" aria-controls="profile" role="tab" data-toggle="tab">
Data
</a>
</li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="graph-tab">
<div class="de-container">
<div class="row">
<div class="col-md-3">
<div class="well">
<h4>Find Path</h4>
<form>
<div class="form-group form-inline">
<label class="control-label bg-success" for="from">from</label>
<select id="from" class="form-control"></select>
</div>
<div class="form-group form-inline">
<label class="control-label bg-success" for="to">to</label>
<select id="to" class="form-control"></select>
</div>
<div class="form-group btn-group">
<button
type="button" class="clear-graph btn btn-warning"
data-toggle="tooltip" data-placement="right"
title="clear the graph">clear</button>
<button type="button" class="route btn btn-primary"
data-toggle="tooltip" data-placement="right"
title="find shortest path between nodes">route</button>
</div>
</form>
</div>
<div class="results well">
<h4>Graph Data</h4>
<table class="table">
<tr>
<th class="info">nodes</th>
<td id="node-count">-</td>
</tr>
<tr>
<th class="info">paths</th>
<td id="path-count">-</td>
</tr>
<tr role="separator" class="divider">
<th></th><td></td>
</tr>
<tr>
<th class="info">width</th>
<td id="svg-width">-</td>
</tr>
<tr>
<th class="info">height</th>
<td id="svg-height">-</td>
</tr>
</table>
</div>
<div class="results well">
<h4>Results</h4>
<div id="results"></div>
</div>
<div class="well">
<h4>Instructions</h4>
<p>
Double-click graph to add a node<br/>
Drag nodes to reposition them<br/>
Right-click on one node then right-click on another to link them<br/>
</p>
</div>
</div>
<div class="col-md-9">
<div class="panel panel-default">
<div id="graph-container" class="panel-body">
<div id="graph"></div>
</div>
</div>
</div>
</div>
</div><!-- /container -->
</div><!-- / graph tabpanel -->
<div role="tabpanel" class="tab-pane" id="data-tab">
<div class="de-container">
<div class="row">
<div class="col-md-12">
<div class="bs-callout borderless">
<span class="form-inline pull-right">
<!-- export data button -->
<div class="input-group">
<button id="export-data-button" class="btn btn-primary" type="button" >
<span class="glyphicon glyphicon-export" aria-hidden="true"></span> Export Data
</button>
</div>
<!-- import data button -->
<div class="input-group">
<button id="import-data-button" class="btn btn-warning" type="button" >
<span class="glyphicon glyphicon-import" aria-hidden="true"></span> Import Data
</button>
<input id="import-data-file-chooser" class="form-control hidden" type="file" name="import-data-file" enctype="multipart/form-data">
</div>
</span>
</div>
<div class="well">
<h4>Graph Nodes</h4>
<div id="nodes-table"></div>
</div>
<div class="well">
<h4>Paths Between Nodes</h4>
<div id="paths-table"></div>
</div>
<div class="well">
<h4>Distances Between Nodes</h4>
<div id="distances-table"></div>
</div>
</div>
</div>
</div>
</div><!-- / data tabpanel -->
</div><!-- /.tab-content -->
</div><!-- /tabpanel -->
</div><!-- /rows -->
</div><!-- /container -->
<footer class="footer">
<div class="panel-footer text-center">
<p>Want the code? <a href="https://github.com/julianbrowne/dijkstra-explorer">https://github.com/julianbrowne/dijkstra-explorer</a></p>
</div>
</footer>
</body>
</html>