Repository navigation
Expand file tree
/
Copy pathview.php
More file actions
308 lines (208 loc) · 7.43 KB
/
Copy pathview.php
File metadata and controls
308 lines (208 loc) · 7.43 KB
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?php include "logic.php"; ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Graph Splitter | Regression Testing</title>
<!--STYLESHEET-->
<!--=================================================-->
<!--Bootstrap Stylesheet [ REQUIRED ]-->
<link href="v2.2/css/bootstrap.min.css" rel="stylesheet">
<!--Nifty Stylesheet [ REQUIRED ]-->
<link href="v2.2/css/nifty.min.css" rel="stylesheet">
<!--Demo [ DEMONSTRATION ]-->
<link href="v2.2/css/demo/nifty-demo.min.css" rel="stylesheet">
<!--SCRIPT-->
<!--=================================================-->
<!--Page Load Progress Bar [ OPTIONAL ]-->
<link href="v2.2/plugins/pace/pace.min.css" rel="stylesheet">
<script src="v2.2/plugins/pace/pace.min.js"></script>
<!--
REQUIRED
You must include this in your project.
RECOMMENDED
This category must be included but you may modify which plugins or components which should be included in your project.
OPTIONAL
Optional plugins. You may choose whether to include it in your project or not.
DEMONSTRATION
This is to be removed, used for demonstration purposes only. This category must not be included in your project.
SAMPLE
Some script samples which explain how to initialize plugins or components. This category should not be included in your project.
Detailed information and more samples can be found in the document.
-->
</head>
<!--TIPS-->
<!--You may remove all ID or Class names which contain "demo-", they are only used for demonstration. -->
<body>
<div id="container" class="effect mainnav-lg">
<!--NAVBAR-->
<!--===================================================-->
<header id="navbar">
<div id="navbar-container">
<!--Brand logo & name-->
<!--================================-->
<div class="navbar-header">
<a href="#" class="navbar-brand">
<div class="brand-title">
<span class="brand-text">Graph Splitter</span>
</div>
</a>
</div>
<!--================================-->
<!--End brand logo & name-->
<!--Navbar Dropdown-->
<!--================================-->
<div class="navbar-content clearfix">
<ul class="nav navbar-top-links pull-left">
</ul>
<ul class="nav navbar-top-links pull-right">
</ul>
</div>
<!--================================-->
<!--End Navbar Dropdown-->
</div>
</header>
<!--===================================================-->
<!--END NAVBAR-->
<div class="boxed">
<!--CONTENT CONTAINER-->
<!--===================================================-->
<div id="">
<!--Page Title-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div id="page-title">
<h1 class="page-header text-overflow">Write down code</h1>
</div>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--End page title-->
<!--Page content-->
<!--===================================================-->
<div class="row">
<div class="col-lg-5 col-md-5 col-lg-offset-1 col-md-offset-1">
<div class="panel">
<div class="panel-heading">
<h3 class="panel-title">Code Text Area</h3>
</div>
<!--No Label Form-->
<!--===================================================-->
<form class="form-horizontal" method="POST">
<div class="panel-body">
<textarea placeholder="Enter your code" name = "text_form" rows="22" class="form-control">
</textarea>
</div>
<div class="panel-footer text-right">
<input type = "submit" class="btn btn-primary" name ="submit" value="Submit" />
</div>
</form>
<!--===================================================-->
<!--End No Label Form-->
</div>
</div>
<div class="col-lg-5 col-md-5">
<div class="panel" style="min-height: 555px;">
<div class="panel-heading">
<h3 class="panel-title">Formed Graph</h3>
</div>
<div class="panel-body">
<div id="cy"></div>
</div>
</div>
</div>
</div>
<!--===================================================-->
<!--End page content-->
</div>
<!--===================================================-->
<!--END CONTENT CONTAINER-->
</div>
<!-- FOOTER -->
<!-- SCROLL TOP BUTTON -->
<!--===================================================-->
<button id="scroll-top" class="btn"><i class="fa fa-chevron-up"></i></button>
<!--===================================================-->
</div>
<!--===================================================-->
<!-- END OF CONTAINER -->
<!--JAVASCRIPT-->
<!--=================================================-->
<!--jQuery [ REQUIRED ]-->
<script src="v2.2/js/jquery-2.1.1.min.js"></script>
<!--BootstrapJS [ RECOMMENDED ]-->
<script src="v2.2/js/bootstrap.min.js"></script>
<!--Nifty Admin [ RECOMMENDED ]-->
<script src="v2.2/js/nifty.min.js"></script>
<!--Demo script [ DEMONSTRATION ]-->
<script src="v2.2/js/demo/nifty-demo.min.js"></script>
<!--Form Component [ SAMPLE ]-->
<script src="v2.2/js/demo/form-component.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cytoscape.github.io/cytoscape.js/api/cytoscape.js-latest/cytoscape.min.js"></script>
<!--
REQUIRED
You must include this in your project.
RECOMMENDED
This category must be included but you may modify which plugins or components which should be included in your project.
OPTIONAL
Optional plugins. You may choose whether to include it in your project or not.
DEMONSTRATION
This is to be removed, used for demonstration purposes only. This category must not be included in your project.
SAMPLE
Some script samples which explain how to initialize plugins or components. This category should not be included in your project.
Detailed information and more samples can be found in the document.
-->
<script type="text/javascript">
$(function(){ // on dom ready
$('#cy').cytoscape({
style: cytoscape.stylesheet()
.selector('node')
.css({
'content': 'data(id)'
})
.selector('edge')
.css({
'target-arrow-shape': 'triangle',
'width': 4,
'line-color': '#ddd',
'target-arrow-color': '#ddd'
})
.selector('.highlighted')
.css({
'background-color': '#61bffc',
'line-color': '#61bffc',
'target-arrow-color': '#61bffc',
'transition-property': 'background-color, line-color, target-arrow-color',
'transition-duration': '0.5s'
}),
elements: <?
echo "{'nodes':" . json_encode( $nodesArray).
",'edges':". json_encode($edgesArray)."}";
?>,
layout: {
name: 'breadthfirst',
directed: true,
roots: '#a',
padding: 5
},
ready: function(){
window.cy = this;
var dijkstra = cy.elements().dijkstra('#f',function(){
return this.data('weight');
},false);
var bfs = dijkstra.pathTo( cy.$('#i') );
var x=0;
var highlightNextEle = function(){
var el=bfs[x];
el.addClass('highlighted');
if(x<bfs.length){
x++;
setTimeout(highlightNextEle, 500);
}
};
highlightNextEle();
}
});
});
</script>
</body>
</html>