Mercurial > repos > goeckslab > image_learner
annotate utils.py @ 11:c5150cceab47 draft default tip
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
| author | goeckslab | 
|---|---|
| date | Sat, 18 Oct 2025 03:17:09 +0000 | 
| parents | b0d893d04d4c | 
| children | 
| rev | line source | 
|---|---|
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 1 import base64 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 2 import json | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 3 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 4 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 5 def get_html_template(): | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 6 """ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 7 Returns the opening HTML, <head> (with CSS/JS), and opens <body> + .container. | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 8 Includes: | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 9 - Base styling for layout and tables | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 10 - Sortable table headers with 3-state arrows (none ⇅, asc ↑, desc ↓) | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 11 - A scroll helper class (.scroll-rows-30) that approximates ~30 visible rows | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 12 - A guarded script so initializing runs only once even if injected twice | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 13 """ | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 14 return """ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 15 <!DOCTYPE html> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 16 <html> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 17 <head> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 18 <meta charset="UTF-8"> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 19 <title>Galaxy-Ludwig Report</title> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 20 <style> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 21 body { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 22 font-family: Arial, sans-serif; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 23 margin: 0; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 24 padding: 20px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 25 background-color: #f4f4f4; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 26 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 27 .container { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 28 max-width: 1200px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 29 margin: auto; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 30 background: white; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 31 padding: 20px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 32 box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 33 overflow-x: auto; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 34 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 35 h1 { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 36 text-align: center; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 37 color: #333; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 38 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 39 h2 { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 40 border-bottom: 2px solid #4CAF50; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 41 color: #4CAF50; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 42 padding-bottom: 5px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 43 margin-top: 28px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 44 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 45 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 46 /* baseline table setup */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 47 table { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 48 border-collapse: collapse; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 49 margin: 20px 0; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 50 width: 100%; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 51 table-layout: fixed; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 52 background: #fff; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 53 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 54 table, th, td { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 55 border: 1px solid #ddd; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 56 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 57 th, td { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 58 padding: 10px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 59 text-align: center; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 60 vertical-align: middle; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 61 word-break: break-word; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 62 white-space: normal; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 63 overflow-wrap: anywhere; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 64 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 65 th { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 66 background-color: #4CAF50; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 67 color: white; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 68 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 69 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 70 .plot { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 71 text-align: center; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 72 margin: 20px 0; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 73 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 74 .plot img { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 75 max-width: 100%; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 76 height: auto; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 77 border: 1px solid #ddd; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 78 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 79 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 80 /* ------------------- | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 81 sortable columns (3-state: none ⇅, asc ↑, desc ↓) | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 82 ------------------- */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 83 table.performance-summary th.sortable { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 84 cursor: pointer; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 85 position: relative; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 86 user-select: none; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 87 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 88 /* default icon space */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 89 table.performance-summary th.sortable::after { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 90 content: '⇅'; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 91 position: absolute; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 92 right: 12px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 93 top: 50%; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 94 transform: translateY(-50%); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 95 font-size: 0.8em; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 96 color: #eaf5ea; /* light on green */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 97 text-shadow: 0 0 1px rgba(0,0,0,0.15); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 98 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 99 /* three states override the default */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 100 table.performance-summary th.sortable.sorted-none::after { content: '⇅'; color: #eaf5ea; } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 101 table.performance-summary th.sortable.sorted-asc::after { content: '↑'; color: #ffffff; } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 102 table.performance-summary th.sortable.sorted-desc::after { content: '↓'; color: #ffffff; } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 103 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 104 /* show ~30 rows with a scrollbar (tweak if you want) */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 105 .scroll-rows-30 { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 106 max-height: 900px; /* ~30 rows depending on row height */ | 
| 11 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 107 overflow-y: auto; /* vertical scrollbar ("sidebar") */ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 108 overflow-x: auto; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 109 } | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 110 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 111 /* Tabs + Help button (used by build_tabbed_html) */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 112 .tabs { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 113 display: flex; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 114 align-items: center; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 115 border-bottom: 2px solid #ccc; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 116 margin-bottom: 1rem; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 117 gap: 6px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 118 flex-wrap: wrap; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 119 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 120 .tab { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 121 padding: 10px 20px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 122 cursor: pointer; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 123 border: 1px solid #ccc; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 124 border-bottom: none; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 125 background: #f9f9f9; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 126 margin-right: 5px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 127 border-top-left-radius: 8px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 128 border-top-right-radius: 8px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 129 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 130 .tab.active { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 131 background: white; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 132 font-weight: bold; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 133 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 134 .help-btn { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 135 margin-left: auto; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 136 padding: 6px 12px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 137 font-size: 0.9rem; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 138 border: 1px solid #4CAF50; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 139 border-radius: 4px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 140 background: #4CAF50; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 141 color: white; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 142 cursor: pointer; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 143 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 144 .tab-content { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 145 display: none; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 146 padding: 20px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 147 border: 1px solid #ccc; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 148 border-top: none; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 149 background: #fff; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 150 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 151 .tab-content.active { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 152 display: block; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 153 } | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 154 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 155 /* Modal (used by get_metrics_help_modal) */ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 156 .modal { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 157 display: none; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 158 position: fixed; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 159 z-index: 9999; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 160 left: 0; top: 0; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 161 width: 100%; height: 100%; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 162 overflow: auto; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 163 background-color: rgba(0,0,0,0.4); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 164 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 165 .modal-content { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 166 background-color: #fefefe; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 167 margin: 8% auto; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 168 padding: 20px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 169 border: 1px solid #888; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 170 width: 90%; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 171 max-width: 900px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 172 border-radius: 8px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 173 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 174 .modal .close { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 175 color: #777; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 176 float: right; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 177 font-size: 28px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 178 font-weight: bold; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 179 line-height: 1; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 180 margin-left: 8px; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 181 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 182 .modal .close:hover, | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 183 .modal .close:focus { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 184 color: black; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 185 text-decoration: none; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 186 cursor: pointer; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 187 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 188 .metrics-guide h3 { margin-top: 20px; } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 189 .metrics-guide p { margin: 6px 0; } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 190 .metrics-guide ul { margin: 10px 0; padding-left: 20px; } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 191 </style> | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 192 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 193 <script> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 194 // Guard to avoid double-initialization if this block is included twice | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 195 (function(){ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 196 if (window.__perfSummarySortInit) return; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 197 window.__perfSummarySortInit = true; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 198 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 199 function initPerfSummarySorting() { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 200 // Record original order for "back to original" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 201 document.querySelectorAll('table.performance-summary tbody').forEach(tbody => { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 202 Array.from(tbody.rows).forEach((row, i) => { row.dataset.originalOrder = i; }); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 203 }); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 204 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 205 const getText = td => (td?.innerText || '').trim(); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 206 const cmp = (idx, asc) => (a, b) => { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 207 const v1 = getText(a.children[idx]); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 208 const v2 = getText(b.children[idx]); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 209 const n1 = parseFloat(v1), n2 = parseFloat(v2); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 210 if (!isNaN(n1) && !isNaN(n2)) return asc ? n1 - n2 : n2 - n1; // numeric | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 211 return asc ? v1.localeCompare(v2) : v2.localeCompare(v1); // lexical | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 212 }; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 213 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 214 document.querySelectorAll('table.performance-summary th.sortable').forEach(th => { | 
| 11 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 215 // initialize to "none" | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 216 th.classList.remove('sorted-asc','sorted-desc'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 217 th.classList.add('sorted-none'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 218 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 219 th.addEventListener('click', () => { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 220 const table = th.closest('table'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 221 const headerRow = th.parentNode; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 222 const allTh = headerRow.querySelectorAll('th.sortable'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 223 const tbody = table.querySelector('tbody'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 224 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 225 // Determine current state BEFORE clearing | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 226 const isAsc = th.classList.contains('sorted-asc'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 227 const isDesc = th.classList.contains('sorted-desc'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 228 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 229 // Reset all headers in this row | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 230 allTh.forEach(x => x.classList.remove('sorted-asc','sorted-desc','sorted-none')); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 231 | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 232 // Compute next state | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 233 let next; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 234 if (!isAsc && !isDesc) { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 235 next = 'asc'; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 236 } else if (isAsc) { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 237 next = 'desc'; | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 238 } else { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 239 next = 'none'; | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 240 } | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 241 th.classList.add('sorted-' + next); | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 242 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 243 // Sort rows according to the chosen state | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 244 const rows = Array.from(tbody.rows); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 245 if (next === 'none') { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 246 rows.sort((a, b) => (a.dataset.originalOrder - b.dataset.originalOrder)); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 247 } else { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 248 const idx = Array.from(headerRow.children).indexOf(th); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 249 rows.sort(cmp(idx, next === 'asc')); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 250 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 251 rows.forEach(r => tbody.appendChild(r)); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 252 }); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 253 }); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 254 } | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 255 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 256 // Run after DOM is ready | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 257 if (document.readyState === 'loading') { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 258 document.addEventListener('DOMContentLoaded', initPerfSummarySorting); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 259 } else { | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 260 initPerfSummarySorting(); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 261 } | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 262 })(); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 263 </script> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 264 </head> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 265 <body> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 266 <div class="container"> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 267 """ | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 268 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 269 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 270 def get_html_closing(): | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 271 """Closes .container, body, and html.""" | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 272 return """ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 273 </div> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 274 </body> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 275 </html> | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 276 """ | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 277 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 278 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 279 def encode_image_to_base64(image_path: str) -> str: | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 280 """Convert an image file to a base64 encoded string.""" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 281 with open(image_path, "rb") as img_file: | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 282 return base64.b64encode(img_file.read()).decode("utf-8") | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 283 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 284 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 285 def json_to_nested_html_table(json_data, depth: int = 0) -> str: | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 286 """ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 287 Convert a JSON-able object to an HTML nested table. | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 288 Renders dicts as two-column tables (key/value) and lists as index/value rows. | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 289 """ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 290 # Base case: flat dict (no nested dict/list values) | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 291 if isinstance(json_data, dict) and all( | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 292 not isinstance(v, (dict, list)) for v in json_data.values() | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 293 ): | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 294 rows = [ | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 295 f"<tr><th>{key}</th><td>{value}</td></tr>" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 296 for key, value in json_data.items() | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 297 ] | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 298 return f"<table>{''.join(rows)}</table>" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 299 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 300 # Base case: list of simple values | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 301 if isinstance(json_data, list) and all( | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 302 not isinstance(v, (dict, list)) for v in json_data | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 303 ): | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 304 rows = [ | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 305 f"<tr><th>Index {i}</th><td>{value}</td></tr>" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 306 for i, value in enumerate(json_data) | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 307 ] | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 308 return f"<table>{''.join(rows)}</table>" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 309 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 310 # Recursive cases | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 311 if isinstance(json_data, dict): | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 312 rows = [ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 313 ( | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 314 f"<tr><th style='text-align:left;padding-left:{depth * 20}px;'>{key}</th>" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 315 f"<td>{json_to_nested_html_table(value, depth + 1)}</td></tr>" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 316 ) | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 317 for key, value in json_data.items() | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 318 ] | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 319 return f"<table>{''.join(rows)}</table>" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 320 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 321 if isinstance(json_data, list): | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 322 rows = [ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 323 ( | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 324 f"<tr><th style='text-align:left;padding-left:{depth * 20}px;'>[{i}]</th>" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 325 f"<td>{json_to_nested_html_table(value, depth + 1)}</td></tr>" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 326 ) | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 327 for i, value in enumerate(json_data) | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 328 ] | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 329 return f"<table>{''.join(rows)}</table>" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 330 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 331 # Primitive | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 332 return f"{json_data}" | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 333 | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 334 | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 335 def json_to_html_table(json_data) -> str: | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 336 """ | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 337 Convert JSON (dict or string) into a vertically oriented HTML table. | 
| 0 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 338 """ | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 339 if isinstance(json_data, str): | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 340 json_data = json.loads(json_data) | 
| 
54b871dfc51e
planemo upload for repository https://github.com/goeckslab/gleam.git commit b7411ff35b6228ccdfd36cd4ebd946c03ac7f7e9
 goeckslab parents: diff
changeset | 341 return json_to_nested_html_table(json_data) | 
| 2 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 342 | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 343 | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 344 def build_tabbed_html(metrics_html: str, train_val_html: str, test_html: str) -> str: | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 345 """ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 346 Build a 3-tab interface: | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 347 - Config and Results Summary | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 348 - Train/Validation Results | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 349 - Test Results | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 350 Includes a persistent "Help" button that toggles the metrics modal. | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 351 """ | 
| 2 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 352 return f""" | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 353 <div class="tabs"> | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 354 <div class="tab active" onclick="showTab('metrics')">Config and Results Summary</div> | 
| 2 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 355 <div class="tab" onclick="showTab('trainval')">Train/Validation Results</div> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 356 <div class="tab" onclick="showTab('test')">Test Results</div> | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 357 <button id="openMetricsHelp" class="help-btn" title="Open metrics help">Help</button> | 
| 2 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 358 </div> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 359 | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 360 <div id="metrics" class="tab-content active"> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 361 {metrics_html} | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 362 </div> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 363 <div id="trainval" class="tab-content"> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 364 {train_val_html} | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 365 </div> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 366 <div id="test" class="tab-content"> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 367 {test_html} | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 368 </div> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 369 | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 370 <script> | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 371 function showTab(id) {{ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 372 document.querySelectorAll('.tab-content').forEach(el => el.classList.remove('active')); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 373 document.querySelectorAll('.tab').forEach(el => el.classList.remove('active')); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 374 document.getElementById(id).classList.add('active'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 375 // find tab with matching onclick target | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 376 document.querySelectorAll('.tab').forEach(t => {{ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 377 if (t.getAttribute('onclick') && t.getAttribute('onclick').includes(id)) {{ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 378 t.classList.add('active'); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 379 }} | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 380 }}); | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 381 }} | 
| 2 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 382 </script> | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 383 """ | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 384 | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 385 | 
| 
186424a7eca7
planemo upload for repository https://github.com/goeckslab/gleam.git commit 91fa4aba245520fc0680088a07cead66bcfd4ed2
 goeckslab parents: 
1diff
changeset | 386 def get_metrics_help_modal() -> str: | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 387 """ | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 388 Returns a ready-to-use modal with a comprehensive metrics guide and | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 389 the small script that wires the "Help" button to open/close the modal. | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 390 """ | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 391 modal_html = ( | 
| 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 392 '<div id="metricsHelpModal" class="modal">' | 
| 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 393 ' <div class="modal-content">' | 
| 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 394 ' <span class="close">×</span>' | 
| 9 
9e912fce264c
planemo upload for repository https://github.com/goeckslab/gleam.git commit eace0d7c2b2939029c052991d238a54947d2e191
 goeckslab parents: 
8diff
changeset | 395 " <h2>Model Evaluation Metrics — Help Guide</h2>" | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 396 ' <div class="metrics-guide">' | 
| 11 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 397 ' <h3>1) General Metrics (Regression and Classification)</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 398 ' <p><strong>Loss (Regression & Classification):</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 399 'Measures the difference between predicted and actual values, ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 400 'optimized during training. Lower is better. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 401 'For regression, this is often Mean Squared Error (MSE) or ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 402 'Mean Absolute Error (MAE). For classification, it\'s typically ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 403 'cross-entropy or log loss.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 404 ' <h3>2) Regression Metrics</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 405 ' <p><strong>Mean Absolute Error (MAE):</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 406 'Average of absolute differences between predicted and actual values, ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 407 'in the same units as the target. Use for interpretable error measurement ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 408 'when all errors are equally important. Less sensitive to outliers than MSE.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 409 ' <p><strong>Mean Squared Error (MSE):</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 410 'Average of squared differences between predicted and actual values. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 411 'Penalizes larger errors more heavily, useful when large deviations are critical. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 412 'Often used as the loss function in regression.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 413 ' <p><strong>Root Mean Squared Error (RMSE):</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 414 'Square root of MSE, in the same units as the target. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 415 'Balances interpretability and sensitivity to large errors. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 416 'Widely used for regression evaluation.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 417 ' <p><strong>Mean Absolute Percentage Error (MAPE):</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 418 'Average absolute error as a percentage of actual values. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 419 'Scale-independent, ideal for comparing relative errors across datasets. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 420 'Avoid when actual values are near zero.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 421 ' <p><strong>Root Mean Squared Percentage Error (RMSPE):</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 422 'Square root of mean squared percentage error. Scale-independent, ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 423 'penalizes larger relative errors more than MAPE. Use for forecasting ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 424 'or when relative accuracy matters.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 425 ' <p><strong>R² Score:</strong> Proportion of variance in the target ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 426 'explained by the model. Ranges from negative infinity to 1 (perfect prediction). ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 427 'Use to assess model fit; negative values indicate poor performance ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 428 'compared to predicting the mean.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 429 ' <h3>3) Classification Metrics</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 430 ' <p><strong>Accuracy:</strong> Proportion of correct predictions ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 431 'among all predictions. Simple but misleading for imbalanced datasets, ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 432 'where high accuracy may hide poor performance on minority classes.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 433 ' <p><strong>Micro Accuracy:</strong> Sums true positives and true negatives ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 434 'across all classes before computing accuracy. Suitable for multiclass or ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 435 'multilabel problems with imbalanced data.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 436 ' <p><strong>Token Accuracy:</strong> Measures how often predicted tokens ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 437 '(e.g., in sequences) match true tokens. Common in NLP tasks like text generation ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 438 'or token classification.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 439 ' <p><strong>Precision:</strong> Proportion of positive predictions that are ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 440 'correct (TP / (TP + FP)). Use when false positives are costly, e.g., spam detection.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 441 ' <p><strong>Recall (Sensitivity):</strong> Proportion of actual positives ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 442 'correctly predicted (TP / (TP + FN)). Use when missing positives is risky, ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 443 'e.g., disease detection.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 444 ' <p><strong>Specificity:</strong> True negative rate (TN / (TN + FP)). ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 445 'Measures ability to identify negatives. Useful in medical testing to avoid ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 446 'false alarms.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 447 ' <h3>4) Classification: Macro, Micro, and Weighted Averages</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 448 ' <p><strong>Macro Precision / Recall / F1:</strong> Averages the metric ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 449 'across all classes, treating each equally. Best for balanced datasets where ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 450 'all classes are equally important.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 451 ' <p><strong>Micro Precision / Recall / F1:</strong> Aggregates true positives, ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 452 'false positives, and false negatives across all classes before computing. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 453 'Ideal for imbalanced or multilabel classification.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 454 ' <p><strong>Weighted Precision / Recall / F1:</strong> Averages metrics ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 455 'across classes, weighted by the number of true instances per class. Balances ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 456 'class importance based on frequency.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 457 ' <h3>5) Classification: Average Precision (PR-AUC Variants)</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 458 ' <p><strong>Average Precision Macro:</strong> Precision-Recall AUC averaged ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 459 'equally across classes. Use for balanced multiclass problems.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 460 ' <p><strong>Average Precision Micro:</strong> Global Precision-Recall AUC ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 461 'using all instances. Best for imbalanced or multilabel classification.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 462 ' <p><strong>Average Precision Samples:</strong> Precision-Recall AUC averaged ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 463 'across individual samples. Ideal for multilabel tasks where samples have multiple ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 464 'labels.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 465 ' <h3>6) Classification: ROC-AUC Variants</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 466 ' <p><strong>ROC-AUC:</strong> Measures ability to distinguish between classes. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 467 'AUC = 1 is perfect; 0.5 is random guessing. Use for binary classification.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 468 ' <p><strong>Macro ROC-AUC:</strong> Averages AUC across all classes equally. ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 469 'Suitable for balanced multiclass problems.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 470 ' <p><strong>Micro ROC-AUC:</strong> Computes AUC from aggregated predictions ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 471 'across all classes. Useful for imbalanced or multilabel settings.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 472 ' <h3>7) Classification: Confusion Matrix Stats (Per Class)</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 473 ' <p><strong>True Positives / Negatives (TP / TN):</strong> Correct predictions ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 474 'for positives and negatives, respectively.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 475 ' <p><strong>False Positives / Negatives (FP / FN):</strong> Incorrect predictions ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 476 '— false alarms and missed detections.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 477 ' <h3>8) Classification: Ranking Metrics</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 478 ' <p><strong>Hits at K:</strong> Measures whether the true label is among the ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 479 'top-K predictions. Common in recommendation systems and retrieval tasks.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 480 ' <h3>9) Other Metrics (Classification)</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 481 ' <p><strong>Cohen\'s Kappa:</strong> Measures agreement between predicted and ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 482 'actual labels, adjusted for chance. Useful for multiclass classification with ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 483 'imbalanced data.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 484 ' <p><strong>Matthews Correlation Coefficient (MCC):</strong> Balanced measure ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 485 'using TP, TN, FP, and FN. Effective for imbalanced datasets.</p>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 486 ' <h3>10) Metric Recommendations</h3>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 487 ' <ul>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 488 ' <li><strong>Regression:</strong> Use <strong>RMSE</strong> or ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 489 '<strong>MAE</strong> for general evaluation, <strong>MAPE</strong> for relative ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 490 'errors, and <strong>R²</strong> to assess model fit. Use <strong>MSE</strong> or ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 491 '<strong>RMSPE</strong> when large errors are critical.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 492 ' <li><strong>Classification (Balanced Data):</strong> Use <strong>Accuracy</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 493 'and <strong>F1</strong> for overall performance.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 494 ' <li><strong>Classification (Imbalanced Data):</strong> Use <strong>Precision</strong>, ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 495 '<strong>Recall</strong>, and <strong>ROC-AUC</strong> to focus on minority class ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 496 'performance.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 497 ' <li><strong>Multilabel or Imbalanced Classification:</strong> Use ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 498 '<strong>Micro Precision/Recall/F1</strong> or <strong>Micro ROC-AUC</strong>.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 499 ' <li><strong>Balanced Multiclass:</strong> Use <strong>Macro Precision/Recall/F1</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 500 'or <strong>Macro ROC-AUC</strong>.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 501 ' <li><strong>Class Frequency Matters:</strong> Use <strong>Weighted Precision/Recall/F1</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 502 'to account for class imbalance.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 503 ' <li><strong>Recommendation/Ranking:</strong> Use <strong>Hits at K</strong> for retrieval tasks.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 504 ' <li><strong>Detailed Analysis:</strong> Use <strong>Confusion Matrix stats</strong> ' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 505 'for class-wise performance in classification.</li>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 506 ' </ul>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 507 ' </div>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 508 ' </div>' | 
| 
c5150cceab47
planemo upload for repository https://github.com/goeckslab/gleam.git commit 0fe927b618cd4dfc87af7baaa827034cc6813225
 goeckslab parents: 
10diff
changeset | 509 '</div>' | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 510 ) | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 511 | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 512 modal_js = ( | 
| 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 513 "<script>" | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 514 "document.addEventListener('DOMContentLoaded', function() {" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 515 " var modal = document.getElementById('metricsHelpModal');" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 516 " var openBtn = document.getElementById('openMetricsHelp');" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 517 " var closeBtn = modal ? modal.querySelector('.close') : null;" | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 518 " if (openBtn && modal) {" | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 519 " openBtn.addEventListener('click', function(){ modal.style.display = 'block'; });" | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 520 " }" | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 521 " if (closeBtn && modal) {" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 522 " closeBtn.addEventListener('click', function(){ modal.style.display = 'none'; });" | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 523 " }" | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 524 " window.addEventListener('click', function(ev){" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 525 " if (ev.target === modal) { modal.style.display = 'none'; }" | 
| 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 526 " });" | 
| 8 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 527 "});" | 
| 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 528 "</script>" | 
| 
85e6f4b2ad18
planemo upload for repository https://github.com/goeckslab/gleam.git commit 8a42eb9b33df7e1df5ad5153b380e20b910a05b6
 goeckslab parents: 
2diff
changeset | 529 ) | 
| 10 
b0d893d04d4c
planemo upload for repository https://github.com/goeckslab/gleam.git commit 1594d503179f28987720594eb49b48a15486f073
 goeckslab parents: 
9diff
changeset | 530 return modal_html + modal_js | 
