-
Notifications
You must be signed in to change notification settings - Fork 0
/
uiphy.html
169 lines (146 loc) · 4.81 KB
/
uiphy.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
<html>
<head>
<script src="js/jquery-1.5.1.min.js"></script>
<script src="jquery.mousewheel.min.js"></script>
<link rel="stylesheet" href="css/smoothness/jquery-ui-1.8.13.custom.css">
<link rel="stylesheet" href="css/dev.css">
<link rel="stylesheet" href="css/uiblast.css">
<script src="js/jquery-ui-1.8.13.custom.min.js"></script>
<script src="jQRangeSlider.js"></script>
<script src="js/jquery.gchart.min.js"></script>
<script src="js/jquery.gchart.ext.min.js"></script>
<script src="js/jquery-geturlparams.js"></script>
<script src="js/jsphylosvg-min.js"></script>
<script src="js/raphael-min.js"></script>
</head>
<body>
<script type = "text/javascript">
$(document).ready( function()
{
$( "#blasttabs" ).tabs();
$("#demo").button();
$("#demo").click(function(e){
xmlUrl = "demo/phy.txt";
$('#remotexmlurl').val(xmlUrl);
$('#blasttabs').tabs().tabs('select',1);
$.ajax( {
type: "GET",
url: xmlUrl,
success: function(xml)
{
drawNewick(xml);
}
});
});
$("#remotexml").button();
$("#remotexml").click(function(e){
xmlUrl = "getRemoteXML.php?url="+encodeURI($('#remotexmlurl').val());
$('#blasttabs').tabs().tabs('select',1);
if(!xmlUrl.match(/\.xml$/)) {
$.ajax( {
type: "GET",
url: xmlUrl,
success: function(xml)
{
drawNewick(xml);
}
});
}
else {
$.ajax( {
type: "GET",
url: xmlUrl,
dataType: "xml",
success: function(xml)
{
drawPhy(xml);
}
});
}
});
if($.getURLParam("file")) {
xmlUrl = "getRemoteXML.php?url="+$.getURLParam("file");
$('#remotexmlurl').val(decodeURI($.getURLParam("file")));
$('#blasttabs').tabs().tabs('select',1);
if(!xmlUrl.match(/\.xml$/)) {
$.ajax( {
type: "GET",
url: xmlUrl,
success: function(xml)
{
drawNewick(xml);
}
});
}
else {
$.ajax( {
type: "GET",
url: xmlUrl,
dataType: "xml",
success: function(xml)
{
drawPhy(xml);
}
});
}
}
});
function drawNewick(xml) {
console.log('draw Newick');
var phylocanvas = new Smits.PhyloCanvas(
xml, // Newick or XML string
'phyCanvas', // Div Id where to render
1000, 1000, // Height, Width in pixels
'circular'
);
}
function drawPhy(xml) {
var dataObject = {
phyloxml: xml, // If using phyloXML, need to tell us - or else we assume it is Newick
fileSource: true // Need to indicate that it is from a file for us to process it correctly
};
var phylocanvas = new Smits.PhyloCanvas(
dataObject, // Newick or XML string
'phyCanvas', // Div Id where to render
1000, 1000, // Height, Width in pixels
'circular'
);
}
</script>
<div class="header">
GenOuest PhyloXML/Newick display
</div>
<div class="content">
<div id="blasttabs">
<ul>
<li><a href="#tab-upload">File selection</a></li>
<li><a href="#tab-blast">View</a></li>
<li><a href="#tab-about">About</a></li>
</ul>
<div id="tab-upload">
<h2>Select PhyXML file</h2>
<div>
<div>
<button id="demo">View demo</button>
</div>
<div>
<label for="blasturl">PhyXML file URL</label>
<input type="text" id="remotexmlurl"></input>
<button id="remotexml">View remote PhyXML file</button>
</div>
</div>
</div>
<div id="tab-blast">
<div id="phyCanvas">
</div>
</div>
<div id="tab-about">
<p>This tool is a GenOuest platform product (open source), while still experimental.</p>
<p>Phylogenetic trees must be in format Newick or PhyXML. If file name ends with <b>.xml</b>, then format PhyXML is used</p>
<p>Display is managed via Javascript library <a href="http://www.jsphylosvg.com/">jsPhyloSVG</a></p>
<p>Contact: <a href="mailto:[email protected]">support[at]genouest.org</a></p>
</div>
</div> <!-- blasttabs -->
</div> <!-- content -->
</body>
</html>