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