annotate index.html @ 3:d006eeb10183 draft

modified traverse checkbox
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Wed, 20 Mar 2013 02:43:10 +0900
parents e90546bb87e4
children 810e406abb71
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <meta http-equiv="content-type" content="text/html;charset=utf-8" />
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 <title>Graph Display</title>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 <link rel='stylesheet' href="css/viewer_form.css">
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 <script type="text/javascript" src="js/lib/jquery-1.8.1-min.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 <script type="text/javascript" src="js/lib/jquery-ui-1.8.23-min.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 <script type="text/javascript" src="js/lib/jquery.ui.touch-punch.min.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 <script type="text/javascript" src="js/lib/jsBezier-0.4-min.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 <script type="text/javascript" src="js/1.3.15/jsPlumb-util-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 <script type="text/javascript" src="js/1.3.15/jsPlumb-dom-adapter-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 <script type="text/javascript" src="js/1.3.15/jsPlumb-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 <script type="text/javascript" src="js/1.3.15/jsPlumb-defaults-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-svg-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-canvas-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 <script type="text/javascript" src="js/1.3.15/jsPlumb-renderers-vml-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 <script type="text/javascript" src="js/1.3.15/jquery.jsPlumb-1.3.15-RC1.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 <script type="text/javascript" src="js/1.3.15/jquery.jsPlumb-1.3.15-all-min.js"></script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
18 <div id="traverseDisplay" style='position:fixed; width:250px; height:250px; border:solid 1px; border-radius:5px; opacity:1; z-index:10; visibility:visible;'>
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
19 <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.7;'></div>
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
20 <div id="closeTraverseDisplay" style='position:absolute; right:5; top:-3; z-index:10; color:white;' onclick="$('#traverseDisplay').css('visibility','hidden');" onmouseover="$('#closeTraverseDisplay').css('color','yellow');" onmouseout="$('#closeTraverseDisplay').css('color','white')" >CLOSE</div>
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
21 <div style='position:absolute; width:90%; height:90%;'>
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
22 <div style='position:absolute; left:5%; top:5%; width:100%; height:100%; background:white;'>
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
23 <div id="traverseDisplayTitle" style='position:absolute; left:10px; top:5px; font-size:24px; width:100%; text-align:left;'>
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
24 Traverse
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
25 </div>
3
d006eeb10183 modified traverse checkbox
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
26 <div style='position:absolute; top:30px; width:100%; margin-left:10px;'> Direction:
d006eeb10183 modified traverse checkbox
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
27 <label id="direction_in" style='position:relative' ><input type='checkbox' checked value='in'/>IN</label>
d006eeb10183 modified traverse checkbox
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
28 <label id="direction_out" style='position:relative;'><input type='checkbox' checked value='out'/>OUT</label>
d006eeb10183 modified traverse checkbox
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
29 </div>
d006eeb10183 modified traverse checkbox
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 2
diff changeset
30 <div id="taverseDisplayBody" style='position:absolute; left:20px; top:50px;'>
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
31 </div>
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
32 </div>
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
33 </div>
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
34 <span class='button display' style='position:absolute; width:100; left:75; bottom:5; opacity:1;'>traverse</span>
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
35 </div>
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
37 <div id="miniDisplay" style='position:fixed; width:250px; height:250px; border:solid 1px; border-radius:5px; opacity:0.5; z-index:10; visibility:visible;'>
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
38 <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.5;'></div>
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 <div id="closeMiniDisplay" style='position:absolute; right:5; top:-3; z-index:10; color:white;' onclick="$('#miniDisplay').css('visibility','hidden');" onmouseover="$('#closeMiniDisplay').css('color','yellow');" onmouseout="$('#closeMiniDisplay').css('color','white')" >CLOSE</div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 <div style='position:absolute; width:90%; height:90%;'>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 <div style='position:absolute; left:5%; top:5%; width:100%; height:100%; background:white;'>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 <div id="miniDisplayTitle" style='position:absolute; left:10px; top:5px; font-size:24px; width:100%; text-align:left;'>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 </div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 <div id="miniDisplayBody" style='position:absolute; left:20px; top:40px;'>
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
45 Please click any node.
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 </div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 </div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 </div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 </div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 <div class="graphMainCss" style="position:absolute; left:0; bottom:0; width:100%; height:75%;" id='graphMain'>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 <div style="position:absolute; width:0; height:0;left:0;" id='graphRoot'>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 </div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 </div>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
56
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 <script type="text/javascript">
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 if(!Array.prototype.filter){
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 Array.prototype.filter=function(func){
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 var arr=[];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 for(var i=0;i<this.length;i++)if(func(this[i]))arr.push(this[i]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 return arr;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 function loadUserList() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 $.ajax({
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 url:BASE_URL + "/users/all",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 success:function(o) { userList = o.sort(); showUserList([]); },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 type:"GET", cache:false,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 error:function(o) { console.log("loadUserList error : ",o); }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 });
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 function beginScript() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 DragHandler.attach($('#miniDisplay')[0]);
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
77 DragHandler.attach($('#traverseDisplay')[0]);
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 var DragHandler = {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 _oElem : null,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 attach : function(oElem) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 oElem.onmousedown = DragHandler._dragBegin;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 return oElem;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 _dragBegin : function(e) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 var oElem = DragHandler._oElem = this;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 if (isNaN(parseInt(oElem.style.left))) { oElem.style.left = '0px'; }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 if (isNaN(parseInt(oElem.style.top))) { oElem.style.top = '0px'; }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 var x = parseInt(oElem.style.left);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 var y = parseInt(oElem.style.top);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 e = e ? e : window.event;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 oElem.mouseX = e.clientX;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 oElem.mouseY = e.clientY;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 document.onmousemove = DragHandler._drag;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 document.onmouseup = DragHandler._dragEnd;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 return false;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 _drag : function(e) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 var oElem = DragHandler._oElem;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 var x = parseInt(oElem.style.left);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 var y = parseInt(oElem.style.top);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 e = e ? e : window.event;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 oElem.style.left = x + (e.clientX - oElem.mouseX) + 'px';
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 oElem.style.top = y + (e.clientY - oElem.mouseY) + 'px';
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 oElem.mouseX = e.clientX;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 oElem.mouseY = e.clientY;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 return false;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 _dragEnd : function() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 var oElem = DragHandler._oElem;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 var x = parseInt(oElem.style.left);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 var y = parseInt(oElem.style.top);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 document.onmousemove = null;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 document.onmouseup = null;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 DragHandler._oElem = null;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 };
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 function addLoadEvent(func) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 var oldonload = window.onload;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 if (typeof window.onload != 'function') {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 window.onload = func;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 } else {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 window.onload = function() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 if (oldonload) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 oldonload();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 func();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 addLoadEvent(function() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 beginScript();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 });
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 function writeMiniDisplay(title,str) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 $('#miniDisplayBody')[0].innerHTML = str;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 if(title) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 $('#miniDisplayTitle')[0].innerHTML = title;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 function writeJSONDataToMiniDisplay(jsonObj) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 var str = "";
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 for (var key in jsonObj.property) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 str = str + key + ": "+ jsonObj.property[key] + "<br>";
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 writeMiniDisplay(jsonObj.property.title, str);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 }
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
153
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
154 function createDirectionView() {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
155
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
156 }
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
157
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
158 function createTraverseView() {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
159
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
160 }
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
161
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
162 function writeEdgeInfotraverseDisplay(node) {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
163 var id = node.property.id;
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
164 var edgeInfo = node.edgeInfo;
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
165 var str = "";
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
166 var info = {};
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
167 for (var i=0; i<edgeInfo.length; i++) {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
168 var kind = edgeInfo[i].kind;
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
169 var dir = edgeInfo[i].direction;
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
170 var num = edgeInfo[i].num;
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
171 info[kind][dir] = num;
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
172 }
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
173
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
174
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
175 }
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
176
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
177 function createTraverseDisplayInfo(info) {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
178
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
179
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
180 }
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 function init() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 jsPlumb.importDefaults({
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 Connector : [ "Straight", { curviness:50 } ],
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 PaintStyle : { strokeStyle:"gray", lineWidth:2 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 EndpointStyle : {},
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 Anchors: ["BottomCenter","TopCenter"],
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 });
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 var rootDiv = $('#graphMain');
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 var rootLeft = rootDiv.offset().left;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 var rootTop = rootDiv.offset().top;
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
192 $('#traverseDisplay').css( {
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 left: rootLeft,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 top: rootTop
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 });
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
196 var heightStr = $('#traverseDisplay').css('height').split('px')[0];
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
197 var height = parseInt(heightStr);
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
198 $('#miniDisplay').css( {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
199 left: rootLeft,
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
200 top: rootTop + height + 50
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
201 });
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 function createLabelStr(value) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 return "<label class='relation'><input class='relation_input' type='checkbox' checked value='"+value+"'>"+value+"</label>";
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
208 function showMiniDisplay(node) {
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 $("#miniDisplay").css("visibility", "visible");
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
210 $("#traverseDisplay").css("visibility", "visible");
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
211 writeJSONDataToMiniDisplay(node);
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
212 if (node.edgeInfo) {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
213 if (!node.traverse) {
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
214 writeEdgeInfotraverseDisplay(node);
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
215 }
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
216 showEdgeInfoTraverseDisplay(node);
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
217 }
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 var nodeNum = 0;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 var OFFSET = 100;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 var miniD = $('#miniDisplay')[0].style;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 var offsetLeft = parseInt(miniD.width.split('px')[0]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 var offsetTop = parseInt(miniD.height.split('px')[0]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 function calcNewNodePosition() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 var position = {};
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
227 position = {x: nodeNum*OFFSET + offsetLeft, y: nodeNum*OFFSET + offsetTop / 3};
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 nodeNum++;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 return position;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 /*
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 *
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 */
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 function clickNodeDiv(id) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 var graphData = GRAPH_DATA;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 var node = graphData.nodes[id];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 var inputDivs = $('.relation_input');
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 var rels = {evidence:1,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 dependency:1,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 derived:1,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 version:1,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 agreement:1};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 showRelationNodes(graphData, node, rels);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 function returnCheckdRelation() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 function createNodeDiv(node) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 node.view = $("<div class='graphNode'/>");
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 node.view.click(function(){ clickNodeDiv(node.property.id) });
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 if(!node.position) node.position = calcNewNodePosition();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 node.view.hover();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 var div = $("<div class='graphNodeContent' />")[0];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 div.innerHTML = node.property.title;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 node.view[0].appendChild(div);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 return node;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 function updateNodeElement(node) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 var created = false;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 if(!node.view) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 created = true;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 createNodeDiv(node);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 var div = node.view;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 // div.text(node.property.title);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 div.click(function(){showMiniDisplay(node)});
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 DragHandler.attach($(node.view)[0]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 var kindBackground = {agree:"#aaf", rejected:"#fff"};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 var kindBorder = {agree:"#66a", rejected:"#a66"};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 div.css("background", kindBackground[node.kind]||"white");
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 div.css("border-color", kindBorder[node.kind] ||"#58f");
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 div.css({
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 left: node.position.x,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 top: node.position.y
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 });
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 return created;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 function updateNode(node) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 if(updateNodeElement(node)) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 var fc = $('#graphRoot')[0].firstChild;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 if(fc) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 $('#graphRoot')[0].insertBefore(node.view[0], fc);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 } else {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 $('#graphRoot').append(node.view);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 var ViewParam = {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 offsetTop:100,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 offsetBottom:100,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 offsetLeft:100,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 offsetRight:100,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 nodeWidth:120,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 nodeHeight:60,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 intervalX:140,
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 intervalY:120
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 };
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 function Edge(fromNode, toNode, relation) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 var obj = {from:fromNode, to:toNode, rel:relation };
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 return obj;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 var arrowConnector = {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 connector:"StateMachine",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 // paintStyle:{lineWidth:3,strokeStyle:"#056"},
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 paintStyle:{lineWidth:2,strokeStyle:"#aaf"},
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317 hoverPaintStyle:{strokeStyle:"#dbe300"},
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 endpoint:"Blank",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 anchor:"Continuous",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 overlays:[ ["PlainArrow", {location:1, width:20, length:12} ]]
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 };
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 var arrowBothConnector = {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 connector:"StateMachine",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 paintStyle:{lineWidth:2,strokeStyle:"#aaf"},
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 hoverPaintStyle:{strokeStyle:"#dbe300"},
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 endpoint:"Blank",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 };
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 function GraphData() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 var graphData = {};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 graphData.nodes = {};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 graphData.edges = {};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 return graphData;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 function parseJSONGraphData(memory ,jsonObj) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 var nodes = jsonObj.nodes;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 for (var i=0; i<nodes.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 var node = nodes[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 memory.nodes[node.id] = {};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 memory.nodes[node.id].in = [];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 memory.nodes[node.id].out = [];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 memory.nodes[node.id].both = [];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 memory.nodes[node.id].property = node;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 var edges = jsonObj.edges;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 for (var i=0; i<edges.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 var edge = edges[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 var edgeId = edge.id;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 memory.edges[edgeId] = {};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 memory.edges[edgeId].property = edge;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 if (edge.kind == "both") {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 memory.nodes[edge.from].both.push(edgeId);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 memory.nodes[edge.to].both.push(edgeId);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 } else {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 memory.nodes[edge.from].out.push(edgeId);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 memory.nodes[edge.to].in.push(edgeId);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 return memory;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 function showEdge(graphData, edge) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 function connectEdge(fromNode, toNode, rel, type) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 var c;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 if (type == 'both') {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 c = jsPlumb.connect({source:fromNode.view[0], target:toNode.view[0]}, arrowBothConnector);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 } else {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 c = jsPlumb.connect({source:fromNode.view[0], target:toNode.view[0]}, arrowConnector);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 // jsPlumb.select({source:fromNode.view[0]}).removeAllOverlays();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 c.setLabel({label:"<span style='color:#129; font-size:1.5em;'>"+rel+"</span>",cssStyle:""});
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374 return c;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 if (edge.visible) return;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 var fromNode = graphData.nodes[edge.property.from];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
378 var toNode = graphData.nodes[edge.property.to];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
379 if (!fromNode.view && !toNode.view) return;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
380 var rel = edge.property.rel;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 var type = edge.property.type;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
382 connectEdge(fromNode, toNode, rel, type);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 edge.visible = true;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
384 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
385
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 function createNodeFromEdge(graphData, edge, baseNode) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 if(edge.visible) return;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388 var fromNode = graphData.nodes[edge.property.from];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 if (!fromNode.view) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 updateNode(fromNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 var toNode = graphData.nodes[edge.property.to];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 if (!toNode.view) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 updateNode(toNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 showEdge(graphData, edge);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 function getRelationEdgeIds(node) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 var edgeIds = [];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401 for (var i=0; i<node.in.length; i++) edgeIds.push(node.in[i]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 for (var i=0; i<node.out.length; i++) edgeIds.push(node.out[i]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 for (var i=0; i<node.both.length; i++) edgeIds.push(node.both[i]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 return edgeIds;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 function getRelationNodeIds(graphData, node) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 var nodes = graphData.nodes;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 var edges = graphData.edges;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 var nodeIds = [];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411 for (var i=0; i<node.in.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 var edgeId = node.in[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 nodeIds.push(edges[edgeId].property.from);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 for (var i=0; i<node.out.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416 var edgeId = node.out[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 nodeIds.push(edges[edgeId].property.to);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 for (var i=0; i<node.both.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
420 var edgeId = node.both[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 var fromId = edges[edgeId].property.from;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 var toId = edges[edgeId].property.to;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423 if (fromId == node.property.id) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 nodeIds.push(toId);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 } else {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 nodeIds.push(fromId);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 return nodeIds;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
431
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
432 /*
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 * This function output all NODE thath are related [node]
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 */
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 function updateRelationNodes(graphData, node) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436 var id = node.property.id;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 var edges = graphData.edges;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 var edgeIds = getRelationEdgeIds(node);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 for (var i=0; i<edgeIds.length; i++ ) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 createNodeFromEdge(graphData, edges[edgeIds[i]]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 jsPlumb.removeAllEndpoints();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 jsPlumb.draggable($('.graphNode'));
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
445
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
446 /*
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 * rels = {dependency:1, evidence:1};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 * showRelationNodes(graphData, node, rels);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 */
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 function showRelationNodes(graphData, node, rels) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 var id = node.property.id;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 var edges = graphData.edges;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 var edgeIds = getRelationEdgeIds(node);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
454 for (var i=0; i<edgeIds.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 var edge = edges[edgeIds[i]];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 if (rels[edge.property.rel]) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 createNodeFromEdge(graphData, edges[edgeIds[i]]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 jsPlumb.removeAllEndpoints();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 jsPlumb.draggable($('.graphNode'));
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463
2
e90546bb87e4 mofidied traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 1
diff changeset
464 var BASE_THETA = -30;
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 var BASE_ANGLE = 180;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 var BASE_DISTANCE = 180;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 function calcChildNodePosition(parent, num) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 var pX = parent.position.x;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 var pY = parent.position.y;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 var deg = BASE_ANGLE - num * BASE_THETA;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 var theta = deg * (Math.PI / 180);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472 var cX = pX - (BASE_DISTANCE * Math.cos(theta));
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 var cY = pY - (BASE_DISTANCE * Math.sin(theta));
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 return {x:cX, y:cY};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 function showAllEdge(graphData) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 var edges = graphData.edges;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 for (var id in edges) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 showEdge(graphData, edges[id]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 jsPlumb.removeAllEndpoints();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 jsPlumb.draggable($('.graphNode'));
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 function recursiveShowRelationNodes(graphData, node) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 if (!node.view) updateNode(node);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 childNodeIds = getRelationNodeIds(graphData, node);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 /* calcration of childNode position */
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 var numCalcChild = 0;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 for (var i=0; i<childNodeIds.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 var id = childNodeIds[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 var childNode = graphData.nodes[id];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 if (!childNode.position) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 childNode.position = calcChildNodePosition(node, numCalcChild);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 updateNode(childNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
498 numCalcChild++;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 /* calcration of grandchildNode position */
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 for (var i=0; i<childNodeIds.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 var id = childNodeIds[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
503 var childNode = graphData.nodes[id];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 var ids = getRelationNodeIds(graphData, childNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 for (var j=0; j<ids.length; j++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 var n = graphData.nodes[ids[j]];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
507 if (!n.position) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
508 recursiveShowRelationNodes(graphData, childNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
509 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
510 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
511 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
512 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
514 var EDGE_LIST = {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
515 evidence:'evidence',
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
516 dependency:'dependency',
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
517 version:'version',
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
518 derived:'derived',
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
519 agreement:'agreement'
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 };
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 $(function() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 userName = localStorage.userName;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 testStart();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 })
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 function recursiveCalcPosition(graphData, parentNode) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 if (!parentNode.position) updateNode(parentNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 childNodeIds = getRelationNodeIds(graphData, parentNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 /* calcration of childNode position */
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
531 var numCalcChild = 0;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
532 var childArray = {};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 for (var i=0; i<childNodeIds.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
534 var id = childNodeIds[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535 var childNode = graphData.nodes[id];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 childArray[id] = childNode;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 if (!childNode.position) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538 childNode.position = calcChildNodePosition(parentNode, numCalcChild);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 numCalcChild++;
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 /* calcration of grandchildNode position */
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 for (var id in childArray) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 var childNode = childArray[id];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 var grandChildIds = getRelationNodeIds(graphData, childNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546 for (var i=0; i<grandChildIds.length; i++) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 var gId = grandChildIds[i];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 var grandChild = graphData.nodes[gId];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 if (!grandChild.position) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 recursiveCalcPosition(graphData, childNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
554 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 var GRAPH_DATA = new GraphData();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 var rootNode = {};
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558 function testStart() {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559 init();
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 var graphData = parseJSONGraphData(GRAPH_DATA, sampleJSONData);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 var rootNodeId = "1";
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
562 rootNode = graphData.nodes[rootNodeId];
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 recursiveCalcPosition(graphData, rootNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
564 updateNode(rootNode);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
566
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
567 function logProperty(d) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
568 for(var key in d) {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
569 console.log("key: "+key+ "\nvalue: "+d[key]);
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
570 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
572
1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
573
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
574 edgeInfo1 = [
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
575 {
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
576 kind:"collected",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
577 direction:"in",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
578 num:"2"
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
579 },
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
580 {
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
581 kind:"reject",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
582 direction:"out",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
583 num:"1"
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
584 }
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
585 ];
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
586
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
587 sampleData = {
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
588 nodes: [
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
589 {
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
590 id:"1",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
591 title:"context1",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
592 kind:"agree",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
593 createdUser:"oshiro",
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
594 edgeInfo:edgeInfo1
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
595 }
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
596 ]
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
597 };
a3fdabc0613e create traverseDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
598
0
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599 sampleJSONData = {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
600 nodes: [
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
601 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602 id:"1",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
603 title:"context1",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
604 kind:"agree",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
605 createdUser:"oshiro"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
607 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
608 id:"2",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609 title:"task2",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
610 kind:"reject",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
611 createdUser:"kinjo"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
612 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
613 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
614 id:"3",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
615 title:"context3",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
616 createdUser:"tamayose"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
617 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
618 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
619 id:"4",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
620 title:"task4",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
621 kind:"agree",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
622 createdUser:"oshiro"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
623 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
624 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
625 id:"5",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
626 title:"conetxt5",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
627 createdUser:"oshiro"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
628 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
629 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
630 id:"6",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
631 title:"context6",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
632 createdUser:"kinjo"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
633 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
634 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
635 id:"7",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
636 title:"context7",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
637 createdUser:"tamayose"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
638 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
639 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
640 id:"8",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
641 title:"task2",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 createdUser:"tamayose"
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644 ],
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 edges: [
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
647 id:"11",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
648 from:"2",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
649 to:"1",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
650 rel:"dependency",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
652 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
653 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
654 id:"12",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
655 from:"1",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
656 to:"3",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 rel:"evidence",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
658 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
659 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
660 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661 id:"13",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
662 from:"3",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
663 to:"4",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
664 rel:"evidence",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
665 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
666 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
667 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
668 id:"14",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
669 from:"3",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 to:"5",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
671 rel:"derived",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
672 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
673 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
674 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
675 id:"15",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
676 from:"1",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
677 to:"6",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
678 rel:"evidence",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
679 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
680 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
681 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
682 id:"17",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
683 from:"7",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684 to:"4",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
685 rel:"evidence",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
687 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
689 id:"18",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
690 from:"7",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
691 to:"5",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
692 rel:"evidence",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
693 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
694 },
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
695 {
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 id:"19",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
697 from:"8",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
698 to:"2",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
699 rel:"version",
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
700 type:""
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
701 }
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
702 ]
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
703 };
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
704
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
705 </script>
36959449f3b2 add some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
706