annotate index.html @ 10:3fa1be92ab48 draft

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