-
Notifications
You must be signed in to change notification settings - Fork 31
/
index.html
306 lines (287 loc) · 10.3 KB
/
index.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!DOCTYPE html>
<html>
<head>
<title>Test suite</title>
<link rel="stylesheet" href="vendor/qunit-1.23.1.css">
<!-- Use qunit to help run tests -->
<script src="vendor/qunit-1.23.1.js"></script>
<!-- Use requireJS to help make test modular -->
<script src="../empress/support_files/vendor/require-2.1.22.min.js"></script>
</head>
<body>
<!-- required for qunit -->
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<!-- add any test GUI components to this div-->
<div id="test-div"></div>
<input id="test-num-input" type="number" style="display: none;">
<!-- Barplot GUI elements, which are automatically accessed when initializing
BarplotPanel (which is done from within Empress).
We use "display: none;" to avoid having this junk take up any space.
(For reference, I've literally just copied in the contents of
barplot-available-content in the side-panel.html template here and
removed comments.)
-->
<div id="barplot-available-content" style="display: none;">
<p>
<label for="barplot-chk">Draw barplots?</label>
<input id="barplot-chk" type="checkbox" class="empress-input">
</p>
<div id="barplot-layer-container" class="hidden">
<hr />
</div>
<div id="barplot-add-options" class="hidden">
<p>
<label for="barplot-add-btn">Add another layer</label>
<button id="barplot-add-btn">+</button>
</p>
</div>
<div id="barplot-border-content" class="hidden">
<p>
<label for="barplot-border-chk">Add a border around barplot layers?</label>
<input id="barplot-border-chk" type="checkbox" class="empress-input">
</p>
<div id="barplot-border-options" class="hidden">
<p>
<label for="barplot-border-color">Border color</label>
<input id="barplot-border-color" type="text">
</p>
<p>
<label for="barplot-border-length">Length</label>
<input id="barplot-border-length" type="number" class="empress-input">
</p>
</div>
<hr />
</div>
<p id="barplot-update-options" class="hidden">
<button id="barplot-update">Update</button>
</p>
</div>
<div id="barplot-unavailable-content" style="display: none;">
<p class="side-panel-notes" style="font-weight: bold;">
Barplots are currently only supported in the rectangular layout. Please
change the layout in order to use barplots.
</p>
</div>
<!-- Table with tree stats; copy-pasted to here for same reasons as barplot
UI elements above
-->
<table style="margin: 0 auto; display: none;">
<tbody>
<tr>
<td class="header-cell" style="text-align: center;" colspan="2">Node counts</td>
<!-- Add padding between the two horizontally separated "halves" of the
table. Based on alternate option listed at
https://stackoverflow.com/a/11801090/10730311.
-->
<td> </td>
<td class="header-cell" style="text-align: center;" colspan="2">Node lengths</td>
</tr>
<tr>
<td class="header-cell">Tips</td>
<td id="stats-tip-count"></td>
<td></td>
<td class="header-cell">Minimum</td>
<td id="stats-min-length"></td>
</tr>
<tr>
<td class="header-cell">Internal nodes</td>
<td id="stats-int-count"></td>
<td></td>
<td class="header-cell">Maximum</td>
<td id="stats-max-length"></td>
</tr>
<tr>
<td class="header-cell">Total</td>
<td id="stats-total-count"></td>
<td></td>
<td class="header-cell">Average</td>
<td id="stats-avg-length"></td>
</tr>
</tbody>
</table>
<!-- The main legend; Empress gets a reference to this on initialization -->
<div id="legend-main" class="legend">
</div>
<!-- The tree canvas need for use in test-empress -->
<div id="tree-container" class="{{ emperor_classes }}">
<div class="container {{ emperor_classes }}">
<canvas class="tree-surface" id="tree-surface">
Your browser does not support HTML5
</canvas>
</div>
</div>
<!-- Various side panel / selected-node-menu tags that are needed in order to
create an instance of CanvasEvents / SelectedNodeMenu without crashing
things. Ideally, these should be loaded dynamically from what's in the
Empress template HTML files, rather than inserted here willy-nilly.
-->
<div style="display: none;" id="element-graveyard">
<input type="text" id="quick-search" placeholder="Search by node name..."
style="flex-grow: 1;" class="empress-input">
<button id="side-header-search-btn" style="flex-grow: 1;">Search</button>
<!-- node selection menu box -->
<div class="hidden" id="menu-box">
<h1 id="menu-box-node-id"></h1>
<p class="hidden" id="menu-box-node-name-warning"></p>
<div id="menu-box-node-length-container" class="hidden">
<strong>Node length:</strong>
<span id="menu-box-node-length"></span>
</div>
<!-- Feature metadata section -->
<div id="menu-fm-section">
<h3 id="menu-fm-header">Feature Metadata</h3>
<p id="menu-fm-no-fm-note"></p>
<table class="menu-table" id="menu-fm-table"></table>
</div>
<!-- Sample metadata section -->
<div id="menu-sm-section">
<h3 id="menu-sm-header">Sample Presence Information</h3>
<p id="menu-box-node-not-in-table-warning"></p>
<p id="menu-box-sm-notes"></p>
<table class="menu-table" id="menu-sm-table"></table>
<div id="menu-sm-add-section">
<br>
<strong>Select a metadata column to summarize</strong>
<label class="menu-select-container">
<select id="menu-select"></select>
</label>
<button id="menu-add-btn">Add</button>
</div>
</div>
</div>
</div>
<script>
QUnit.config.autostart = false;
requirejs.config({
'baseUrl' : '../empress/',
// all paths are relative to baseUrl, note that .js extension should
// not be used
'paths' : {
/* vendor paths */
'jquery' : './../tests/vendor/jquery-2.2.4.min',
'glMatrix' : './support_files/vendor/gl-matrix.min',
'chroma' : './support_files/vendor/chroma.min',
'underscore' : './support_files/vendor/underscore-min',
'spectrum' : './support_files/vendor/spectrum.min',
'filesaver': './support_files/vendor/FileSaver.min',
/* succinct tree paths */
'AnimationPanel': './support_files/js/animation-panel-handler',
'Animator': './support_files/js/animator',
'BarplotLayer': './support_files/js/barplot-layer',
'BarplotPanel': './support_files/js/barplot-panel-handler',
'ByteArray': './support_files/js/byte-array',
'BPTree' : './support_files/js/bp-tree',
'Camera' : './support_files/js/camera',
'Colorer' : './support_files/js/colorer',
'BiomTable': './support_files/js/biom-table',
'util' : './support_files/js/util',
'Empress' : './support_files/js/empress',
'Legend': './support_files/js/legend',
'Drawer' : './support_files/js/drawer',
'VectorOps' : './support_files/js/vector-ops',
'CanvasEvents' : './support_files/js/canvas-events',
'SelectedNodeMenu' : './support_files/js/select-node-menu',
'LayoutsUtil' : './support_files/js/layouts-util',
'ExportUtil' : './support_files/js/export-util',
/* test utility code */
'UtilitiesForTesting' : './../tests/utilities-for-testing',
/* test paths */
'testBPTree' : './../tests/test-bp-tree',
'testByteTree' : './../tests/test-byte-array',
'testCamera' : './../tests/test-camera',
'testBIOMTable' : './../tests/test-biom-table',
'testColorer' : './../tests/test-colorer',
'testUtil' : './../tests/test-util',
'testCircularLayoutComputation' : './../tests/test-circular-layout-computation',
'testVectorOps' : './../tests/test-vector-ops',
'testEmpress' : './../tests/test-empress',
'testExport': './../tests/test-export',
'testAnimationHandler': './../tests/test-animation-panel-handler',
'testBarplots': './../tests/test-barplots',
'testLegend': './../tests/test-legend',
'testLayoutsUtil': './../tests/test-layouts-util',
'testSelectedNodeMenu': './../tests/test-select-node-menu',
}
});
// load tests
require(
['jquery',
'glMatrix',
'chroma',
'underscore',
'AnimationPanel',
'Animator',
'BarplotLayer',
'BarplotPanel',
'ByteArray',
'BPTree',
'Camera',
'Colorer',
'BiomTable',
'util',
'Empress',
'Legend',
'LayoutsUtil',
'ExportUtil',
'UtilitiesForTesting',
'testBPTree',
'testByteTree',
'testBIOMTable',
'testCamera',
'testColorer',
'testUtil',
'testCircularLayoutComputation',
'testVectorOps',
'testEmpress',
'testExport',
'testAnimationHandler',
'testBarplots',
'testLegend',
'testLayoutsUtil',
'testSelectedNodeMenu',
],
// start tests
function (
$,
gl,
chroma,
underscore,
AnimationPanel,
Animator,
BarplotLayer,
BarplotPanel,
ByteArray,
BPTree,
Camera,
testBIOMTable,
Colorer,
BiomTable,
util,
Empress,
Legend,
LayoutsUtil,
ExportUtil,
UtilitiesForTesting,
testBPTree,
testByteTree,
testCamera,
testColorer,
testUtil,
testCircularLayoutComputation,
testVectorOps,
testEmpress,
testExport,
testAnimationHandler,
testBarplots,
testLegend,
testLayoutsUtil,
testSelectedNodeMenu,
) {
$(document).ready(function() {
QUnit.start();
});
});
</script>
</body>
</html>