-
Notifications
You must be signed in to change notification settings - Fork 0
/
md.html
175 lines (132 loc) · 4.83 KB
/
md.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!doctype html>
<html lang="en">
<!--
Copyright 2012 Dexter Pratt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Note that the above copyright applies to this specific file.
The libraries used by this file each have their own license terms.
-->
<head>
<title>ExperTwin</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" type="text/css" href="./css/BEL_mp_demo.css" />
<script type="text/javascript" src="./jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="./three/Three.js"></script>
<script type="text/javascript" src="./three/RequestAnimationFrame.js"></script>
<script type="text/javascript" src="./triptych/Core/Triptych-1.1.4.js"></script>
<script type="text/javascript" src="./triptych/GraphLoader/BasicGraphLoader-1.1.4.js"></script>
<script type="text/javascript" src="./triptych/Visualizer/WebGLVisualizer-1.1.3.js"></script>
<script type="text/javascript" src="./triptych/Visualizer/BELMPVisualizer-1.1.2.js"></script>
<script type="text/javascript" src="./triptych/Controls/BasicControls-1.1.3.js"></script>
<script type="text/javascript" src="./triptych/LayoutEngine/ForceDirectedLayoutEngine-1.1.2.js"></script>
<script type="text/javascript" src="./triptych/LayoutEngine/MP2LayoutEngine-1.1.1.js"></script>
</head>
<body>
<div id="footer">
<div id="logo">
<a href="http://www.triptychjs.com"><img src="./img/triptych_logo_large_white1.png" height=40></a>
</div>
<div id="copyright">
WVU
</div>
</div>
<div id="controls">
<span id="fly"><img src="./img/fly_icon.png" height=40></span>
<span id="zoom_in"><img src="./img/zoom_in_icon.png" height=40></span>
<span id="zoom_out"><img src="./img/zoom_out_icon.png" height=40></span>
</div>
<div id="details">
<span id="expand"><img src="./img/expand_icon.png" height=40> WVU</span>
<div id="hide_details">
<img src="./img/close_icon.png" height=40>
</div>
<div id="detailsContent"></div>
</div>
<script type="text/javascript" src="./bel_demo_common.js"></script>
<script>
var sourceURL = "./graphs/Cell Cycle.xgmml";
function belSetup(){
assignPlanes();
//assignNodeValues(5);
setNodeTypes();
setEdgeTypes();
}
function loaderSetup(){
loader = new TRIPTYCH.BasicGraphLoader();
}
function visualizerSetup(){
visualizer = new TRIPTYCH.BELMPVisualizer();
visualizer.showLabels = false;
visualizer.showEdgeLabels = false;
visualizer.addTexture("increaseMap", "./textures/increaseDot.png");
}
function layoutEngineSetup(){
layoutEngine = new TRIPTYCH.MP2LayoutEngine();
layoutEngine.updateCount = 400;
}
function controlsSetup(){
controls = new TRIPTYCH.BasicControls();
}
function selectNode(identifier){
var pNode = graph.nodeByIdentifier(identifier);
if (pNode != null) pNode.selected = true;
}
function setFlyParameters(){
selectNode("taof(TP53)");
selectNode("TP53 P@S215");
selectNode("exp(GADD45A)");
selectNode("GADD45A");
selectNode("kaof(CDC2)");
controls.flyToAndLookAt(new THREE.Vector3( 0, 600, 100), controls.target, 5.0, 0.5);
}
function setCameraPosition(){
controls.camera.position.set( 0, 700, 105);
controls.camera.up.set(0,0,1);
}
function assignPlanes(){
// For demo purposes, randomly assign mouse, rat, human to edge.planes
// every edge must have at least one plane
// 40% human, 40% mouse, 30% rat
// human if not assigned any plane randomly
$.each(graph.edges, function(i, edge){
var rand = Math.random();
if (rand < 0.3) edge.addPlane("human");
rand = Math.random();
if (rand < 0.3) edge.addPlane("mouse");
rand = Math.random();
if (rand < 0.2) edge.addPlane("rat");
if (edge.planes.length == 0) edge.addPlane("human");
//console.log(edge.planes);
});
$.each(graph.nodes, function(i, node){
$.each(node.getEdges(), function(j, edge){
$.each(edge.planes, function(n, plane){
node.addPlane(plane);
});
});
if (node.planes.length == 0) node.addPlane("human");
});
}
function main (){
// Check compatibility
if ( ! TRIPTYCH.EnvironmentDetector.webgl ) {
TRIPTYCH.EnvironmentDetector.addGetWebGLMessage();
} else {
run();
}
}
main();
</script>
</body>
</html>