-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathBinaRena.html
781 lines (708 loc) · 32.2 KB
/
BinaRena.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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>BinaRena</title>
<link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD/AACgpyMUtAAAAACAAAAX/wAAFQAAAAD/AAA+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAxP8AABj/AAArRxNJJQAAAACNNW46AAD/kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAP7/AACcxgAA4+4SEkYAAAAAoTAAhf8AABOAAAAcAGz1GQAAAAAAcPAUAHT3IQAAAAAAAAAAAAAAAAAAAADVDjT/0Q87+v8AAP32BADw/wAAp0qfisA0AAAxVgCNxgB+miUAAAAShzZ1JgAAAAAAAAAAAHX0IgAAAAAAAAAAqB1v/+YIH//+AAH74QAe8/8AAGrRLi6/YAWVpP8AAJr/AABFiymU//8AABgAc/cfAHZeGwAAAAAAAAAAAAAAAPYDDP/9AwP+/wAA/6pOVPzLEEHktxhc9e0CFMqoHEy9qQBWnv8AACjqCxaPAAAAADtbvSUAS/8FIGjTFwB28ynbDC/+/wAA/v4AAf79AAP07QAP+VBWqvvfHyD5XQCJnP8AAGi4AEid/wAAI3oCBiC1IUVdAHL2OgBz82CiKlpV9wAI+P8AAP7xAA/98gAN9PYACvv3AAraagAWI/0BA7T/AAA/3AAkpP8AAFSZMTNdzUdHjTdav3AAcvSDAFq+jvAAD/76AAX8/wAARFkApp3vABDScQCP48sANrTqABXfngAgTyVg0srwAA+s/wAAjbMdSaOCInpeI2PWjABz9Y7/AADw8QAP1PQAC+jFEEfn3AAkcwAA/2HhAB7JeQCHprMATdHRAC7EqgBWQ3YDiVwHXfG6S1Cr0Dhbv9gJZ+/AAAAAAAAAgBPwABCiJwDZb4AAgMUAAP8XcgCOouEAHuQAAP9wJwB6WeoAFlQoANhiFhXTexlf3twEb/OaFmvh4QAAAAD/AACoAAD/NQAA/2MAAP8rANL/crsARLmdAGTMAAD/kwAA/5KwAFDbLQCqkQoA9ooBSPewTYmx6SJR18MAAAAAAAAAAAAAAAAAAP9UAAD/MwAA/4oAAP83HQDjfQAA/6kAAP/aBgDs8QAA/+FVAKuiAAD/tgSi+d0mANhtAACACgAA/ykAAP8tAAD/IAAAgAoAAP+AAAD/aAAA/1AAAP8sAAD/yAAA//mCAH31AAD/6QAA/9sAAPG7AAD/cQAAAAAAAAAAAAD/LgAAAAAAAAAAAAAAAAAAAAAAAP9UAAD/vAAA/+UAAP/cJQDa8RQA6/QAAP/bkABv5QAA/7YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP9cAAAAAAAA/20AAP/MAAD/7wAA//gAAP/4AAD/0gAA1uUAAP3nP/8AAH3/AAAb/wAAAv8AAAi/AAAAXwAAAL8AAAK0AAAghAAADDAAANT4AAC8AAAA+wEAAPuBAAD/AAAA/4AAAA==" rel="icon" type="image/x-icon" />
<link rel="stylesheet" href="static/css/style.css">
<script src="static/js/main.js"></script>
<script src="static/js/interface.js"></script>
<script src="static/js/input.js"></script>
<script src="static/js/display.js"></script>
<script src="static/js/select.js"></script>
<script src="static/js/binning.js"></script>
<script src="static/js/search.js"></script>
<script src="static/js/miniplot.js"></script>
<script src="static/js/datable.js"></script>
<script src="static/js/plot.js"></script>
<script src="static/js/render.js"></script>
<script src="static/js/calculate.js"></script>
<script src="static/js/util.js"></script>
<script src="static/js/numeric.js"></script>
<script src="static/js/algorithm.js"></script>
<script src="static/js/rule.js"></script>
<script src="static/js/resource.js"></script>
<script src="static/js/svg.js"></script>
<script src="static/js/worker.js"></script>
</head>
<!--
The program interface consists of:
1. rendering area (main-frame)
main-canvas: scatter plot
sele-canvas: selection etc.
2. docked panel:
dashboard (dash-frame): top left
start-panels:
menu-button (toggle context-menu)
dash-button (toggle dash-panel)
dash-panel:
search-panel
display-panel
individual display items have legends
mini-panel
side-frame: right side (toggled by show-side-btn)
bins-panel (contains hide-side-btn)
info-panel (for selected)
widget-frame: bottom left
set-panel
quick-btns
nav-panel
3. context menu:
(below start button on click, or after cursor on right click)
4. floating panels:
scale-select
palette-select
data-table-modal
help-modal
5. generic elements:
toast
list-select
popup message
6. hidden elements:
file upload button
-->
<body>
<!--
1. rendering area
-->
<div id="main-frame" style="height: 100vh; width: 100%; overflow: auto;">
<!-- from top to bottom:
z = 2: coordinate sign
z = 1: selection shadows
z = 0.5: main scatter plot
z = 0: highlight borders
z = -1: drop sign
-->
<div style="position: relative; height: 100%;">
<div id="coords-label" class="hidden" style="z-index: 3;"></div>
<canvas id="main-canvas" class="main-plot" tabindex="1" style="z-index: 2;"></canvas>
<canvas id="sele-canvas" class="main-plot" style="z-index: 1;"></canvas>
<canvas id="high-canvas" class="main-plot" style="z-index: 0;"></canvas>
<div id="drop-sign" style="z-index:-1;">
<p>Drag & drop data table here</p>
</div>
</div>
</div>
<!--
2. docked panels
-->
<!--
dashboard
-->
<div id="dash-frame" class="dock">
<!-- start panel -->
<div id="start-panel">
<button id="dash-btn" title="Show dashboard" style="float: right;"></button>
<button id="menu-btn" class="dropdown" title="Show main menu">BinaRena</button>
</div>
<!-- dash panel -->
<div id="dash-panel" class="hidden">
<!-- search panel -->
<div id="search-head" class="panel-head">
<button title="Show/hide search panel">Search</button>
</div>
<div class="dash-content">
<!-- search a column -->
<table>
<tr>
<td>Field</td>
<td><select id="search-field-sel" title="Select a field to search"><option value="0"></option></select></td>
<td><button id="search-btn" style="visibility: hidden;" title="Search by criteria (hold Shift to append)">Search</button></td>
</tr>
<tr class="hidden" id="num-sel-p">
<td>in</td>
<td>
<button class="static" id="min-btn" title="Lower bound included">[</button>
<input type="text" id="min-txt" title="Lower bound" style="width: 30%; text-align: right;">
,
<input type="text" id="max-txt" title="Upper bound" style="width: 30%;">
<button class="static" id="max-btn" title="Upper bound included">]</button>
</td>
</tr>
<tr class="hidden" id="cat-sel-p">
<td>is</td>
<td><input type="text" id="cat-sel-txt" class="dropdown" title="Enter a category" style="width: 100%;"></td>
<td></td>
</tr>
<tr class="hidden" id="fea-sel-p">
<td>has</td>
<td><input type="text" id="fea-sel-txt" class="dropdown" title="Enter a feature" style="width: 100%;"></td>
<td></td>
</tr>
<tr class="hidden" id="des-sel-p">
<td>is</td>
<td><input type="text" id="des-sel-txt" title="Enter text" style="width: 100%;"></td>
<td></td>
</tr>
</table>
<!-- keyword options -->
<span id="str-match-span" class="hidden">
<button class="square" id="case-btn" title="Match case">Aa</button><!--
--><button class="square" id="whole-btn" title="Match whole value">“”</button>
</span>
</div>
<!-- display panel -->
<!-- It defines five display elements of the main plot: x-axis, y-axis,
size, opacity, and color. -->
<div id="display-head" class="panel-head">
<button title="Show/hide display panel">Display</button>
</div>
<div class="dash-content">
<table>
<tr data-item="x">
<td title="Position along the x-axis (left to right)"><i>X</i>-axis</td>
<td><select id="x-field-sel"></select></td>
<td><span id="x-param-span" class="hidden">
<button class="square dropdown scale-btn" id="x-scale-btn"></button><!--
--><button class="square swap-btn" title="Swap X- and Y-axes">↓</button>
</span></td>
</tr>
<tr data-item="y">
<td title="Position along the y-axis (bottom to top)"><i>Y</i>-axis</td>
<td><select id="y-field-sel"></select></td>
<td><span id="y-param-span" class="hidden">
<button class="square dropdown scale-btn" id="y-scale-btn"></button><!--
--><button class="square swap-btn" title="Swap X- and Y-axes">↑</button>
</span></td>
</tr>
<!-- size -->
<tr data-item="size">
<td title="Radius of the marker">Size</td>
<td><select id="size-field-sel"></select></td>
<td><span id="size-param-span" class="hidden">
<button class="square dropdown scale-btn" id="size-scale-btn"></button><!--
--><button class="square legend-btn" title="Show/hide legend" style="transform: rotate(-90deg)">ⅲ</button>
</span></td>
</tr>
<!-- size legend -->
<tr class="hidden">
<td colspan="3">
<div id="size-legend" class="legend" data-item="size" data-ranging="none">
<label class="min" data-value=""> </label>
<div id="size-gradient" class="gradient"> </div>
<label class="max" data-value=""> </label>
<div class="clip lower"></div>
<div class="clip upper"></div>
<div class="range lower" data-tick="0"></div>
<div class="range upper" data-tick="10"></div>
</div>
</td>
</tr>
<!-- opacity -->
<tr data-item="opacity">
<td title="Alpha value of the fill color">Opacity</td>
<td><select id="opacity-field-sel"></select></td>
<td><span id="opacity-param-span" class="hidden">
<button class="square dropdown scale-btn" id="opacity-scale-btn"></button><!--
--><button class="square legend-btn" title="Show/hide legend" style="transform: rotate(-90deg)">ⅲ</button>
</span></td>
</tr>
<!-- opacity legend -->
<tr class="hidden">
<td colspan="3">
<div id="opacity-legend" class="legend" data-item="opacity" data-ranging="none">
<label class="min" data-value=""> </label>
<div id="opacity-gradient" class="gradient"> </div>
<label class="max" data-value=""> </label>
<div class="clip lower"></div>
<div class="clip upper"></div>
<div class="range lower" data-tick="0"></div>
<div class="range upper" data-tick="10"></div>
</div>
</td>
</tr>
<!-- color -->
<tr data-item="color">
<td title="RGB value of the fill color">Color</td>
<td>
<div>
<select id="color-field-sel"></select><!--
--><button id="palette-btn" class="dropdown inside" title="Choose a color palette">...</button>
</div>
</td>
<td><span id="color-param-span" class="hidden">
<button class="square dropdown scale-btn" id="color-scale-btn"></button><!--
--><button class="square legend-btn" title="Show/hide legend" style="transform: rotate(-90deg)">ⅲ</button>
</span></td>
</tr>
<!-- color legend -->
<tr class="hidden">
<td colspan="3">
<div id="color-legend" class="legend" data-item="color" data-ranging="none">
<label class="min" data-value=""> </label>
<div id="color-gradient" class="gradient"> </div>
<label class="max" data-value=""> </label>
<div class="clip lower"></div>
<div class="clip upper"></div>
<div class="range lower" data-tick="0"></div>
<div class="range upper" data-tick="10"></div>
</div>
<div id="color-legend-2">
<table id="color-table"></table>
<div id="color-table-ctrl">
<button id="add-color-btn" class="square" title="Add a color">+</button><!--
--><button id="remove-color-btn" class="square" title="Remove a color">−</button>
</div>
</div>
</td>
</tr>
</table>
</div>
<!-- mini plot panel -->
<div id="mini-head" class="panel-head">
<button title="Show/hide plot panel">Plot</button>
</div>
<div id="mini-content" class="dash-content hastool hidden" style="position: relative;">
<!-- mini plot controls -->
<div class="toolbar right">
<button id="mini-log-btn" class="square" title="Logarithm transformation" style="letter-spacing: -0.08em; font-size: 1em;">log</button>
<button id="mini-plus-btn" class="square" title="Increase resolution">+</button>
<button id="mini-minus-btn" class="square" title="Decrease resolution">−</button>
</div>
<!-- mini plot variable selection -->
<table>
<tr>
<td>Field</td>
<td><select id="mini-field-sel" title="Plot a numeric variable"></select></td>
</tr>
</table>
<!-- mini plot canvas -->
<canvas id="mini-canvas"></canvas>
</div>
<!-- tooltip of legend -->
<!-- It is a dialog box floating with the mouse to indicate the current
display property and data value. -->
<div id="legend-tip" class="hidden">
<span id="legend-circle"></span>
<span id="legend-value"></span>
</div>
</div>
</div>
<!--
widget frame
A row of buttons located at the bottom left corner of the window.
-->
<div id="widget-frame" class="dock">
<!-- setting panel -->
<div id="set-panel">
<button id="set-btn" title="Show settings">⋮</button>
<div class="dock active hidden">
<div class="panel-head"><button disabled>Settings</button></div>
<div class="dash-content">
<p class="title"><label>Special fields:</label></p>
<p><label>Length</label><select id="len-col-sel" title="Field that represents contig length (bp)" style="width: 50%;"></select></p>
<p><label>Coverage</label><select id="cov-col-sel" title="Field that represents contig coverage (depth)" style="width: 50%;"></select></p>
<!-- temporarily disabled -->
<div class="hidden">
<p class="title"><label>Filter:</label></p>
<p><label>Length</label><input type="text" id="len-filt" title="Minimum contig length threshold" style="width: 40%; text-align: right;"></p>
<p><label>Coverage</label><input type="text" id="cov-filt" title="Minimum contig coverage threshold" style="width: 40%; text-align: right;"></p>
</div>
<p class="title"><label>Show:</label></p>
<p><label>Night mode</label><input type="checkbox" id="night-chk"></p>
<p><label>Plot grid</label><input type="checkbox" id="grid-chk"></p>
<p><label>Navigation bar</label><input type="checkbox" id="nav-chk"></p>
<p><label>Quick buttons</label><input type="checkbox" id="freq-chk" checked></p>
</div>
</div>
</div>
<!-- unused unicode symbols: ⊷ ⊹ ⥤ ⧉ -->
<!-- frequent panel -->
<div class="freq">
<button id="image-btn" title="Take a screenshot (P)">✿</button>
<div id="image-menu" class="expand">
<p><a id="png-btn" title="Save as PNG format">PNG</a></p>
<p><a id="svg-btn" title="Save as SVG format">SVG</a></p>
</div>
</div>
<div class="freq">
<button id="polygon-btn" title="Draw polygon with mouse clicks to contain multiple contigs (Enter)" data-title="Finish polygon selection (Enter) (hold Shift to append)">⬠</button>
</div>
<div class="freq">
<button id="mask-btn" title="Mask selected contigs (Delete)">∅</button>
<div id="mask-menu" class="expand">
<p>
<span id="masked-span">Masked: 0</span>
<span id="unmask-span" class="hidden">
<button id="undo-mask-btn" title="Undo last masking (Z)">↩</button><!--
--><button id="clear-mask-btn" title="Unmask all contigs">✕</button>
</span>
</p>
</div>
</div>
<div class="freq">
<button id="high-btn" title="Highlight selected contigs (L)">◉</button>
<div id="high-menu" class="expand"></div>
</div>
<div class="freq">
<button id="focus-btn" title="Focus on selected contigs (F)">⊹</button>
</div>
<!-- navigation panel -->
<div id="nav-panel" class="hidden">
<span class="spacer"></span>
<button id="zoomin-btn" title="Zoom in (+)">+</button>
<button id="zoomout-btn" title="Zoom out (-)">−</button>
<span class="spacer"></span>
<button id="left-btn" title="Move left (←)">←</button>
<button id="up-btn" title="Move up (↑)">↑</button>
<button id="right-btn" title="Move right (→)">→</button>
<button id="down-btn" title="Move down (↓)">↓</button>
<span class="spacer"></span>
<button id="reset-btn" title="Reset view (0)">⟳</button>
</div>
</div>
<!--
side frame
The "bins" and "info" panels that occupy the right side of the window.
-->
<!-- show side frame button -->
<div id="show-frame" class="dock"><div>
<button id="show-side-btn" title="Show side frame" disabled></button>
</div></div>
<!-- side frame: stick to right, and auto-grow -->
<div id="side-frame" class="hidden">
<!--
bins panel
Displays a table of bins in current binning plan.
-->
<div id="bins-head" class="panel-head">
<button id="bins-head-btn" title="Show/hide bins panel">Bins</button>
<div id="bins-menu-wrap" class="hidden">
<label>≡</label>
<div id="bins-menu" class="expand menu">
<p><a id="silhouet-a" title="Evaluate binning confidence using silhouette coefficient">Evaluate</a></p>
<p><a id="adj-rand-a" class="dropdown" title="Compare with another binning plan using adjusted Rand index">Compare</a></p>
<hr>
<p><a id="export-plan-a" title="Export current binning plan">Export</a></p>
</div>
</div>
<button id="hide-side-btn" title="Hide side frame"></button>
</div>
<div id="bins-content" class="side-content hastool">
<!-- binning plan -->
<div>
<div class="dash-content">
<table>
<tr>
<td>Plan</td>
<td><input type="text" id="plan-sel-txt" class="dropdown" title="Load a binning plan from a categorical field"></td>
<td><button id="save-plan-btn" class="hidden" title="Save current binning plan">Save</button></td>
</tr>
</table>
</div>
</div>
<!-- bin table -->
<div class="hastool" style="overflow: auto; resize: vertical;">
<!-- toolbar -->
<div class="toolbar left">
<button id="new-empty-bin-btn" title="Create an empty new bin">+</button>
<button id="delete-bin-btn" class="hidden" title="Delete selected bin(s)">−</button>
<button id="merge-bin-btn" class="hidden" title="Merge selected bins">∪</button>
<span class="spacer"></span>
<button id="mask-bin-btn" class="hidden" title="Removed masked contigs from all bins" style="font-size: 22px">∅</button>
<button id="bin-data-btn" class="hidden" title="Show data of selected bin(s)" style="font-size: 22px">◫</button>
</div>
<!-- bins table -->
<div id="bin-table-wrap">
<table id="bin-table" style="z-index: 1;">
<thead id="bin-thead" class="hidden">
<tr>
<th title="Unique bin identifier">Name</th>
<th title="Number of contigs">#</th>
<th title="Total length of contigs (kbp)">kb</th>
<th title="Relative abundance (%) (sum of length x coverage vs. entire sample)">%</th>
</tr>
</thead>
<tbody id="bin-tbody"></tbody>
</table>
</div>
</div>
</div>
<!--
Info panel
Summarizes information of currently selected contigs.
-->
<div id="info-head" class="panel-head">
<button id="info-head-btn" title="Show/hide selected panel">Selected</button>
<div id="info-menu-wrap" class="hidden">
<label>≡</label>
<div id="info-menu" class="expand menu">
<p><a id="sel-comred-a" class="dropdown" title="Calculate completeness/redundancy of feature group">Feature group</a></p>
<hr>
<p><a id="export-sel-a" title="Export selected contig list">Export</a></p>
</div>
</div>
<button disabled></button>
</div>
<div class="side-content hastool" style="overflow: auto; flex-grow: 1;"><!-- filling remaing height -->
<!-- toolbar -->
<div class="toolbar left">
<button id="as-new-bin-btn" class="hidden" title="Create a new bin from selected contigs (Space)">∗</button>
<button id="add-to-bin-btn" class="hidden" title="Add selected contigs to bin (.)">+</button>
<button id="remove-from-bin-btn" class="hidden" title="Remove selected contigs from bin (,)">−</button>
<button id="update-bin-btn" class="hidden" title="Update bin with selected contigs (/)">↺</button>
<span class="spacer"></span>
<button id="invert-btn" class="hidden" title="Invert selection">◐</button>
</div>
<!-- info table -->
<table id="info-table"></table>
<!-- inline controls -->
<div id="info-ctrl" class="hidden" style="z-index: 2;" data-row="">
<button class="dropdown" id="info-metric-btn" title="Metric">f(x)</button><!--
--><span id="info-ref-span"> by <select id="info-ref-sel" title="Weight by reference field"></select></span><!--
--><button id="info-plot-btn" title="Plot distribution">◔</button><!--
--><button id="info-hide-btn" title="Hide field">✕</button>
</div>
</div>
</div>
<!--
Context menu
i.e., the main menu, can be activated by clicking the program title or
right-clicking anywhere in the plot.
-->
<div id="context-menu" class="menu popup hidden">
<a id="open-data-a" title="Open a dataset as a new project">Open data</a>
<a id="load-data-a" title="Append data or load view to current project">Load data/view</a>
<a id="show-data-a" title="Show current dataset as a table">Show data</a>
<a id="close-data-a" title="Close current project">Close data</a>
<hr>
<a id="export-data-a" title="Export current dataset to a TSV file, which can later be opened to recover the project">Export data</a>
<a id="export-view-a" title="Export current view to a JSON file, which can later be loaded to recover the view">Export view</a>
<div class="expand-wrap">
<a class="expand-a" id="export-image-a" title="Export an image of current view">Export image</a>
<div class="menu expand-body">
<a id="export-png-a" title="Bitmap image in PNG format">PNG</a>
<a id="export-svg-a" title="Vector image in SVG format">SVG</a>
</div>
</div>
<a id="export-log-a" title="Export program log to a text file">Export log</a>
<hr>
<a id="reset-view-a" title="Recenter viewport (0)">Reset view</a>
<hr>
<a id="help-a" href="https://github.com/qiyunlab/binarena#readme" target="_blank" title="Get help information">Help</a>
</div>
<!--
floating panels
-->
<!-- data table -->
<div id="data-table-modal" class="modal hidden">
<div class="modal-content">
<div class="modal-head">
<span>
<button id="export-table-btn" title="Export data table">Export</button>
</span>
<span id="data-title-span">Data</span>
<span>
<button id="data-prev-btn" title="Previous page"><</button>
<input type="text" id="data-page-txt" title="Page number" style="width: 40px;">
<button id="data-next-btn" title="Next page">></button>
</span>
</div>
<div class="modal-body">
<table id="data-table" class="sheet"></table>
</div>
<div class="hidden">
<label>Data type:</label>
<span id="type-num-color">numeric</span>
<span id="type-cat-color">categorical</span>
<span id="type-fea-color">feature set</span>
<span id="type-des-color">descriptive</span>
</div>
</div>
</div>
<!-- data import -->
<div id="import-modal" class="modal hidden">
<div class="modal-content">
<div class="modal-head">
<span>
<button id="import-btn" title="Import data">Import</button>
</span>
<span>
<span id="import-title">Import data</span>
<span id="import-prog">Importing <span class="prog-dots"><span>•</span> <span>•</span> <span>•</span></span></span>
</span>
<span id="import-ctrl-span"></span>
</div>
<div class="modal-body">
<div id="import-table-wrap" class="hidden">
<table id="import-table" style="z-index: 1;">
<thead id="import-thead">
<tr>
<th title="Discard"> </th>
<th title="Field name">Field</th>
<th title="Data type">Type</th>
<th title="Special field">Sp</th>
</tr>
</thead>
<tbody id="import-tbody"></tbody>
</table>
</div>
<p id="has-header-p" class="hidden"><input type="checkbox" id="has-header-chk" checked> First line is header.</p>
</div>
</div>
</div>
<!-- feature group import -->
<div id="memlst-modal" class="modal hidden">
<div class="modal-content">
<div class="modal-head">
<span><button id="memlst-import-btn" title="Import a feature group membership list">Import</button></span>
<span><span id="memlst-title">Feature group</span></span>
<span id="memlst-ctrl-span"></span>
</div>
<div class="modal-body">
<table id="memlst-options">
<tr><td>Name:</td><td><input type="text" id="memlst-name-txt" title="Enter a name for the feature group"></td></tr>
<tr><td>For:</td><td><select id="memlst-field-sel" title="Select a feature set field"></select></td></tr>
</table>
</div>
</div>
</div>
<!-- Silhouette calculation -->
<div id="silh-modal" class="modal hidden">
<div class="modal-content">
<div class="modal-head">
<span>
<button id="silh-done-btn">Done</button><button id="silh-stop-btn">Abort</button><button id="silh-calc-btn">Calculate</button>
</span>
<span>
<span id="silh-title">Silhouette coefficient</span>
<span id="silh-progress"><span>Calculating</span> <span class="prog-dots"><span>•</span> <span>•</span> <span>•</span></span></span>
</span>
<span><button id="silh-help-btn">?</button></span>
</div>
<div id="silh-body-div" class="modal-body">
<div id="silh-msg-div">
<div>
<p>Use variables:</p>
<table id="silh-var-sel">
<tr><td><input type="checkbox" id="x-calc-chk" checked> <i>X</i>-axis:</td><td id="x-calc-var"></td></tr>
<tr><td><input type="checkbox" id="y-calc-chk" checked> <i>Y</i>-axis:</td><td id="y-calc-var"></td></tr>
<tr><td><input type="checkbox" id="size-calc-chk"> Size:</td><td id="size-calc-var"></td></tr>
<tr><td><input type="checkbox" id="opacity-calc-chk"> Opacity:</td><td id="opacity-calc-var"></td></tr>
<tr><td><input type="checkbox" id="color-calc-chk"> Color:</td><td id="color-calc-var"></td></tr>
</table>
<div id="silh-flag-div">
<p title="Display % progress and an "abort" button during calculation, which however is slower than not"><input type="checkbox" id="silh-progress-chk" checked> Interactive mode</p>
</div>
<div id="silh-done-div" class="hidden">
<p>Calculation completed.</p>
<table id="silh-res-todo">
<tr><td><input type="checkbox" id="silh-save-chk" checked> Save result to field: <input type="text" id="silh-col-text"></td></tr>
<tr><td><input type="checkbox" id="silh-export-chk"> Export result to file.</td></tr>
</table>
</div>
</div>
<div></div>
</div>
<div id="silh-table-wrap" class="hidden">
<table id="silh-table">
<thead id="silh-thead"><tr><th>Bin</th><th>#</th><th>Mean</th></tr></thead>
<tbody id="silh-tbody"></tbody>
</table>
</div>
</div>
</div>
</div>
<!-- help window -->
<div id="help-modal" class="modal hidden">
<div class="modal-content" style="width: 600px;">
<div class="modal-head"><span></span><span>Help</span><span></span></div>
<div class="modal-body">
<table style="border-collapse: separate;">
<tr>
<!-- <td rowspan="4" style="padding-right: 25px;"><img src="path/to/logo.png" alt="BinaRena" width="200" height="176"></td> -->
<td><big>BinaRena</big></td>
</tr>
<tr><td>Version: 0.0.1</td></tr>
<tr><td>Main developer: Qiyun Zhu (<a href="mailto:qiyunzhu@gmail.com">qiyunzhu@gmail.com</a>)</td></tr>
<tr><td>Website: <a href="https://github.com/qiyunlab/binarena">https://github.com/qiyunlab/binarena</a></td></tr>
</table>
</div>
</div>
</div>
<!-- scale select dropdown -->
<div id="scale-select" class="popup hidden">
<p><span id="current-scale"></span></p>
<table class="square" id="scale-options">
<tr>
<td title="None (linear)" data-scale="none"><i>x</i></td>
<td title="Rank" data-scale="rank">R</td>
</tr>
<tr>
<td title="Square" data-scale="square"><i>x</i><sup><small>2</small></sup></td>
<td title="Square root" data-scale="sqrt">√<i>x</i></td>
</tr>
<tr>
<td title="Cube" data-scale="cube"><i>x</i><sup><small>3</small></sup></td>
<td title="Cube root" data-scale="cbrt">∛<i>x</i></td>
</tr>
<tr>
<td title="Fourth power" data-scale="4pow"><i>x</i><sup><small>4</small></sup></td>
<td title="Fourth root" data-scale="4rt">∜<i>x</i></td>
</tr>
<tr>
<td title="Logarithm" data-scale="log">log</td>
<td title="Exponential" data-scale="exp"><i>e</i><sup><small><i>x</i></small></sup></td>
</tr>
<tr>
<td title="Logit = log(x/(1-x))" data-scale="logit" style="letter-spacing: -0.08em;">logit</td>
<td title="Arcsine square root" data-scale="asin" style="letter-spacing: -0.05em;">asin</td>
</tr>
</table>
</div>
<!-- palette select dropdown -->
<div id="palette-select" class="popup hidden">
<div class="qual disc hidden"><p>Qualitative</p></div>
<div class="sequ cont hidden"><p>Sequential</p></div>
<div class="sequ disc hidden"><p>Sequential</p></div>
<div class="dive cont hidden"><p>Diverging</p></div>
<div class="dive disc hidden"><p>Diverging</p></div>
</div>
<!-- feature group select dropdown -->
<div id="memlst-select" class="popup hidden">
<table id="memlst-table"></table>
</div>
<!--
generic elements
-->
<!-- toast message -->
<div id="toast" class="hidden">
<span id="toast-msg"></span><!--
--><span id="toast-dots" class="hidden"><span>•</span> <span>•</span> <span>•</span></span><!--
--><button id="toast-close-btn" title="Close message" class="hidden">✕</button>
</div>
<!-- list select dropdown (also for auto-complete textbox) -->
<div id="list-select" class="popup hidden">
<table id="list-options"></table>
</div>
<!-- modals -->
<div id="myModal" class="modal hidden">
<div class="modal-content">
<div class="modal-head">
<span>Left controls</span>
<span>Title</span>
<span>Right controls</span>
</div>
<p>Some text in the Modal...</p>
</div>
</div>
<!-- popup message box -->
<div class="tooltip" id="div-tooltip">
<p id="p-tooltip"></p>
</div>
<!--
hidden elements
-->
<div style="display:none">
<!-- file download link -->
<a id="download-a"></a>
<!-- file I/O cache -->
<textarea id="text-cache"></textarea>
<!-- file upload button -->
<input type="file" id="open-file">
<!-- styles defined by CSS -->
<label id="selection-color">selected color</label>
<label id="polygon-color">polygon color</label>
</div>
</body>
</html>