-
Notifications
You must be signed in to change notification settings - Fork 0
/
face_vertex.html
801 lines (693 loc) · 36.4 KB
/
face_vertex.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
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="SketchAnalysis is a web application that analyzes the attributes of the 3D models available on sketchfab.com">
<meta name="author" content="">
<title>SketchAnalysis | Face&Vertices Analysis</title>
<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/sb-admin-2.min.css" rel="stylesheet">
<link href="css/w3_modal.css" rel="stylesheet">
<script src="https://d3js.org/d3.v5.min.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-168078438-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-168078438-1');
</script>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<!-- Charts-->
<link href="css/charts.css" rel="stylesheet" type="text/css">
<script src="js/charts/horizontal_bar_chart.js"></script>
<script src="js/charts/scatter_plot.js"></script>
<script src="js/charts/horizontal_bar_chart.js"></script>
<script src="js/charts/multi_scatter_plot.js"></script>
<script src="js/charts/histogram.js"></script>
<script src="js/comments.js"></script>
<link rel="stylesheet" href="css/styles.css">
</head>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar" style="position: fixed;" >
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.html">
<div class="sidebar-brand-icon rotate-n-15">
<img src="img/sk_logo.png"><br>
</div>
</a>
<div style="color: white;margin: 0 auto;font-size: 20px"><strong>SketchAnalysis</strong></div>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item - Dashboard -->
<li class="nav-item active">
<a class="nav-link" href="index.html">
<i class="fas fa-fw fa-chart-area"></i>
<span>Distributions</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="tags.html">
<i class="fas fa-fw fa-chart-area"></i>
<span>Tags Stats</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="comments.html">
<i class="fas fa-fw fa-chart-area"></i>
<span>Comments Stats</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="face_vertex.html">
<i class="fas fa-fw fa-chart-area"></i>
<span>Vertices & Faces</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="about.html">
<i class="fas fa-fw fa-info-circle"></i>
<span>About</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="comments-review.html">
<i class="fas fa-fw fa-info-circle"></i>
<span>Comments</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider d-none d-md-block">
<!-- Sidebar Toggler (Sidebar) -->
<p style="margin-left:20px;color: white;font-weight: bold">Leave a comment!
<div style="display: inline; margin-left: 3px">
<textarea id="comment" rows="4" ></textarea>
<button onclick="sendComment()">Comment</button>
</div></p>
</ul>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column" style="margin-left: 210px">
<!-- Main Content -->
<div id="content">
<!-- Begin Page Content -->
<div class="container-fluid">
<div class="w3-container">
<div id="id01" class="w3-modal" style="padding-left: 110px" >
<div class="w3-modal-content w3-card-4">
<header class="w3-container w3-teal">
<span onclick="document.getElementById('id01').style.display='none'"
class="w3-button w3-display-topright">×</span>
<h2 id="modal_t"></h2>
</header>
<div class="w3-container" style="margin-top: 10px;margin-bottom: 10px;margin-left: 50px">
<table>
<tr><td>#Views</td><td id="modal_v"></td></tr>
<tr><td>#Likes</td><td id="modal_l"></td></tr>
<tr><td>#Comments </td><td id="modal_c"></td></tr>
<tr><td>#Faces </td><td id="modal_f"></td></tr>
<tr><td>#Vertices </td><td id="modal_ve"></td></tr>
<tr><td>Date</td><td id="modal_d"></td></tr>
</table>
<br>
<a href="" id="modal_btn" class="btn_modal" target="_blank">View Model</a>
</div>
<footer class="w3-container w3-teal">
</footer>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row" style="margin-top: 15px">
<!-- Area Chart -->
<div class="col-xl-12 col-lg-12">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Summary info</h6>
</div>
<!-- Card Body -->
<div class="card-body" style="height: 100%;">
<p>Summary info about the number of vertices and faces for each category</p>
<div>
<div>Show info about Vertices<input type="radio" name="ch" style="margin-right: 15px" checked="true" value="0">
#Faces<input type="radio" name="ch" style="margin-right: 15px" value="1"></div>
<table class="table1" style=";margin-left: 30px;margin-top: 20px;margin-bottom: 20px;color: #0b0e07">
<tr>
<th>Category</th>
<th >Total</th>
<th >Average</th>
<th >SD</th>
<th >Median</th>
</tr>
<tr>
<td>Animals & Pets</td>
<td id="to_c_0" class="al-right"></td>
<td id="me_c_0" class="al-right"></td>
<td id="sd_c_0" class="al-right"></td>
<td id="med_c_0" class="al-right"></td>
</tr>
<tr>
<td>Architecture</td>
<td id="to_c_1" class="al-right"></td>
<td id="me_c_1" class="al-right"></td>
<td id="sd_c_1" class="al-right"></td>
<td id="med_c_1" class="al-right"></td>
</tr>
<tr>
<td>Art & Abstract</td>
<td id="to_c_2" class="al-right"></td>
<td id="me_c_2" class="al-right"></td>
<td id="sd_c_2" class="al-right"></td>
<td id="med_c_2" class="al-right"></td>
</tr>
<tr>
<td>Cars & vehicles</td>
<td id="to_c_3" class="al-right"></td>
<td id="me_c_3" class="al-right"></td>
<td id="sd_c_3" class="al-right"></td>
<td id="med_c_3" class="al-right"></td>
</tr>
<tr>
<td>Characters & Creatures</td>
<td id="to_c_4" class="al-right"></td>
<td id="me_c_4" class="al-right"></td>
<td id="sd_c_4" class="al-right"></td>
<td id="med_c_4" class="al-right"></td>
</tr>
<tr>
<td>Cultura Heritage & History</td>
<td id="to_c_5" class="al-right"></td>
<td id="me_c_5" class="al-right"></td>
<td id="sd_c_5" class="al-right"></td>
<td id="med_c_5" class="al-right"></td>
</tr>
<tr>
<td>Electronics & Gadgets</td>
<td id="to_c_6" class="al-right"></td>
<td id="me_c_6" class="al-right"></td>
<td id="sd_c_6" class="al-right"></td>
<td id="med_c_6" class="al-right"></td>
</tr>
<tr>
<td>Fashion & Style</td>
<td id="to_c_7" class="al-right"></td>
<td id="me_c_7" class="al-right"></td>
<td id="sd_c_7" class="al-right"></td>
<td id="med_c_7" class="al-right"></td>
</tr>
<tr>
<td>Food & Drink</td>
<td id="to_c_8" class="al-right"></td>
<td id="me_c_8" class="al-right"></td>
<td id="sd_c_8" class="al-right"></td>
<td id="med_c_8" class="al-right"></td>
</tr>
<tr>
<td>Furniture & Home</td>
<td id="to_c_9" class="al-right"></td>
<td id="me_c_9" class="al-right"></td>
<td id="sd_c_9" class="al-right"></td>
<td id="med_c_9" class="al-right"></td>
</tr>
<tr>
<td>Music</td>
<td id="to_c_10" class="al-right"></td>
<td id="me_c_10" class="al-right"></td>
<td id="sd_c_10" class="al-right"></td>
<td id="med_c_10" class="al-right"></td>
</tr>
<tr>
<td>Nature & Plants</td>
<td id="to_c_11" class="al-right"></td>
<td id="me_c_11" class="al-right"></td>
<td id="sd_c_11" class="al-right"></td>
<td id="med_c_11" class="al-right"></td>
</tr>
<tr>
<td>News & Politics</td>
<td id="to_c_12" class="al-right"></td>
<td id="me_c_12" class="al-right"></td>
<td id="sd_c_12" class="al-right"></td>
<td id="med_c_12" class="al-right"></td>
</tr>
<tr>
<td>People</td>
<td id="to_c_13" class="al-right"></td>
<td id="me_c_13" class="al-right"></td>
<td id="sd_c_13" class="al-right"></td>
<td id="med_c_13" class="al-right"></td>
</tr>
<tr>
<td>Places & Travel</td>
<td id="to_c_14" class="al-right"></td>
<td id="me_c_14" class="al-right"></td>
<td id="sd_c_14" class="al-right"></td>
<td id="med_c_14" class="al-right"></td>
</tr>
<tr>
<td>Science & Technology</td>
<td id="to_c_15" class="al-right"></td>
<td id="me_c_15" class="al-right"></td>
<td id="sd_c_15" class="al-right"></td>
<td id="med_c_15" class="al-right"></td>
</tr>
<tr>
<td>Sports & Fitness</td>
<td id="to_c_16" class="al-right"></td>
<td id="me_c_16" class="al-right"></td>
<td id="sd_c_16" class="al-right"></td>
<td id="med_c_16" class="al-right"></td>
</tr>
<tr>
<td>Weapons & Military</td>
<td id="to_c_17" class="al-right"></td>
<td id="me_c_17" class="al-right"></td>
<td id="sd_c_17" class="al-right"></td>
<td id="med_c_17" class="al-right"></td>
</tr>
</table>
<!-- <input type="checkbox" id="uniq" name="uniq"> Show unique words for the selected category-->
</div>
</div>
</div>
</div>
</div>
<br>
<div class="row" style="margin-top: 15px">
<!-- Area Chart -->
<div class="col-xl-12 col-lg-12">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Vertices & Faces Histogram
<div class='tooltip_good' style="display: inline;"> <span class='top' style="width: 500px;">
Histogram that shows the distribution of vertices and faces for each category.
<br><br>
How to:<ul>
<li>Use the radio button to switch from face to vertices distribution and vice-versa.</li>
<li>Use the drop-down list to choose the category to view the distribution of</li>
<li>Modify the number of bins/columns to visualize with the '#bins' input </li>
<li>Modify the visualized domain with the 'Min & Max' input </li>
</ul>
</span><i class="fas fa-info-circle"></i></i></div>
</h6>
</div>
<!-- Card Body -->
<div class="card-body" style="height: 770px;">
<p>Viduslize Distribution of
Vertives<input type="radio" name="dist" style="margin-right: 15px" checked="true" value="0">
Faces<input type="radio" name="dist" style="margin-right: 15px" value="1">
</p>
Category <select id="sel_cat_distr">
<option value="animals-pets">Animals & Pets</option>
<option value="architecture">Architecture</option>
<option value="art-abstract">Art & Abstract</option>
<option value="cars-vehicles">Cars & vehicles</option>
<option value="characters-creatures">Characters & Creatures</option>
<option value="cultural-heritage-history">Cultural Heritage & History</option>
<option value="electronics-gadgets">Electronics & Gadgets</option>
<option value="fashion-style">Fashion & Style</option>
<option value="food-drink">Food & Drink</option>
<option value="furniture-home">Furniture & Home</option>
<option value="music">Music</option>
<option value="nature-plants">Nature & Plants</option>
<option value="news-politics">News & Politics</option>
<option value="people">People</option>
<option value="places-travel">Places & Travel</option>
<option value="science-technology">Science & Technology</option>
<option value="sports-fitness">Sports & Fitness</option>
<option value="weapons-military">Weapons & Military</option>
</select>
<br>
<table>
<tr>
<td style="width: 100px"># bins</td>
<td><input type="number" min="1" step="10" value="20" id="nBin" style="width: 100px"></td>
</tr>
<tr>
<td>Range</td>
<td><input placeholder="Min" type="number" min="1" id="minH" value="0" style="width: 100px">
<input placeholder="Max" type="number" min="1" id="maxH" value="1000" style="width: 100px">
<button onclick="HistogramPlot()">UPDATE</button>
</td>
</tr>
</table>
<svg id="svg_1" style="width: 100%; height: 120%;" />
</div>
</div>
</div>
</div>
<div class="row" style="margin-top: 15px">
<!-- Area Chart -->
<div class="col-xl-12 col-lg-12">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Vertices & Faces ScatterPlot
<div class='tooltip_good' style="display: inline;"> <span class='top' style="width: 500px;">
Scatter-plot that visualize the correlation between the number of Vertices, Faces, Comments, Likes, and Views.<br>
For instance, for Vertices&Faces distribution, a point (x:100,y:5) states that a model with 100 vertices has 5 faces.
<br><br>
How to:
<ul>
<li>Use the checkbox to choose the category to view the distribution of. Each category has its own color used to distinguish the various dots in the graph </li>
<li>Use the three radio buttons to switch from the various distributions </li>
<li>Use the Linear and Logarithm radio button to change the scale for the X-axis</li>
</ul>
<br>
Click on the dots to see more information and visualize the model
</span><i class="fas fa-info-circle"></i></i>
</div>
</h6>
</div>
<!-- Card Body -->
<div class="card-body" id="div3" style="height: 100%; display: none">
<table>
<tr>
<td>Choose what to plot </td>
<td>#Vertices/#Faces<input type="radio" name="sc2" style="margin-right: 15px" checked="true" value="0"></td>
</tr>
<tr>
<td></td>
<td>
#Vertices/#Views<input type="radio" name="sc2" style="margin-right: 15px" value="1">
#Vertices/#Likes<input type="radio" name="sc2" style="margin-right: 15px" value="2">
#Vertices/#Comments<input type="radio" name="sc2" style="margin-right: 15px" value="3">
</td>
</tr>
<tr>
<td></td>
<td>
#Faces/#Views<input type="radio" name="sc2" style="margin-right: 15px" value="4">
#Faces/#Likes<input type="radio" name="sc2" style="margin-right: 15px" value="5">
#Faces/#Comments<input type="radio" name="sc2" style="margin-right: 15px" value="6">
</td>
</tr>
</table>
<table>
<tr>
<td><input type="checkbox" name="upSp" value="0" ><p style="color: #996633; display: inline;font-weight: bold">Animals & Pets</p></td>
<td><input type="checkbox" name="upSp" value="1"><p style="color: #000066; display: inline;font-weight: bold">Architecture</p></td>
<td><input type="checkbox" name="upSp" value="2"><p style="color: #cc0000; display: inline;font-weight: bold">Art & Abstract</p></td>
</tr>
<tr>
<td><input type="checkbox" name="upSp" value="3"><p style="color: #cc9900; display: inline;font-weight: bold">Cars & vehicles</p></td>
<td><input type="checkbox" name="upSp" value="4"><p style="color: #009933; display: inline;font-weight: bold">Characters & Creatures</p></td>
<td><input type="checkbox" name="upSp" value="5"><p style="color: #ffcc00; display: inline;font-weight: bold">Cultura Heritage & History</p></td>
</tr>
<tr>
<td><input type="checkbox" name="upSp" value="6"><p style="color: #ff66cc; display: inline;font-weight: bold">Electronics & Gadgets</p></td>
<td><input type="checkbox" name="upSp" value="7"><p style="color: #0099ff; display: inline;font-weight: bold">Fashion & Style</p></td>
<td><input type="checkbox" name="upSp" value="8"><p style="color: #669999; display: inline;font-weight: bold">Food & Drink</p></td>
</tr>
<tr>
<td><input type="checkbox" name="upSp" value="9"><p style="color: #ffccff; display: inline;font-weight: bold">Furniture & Home</p></td>
<td><input type="checkbox" name="upSp" value="10"><p style="color: #cc6600; display: inline;font-weight: bold">Music</p></td>
<td><input type="checkbox" name="upSp" value="11"><p style="color: #99ff66; display: inline;font-weight: bold">Nature & Plants</p></td>
</tr>
<tr>
<td><input type="checkbox" name="upSp" value="12"><p style="color: #b3b3ff; display: inline;font-weight: bold">News & Politics</p></td>
<td><input type="checkbox" name="upSp" value="13"><p style="color: #cc00ff; display: inline;font-weight: bold">People</p></td>
<td><input type="checkbox" name="upSp" value="14"><p style="color: #660066; display: inline;font-weight: bold">Places & Travel</p></td>
</tr>
<tr>
<td><input type="checkbox" name="upSp" value="15"><p style="color: #000033; display: inline;font-weight: bold">Science & Technology</p></td>
<td><input type="checkbox" name="upSp" value="16"><p style="color: #737373; display: inline;font-weight: bold">Sports & Fitness</p></td>
<td><input type="checkbox" name="upSp" value="17"><p style="color: #725bb0; display: inline;font-weight: bold">Weapons & Military</p></td>
</tr>
</table>
<br>
<div style="display: inline;margin-top: 10px; font-weight: bold">Choose the scale:</div>
<input type="radio" name="Scale1" value="0" style="margin-left: 10px" checked>Linear
<input type="radio" name="Scale1" value="1" style="margin-left: 10px">Logarithm(log<sub>10</sub>)
<svg id="svg_2" style="width: 100%; height: 120%;" />
</div>
</div>
</div>
</div>
<footer class="sticky-footer bg-white">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Developed By Vito Ferrulli</span>
</div>
</div>
</footer>
</div>
<!-- End of Content Wrapper -->
</div>
</div>
</div>
<script>
var table_data = null;
var scatter_data = null;
var mulyi_scatter_data = null;
var multi_scatter_index = [];
var table_data_prc = null;
var total_vertices = 0;
var total_faces = 0;
$( document ).ready(function() {
getData();
getScatterData("animals-pets",0);
getMultiScatte2Data();
});
function getData() {
$.ajax({
url: "php/get_vertex&face_info.php",
type: 'GET',
dataType: "json",
success: function(data) {
table_data = data;
for(var i=0;i<data.length;i++){
total_vertices += parseInt(data[i][6]);
total_faces += parseInt(data[i][7]);
}
showTable();
plotStackedBC();
},
error: function(error) {
console.log("Error:"+error);
},
});
}
function plotStackedBC(){
console.log(table_data)
/*stacked_data = [];
for (var k=0; k<stacked_data_save.length; k++){
stacked_data.push({Category: stacked_data_save[k].Category});
if(STC_M)
stacked_data[k].models = stacked_data_save[k].models
if(STC_V)
stacked_data[k].views = stacked_data_save[k].views
if(STC_L)
stacked_data[k].likes = stacked_data_save[k].likes
if(STC_C)
stacked_data[k].comments = stacked_data_save[k].comments
}*/
}
$('input[type=radio][name=dist]').change(function() {
var cat = $('#sel_cat_distr').val();
var type = $('input[type=radio][name=dist]:checked').val();
getScatterData(cat,type);
});
$('#sel_cat_distr').change(function() {
var cat = $('#sel_cat_distr').val();
var type = $('input[type=radio][name=dist]:checked').val();
getScatterData(cat,type);
});
function getScatterData(cat,type){
$.ajax({
url: "php/get_vertex&face_distribution.php?cat="+cat+"&type="+type,
type: 'GET',
dataType: "json",
success: function(data) {
scatter_data = data;
HistogramPlot();
},
error: function(error) {
console.log("Error:"+error);
},
});
}
$('input[type=radio][name=ch]').change(function() {showTable();});$('input[type=radio][name=ch]').change(function() {showTable();});
function showTable() {
var type = parseInt($('input[type=radio][name=ch]:checked').val());
type = type==1 ? 0 : 3;
var max_md = 0;
var max_sd = 0;
var max_med = 0;
var max_prc = 0;
var total = type==0 ? total_vertices : total_faces;
var total_index = type==0 ? 6 : 7;
for(var i=0; i<table_data.length; i++){
var prc = ((100/total)*table_data[i][total_index]).toFixed(2);
$("#to_c_"+i).html("("+prc+"%) <div class='tooltip_good'> <span class='top'>(%)"+table_data[i][total_index]+"</span>"+intToString(parseInt(table_data[i][total_index]))+"</div>");
$("#me_c_"+i).html("<div class='tooltip_good'> <span class='top'>(%)"+table_data[i][type]+"</span>"+intToString(parseInt(table_data[i][type]))+"</div>");
$("#sd_c_"+i).html("<div class='tooltip_good'> <span class='top'>"+table_data[i][type+1]+"</span>"+intToString(parseInt(table_data[i][type+1]))+"</div>");
$("#med_c_"+i).html("<div class='tooltip_good'> <span class='top'>"+table_data[i][type+2]+"</span>"+intToString(parseInt(table_data[i][type+2]))+"</div>");
if(parseInt(table_data[i][type])>max_md)
max_md = parseInt(table_data[i][type])
if(parseInt(table_data[i][type+1])>max_sd)
max_sd = parseInt(table_data[i][type+1])
if(parseInt(table_data[i][type+2])>max_med)
max_med = parseInt(table_data[i][type+2])
if(parseInt(table_data[i][total_index])>max_prc)
max_prc = parseInt(table_data[i][total_index])
}
for(var k=0; k<table_data.length; k++){
var op_to = ((100/max_prc)*parseInt(table_data[k][total_index])).toFixed(2);
var op_md = ((100/max_md)*parseInt(table_data[k][type])).toFixed(2);
var op_sd = ((100/max_sd)*parseInt(table_data[k][type+1])).toFixed(2);
if(max_med == 0)
var op_med = 50
else
var op_med = ((100/max_med)*parseInt(table_data[k][type+2])).toFixed(2);
$("#to_c_"+k).css("background", "rgba(230, 115, 0, "+op_to+"%)")
$("#me_c_"+k).css("background", "rgba(230, 115, 0, "+op_md+"%)")
$("#sd_c_"+k).css("background", "rgba(230, 0, 0, "+op_sd+"%)")
$("#med_c_"+k).css("background", "rgba(230, 115, 0, "+op_med+"%)")
}
}
function HistogramPlot(){
var min = parseInt($("#minH").val())
var max = parseInt($("#maxH").val())
var nBin = parseInt($("#nBin").val())
var data = [];
for(var i=0; i<scatter_data.length; i++){
var element = scatter_data[i];
if(parseInt(element[0])>=min && parseInt(element[0])<=max){
for(var k=0; k<parseInt(element[1]); k++){
data.push({value: parseInt(element[0])});
}
}
}
var xlable = "Vertices Bins"
if($('input[type=radio][name=dist]:checked').val() == "1")
xlable = "Faces Bins"
console.log(data)
$("#svg_1") .empty();
plotHistogram("svg_1",data,min,max,nBin,"#OCCURRENCES",xlable)
}
function intToString (value) {
var suffixes = ["", "K", "M", "B","T"];
var suffixNum = Math.floor((""+value).length/3);
var shortValue = parseFloat((suffixNum != 0 ? (value / Math.pow(1000,suffixNum)) : value).toPrecision(2));
if (shortValue % 1 != 0) {
shortValue = shortValue.toFixed(1);
}
return shortValue+suffixes[suffixNum];
}
function getMultiScatte2Data(){
$.ajax({
//url: "php/get_vertex&face_data.php?",
url: "js/data/data_multi_index_fe.txt",
type: 'GET',
dataType: "json",
success: function(data) {
mulyi_scatter_data = data;
plotMultiScatterDistribution();
$("#div3").show();
},
error: function(error) {
console.log("Error:"+error);
},
});
}
$('input[type=checkbox][name=upSp]').change(function() {
if(this.checked)
multi_scatter_index.push(parseInt(this.value))
else{
var index = multi_scatter_index.indexOf(parseInt(this.value));
if (index !== -1) multi_scatter_index.splice(index, 1);
}
plotMultiScatterDistribution();
});
$('input[type=radio][name=sc2]').change(function() { plotMultiScatterDistribution()});
$('input[type=radio][name=Scale1]').change(function() {plotMultiScatterDistribution()});
function plotMultiScatterDistribution(){
//[0]url - [1]name - [2]date - [3]-likeCount - [4]viewCount - [5]commentCount - [6]vertexCount - [7]faceCount
var type = parseInt($('input[type=radio][name=sc2]:checked').val());
var scale = $('input[type=radio][name=Scale1]:checked').val()=="0" ? "linear" : "log"
var data = []
var c = 0;
var x,y,xLabel,yLabel;
if(type==0){
x=6;
y=7;
xLabel = "#Vertices"
yLabel = "#Faces"
}else if(type==1){
x=6;
y=4;
xLabel = "#Vertices"
yLabel = "#Views"
}else if(type==2){
x=6;
y=3;
xLabel = "#Vertices"
yLabel = "#Likes"
}else if(type==3){
x=6;
y=5;
xLabel = "#Vertices"
yLabel = "#Comments"
}else if(type==4){
x=7;
y=4;
xLabel = "#Faces"
yLabel = "#Views"
}else if(type==5){
x=7;
y=3;
xLabel = "#Faces"
yLabel = "#Likes"
}else if(type==6){
x=7;
y=5;
xLabel = "#Faces"
yLabel = "#Comments"
}
var colors = ["#996633","#000066","#cc0000","#cc9900","#009933","#ffcc00","#ff66cc","#0099ff",
"#669999","#ffccff","#cc6600","#99ff66","#b3b3ff","#cc00ff","#660066","#000033","#737373","#725bb0"]
for(var i=0; i<multi_scatter_index.length; i++){
var index = multi_scatter_index[i];
var temp_data = mulyi_scatter_data[index];
for(var k=0; k<temp_data.length; k++){
if(parseInt(temp_data[k][x])>0 || scale=="linear"){
data[c] = new Array(3)
data[c][0] = temp_data[k][x];
data[c][1] = temp_data[k][y];
data[c][2] = colors[index];
data[c][3] = index.toString()+"@"+k.toString()
c++;
}
}
}
$("#svg_2").empty()
multi_scatter_plot("svg_2",data,xLabel,yLabel,null,null,scale)
}
function shomodelInfo(v){
var indexes = v.split("@");
var temp = mulyi_scatter_data[parseInt(indexes[0])];
var k = parseInt(indexes[1]);
//[0]url - [1]name - [2]date - [3]-likeCount - [4]viewCount - [5]commentCount - [6]vertexCount - [7]faceCount
$("#modal_t").text(temp[k][1]);
$("#modal_v").text(temp[k][4]);
$("#modal_l").text(temp[k][3]);
$("#modal_c").text(temp[k][5]);
$("#modal_d").text(temp[k][2]);
$("#modal_f").text(temp[k][7]);
$("#modal_ve").text(temp[k][6]);
$("#modal_btn").attr("href", temp[k][0]);
//$("#modal_src").attr("src", scatter_data[k][4]);
document.getElementById('id01').style.display='block';
}
</script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin-2.min.js"></script>
</body>
</html>