comparison utils.py @ 7:f13455263ac8 draft default tip

planemo upload for repository https://github.com/goeckslab/Galaxy-Ludwig.git commit e2ab4c0f9ce8b7a0a48f749ef5dd9899d6c2b1f8
author goeckslab
date Sat, 22 Nov 2025 01:17:27 +0000
parents 0a7b83ddda17
children
comparison
equal deleted inserted replaced
6:cda3d431d237 7:f13455263ac8
57 } 57 }
58 th { 58 th {
59 background-color: #4CAF50; 59 background-color: #4CAF50;
60 color: white; 60 color: white;
61 } 61 }
62 /* feature importance layout tweaks */
63 table.feature-importance-table {
64 table-layout: auto;
65 }
66 table.feature-importance-table th,
67 table.feature-importance-table td {
68 white-space: nowrap;
69 word-break: normal;
70 }
71 /* sortable tables */
72 .sortable-table th.sortable {
73 cursor: pointer;
74 position: relative;
75 user-select: none;
76 }
77 .sortable-table th.sortable::after {
78 content: '⇅';
79 position: absolute;
80 right: 12px;
81 top: 50%;
82 transform: translateY(-50%);
83 font-size: 0.8em;
84 color: #eaf5ea;
85 text-shadow: 0 0 1px rgba(0,0,0,0.15);
86 }
87 .sortable-table th.sortable.sorted-none::after { content: '⇅'; color: #eaf5ea; }
88 .sortable-table th.sortable.sorted-asc::after { content: '↑'; color: #ffffff; }
89 .sortable-table th.sortable.sorted-desc::after { content: '↓'; color: #ffffff; }
90 .scroll-rows-30 {
91 max-height: 900px;
92 overflow-y: auto;
93 overflow-x: auto;
94 }
62 .plot { 95 .plot {
63 text-align: center; 96 text-align: center;
64 margin: 20px 0; 97 margin: 20px 0;
65 } 98 }
66 .plot img { 99 .plot img {
67 max-width: 100%; 100 max-width: 100%;
68 height: auto; 101 height: auto;
69 } 102 }
70 </style> 103 </style>
104 <script>
105 (function() {
106 if (window.__sortableInit) return;
107 window.__sortableInit = true;
108
109 function initSortableTables() {
110 document.querySelectorAll('table.sortable-table tbody').forEach(tbody => {
111 Array.from(tbody.rows).forEach((row, i) => { row.dataset.originalOrder = i; });
112 });
113
114 const getText = td => (td?.innerText || '').trim();
115 const cmp = (idx, asc) => (a, b) => {
116 const v1 = getText(a.children[idx]);
117 const v2 = getText(b.children[idx]);
118 const n1 = parseFloat(v1), n2 = parseFloat(v2);
119 if (!isNaN(n1) && !isNaN(n2)) return asc ? n1 - n2 : n2 - n1;
120 return asc ? v1.localeCompare(v2) : v2.localeCompare(v1);
121 };
122
123 document.querySelectorAll('table.sortable-table th.sortable').forEach(th => {
124 th.classList.remove('sorted-asc','sorted-desc');
125 th.classList.add('sorted-none');
126
127 th.addEventListener('click', () => {
128 const table = th.closest('table');
129 const headerRow = th.parentNode;
130 const allTh = headerRow.querySelectorAll('th.sortable');
131 const tbody = table.querySelector('tbody');
132
133 const isAsc = th.classList.contains('sorted-asc');
134 const isDesc = th.classList.contains('sorted-desc');
135
136 allTh.forEach(x => x.classList.remove('sorted-asc','sorted-desc','sorted-none'));
137
138 let next;
139 if (!isAsc && !isDesc) {
140 next = 'asc';
141 } else if (isAsc) {
142 next = 'desc';
143 } else {
144 next = 'none';
145 }
146 th.classList.add('sorted-' + next);
147
148 const rows = Array.from(tbody.rows);
149 if (next === 'none') {
150 rows.sort((a, b) => (a.dataset.originalOrder - b.dataset.originalOrder));
151 } else {
152 const idx = Array.from(headerRow.children).indexOf(th);
153 rows.sort(cmp(idx, next === 'asc'));
154 }
155 rows.forEach(r => tbody.appendChild(r));
156 });
157 });
158 }
159
160 if (document.readyState === 'loading') {
161 document.addEventListener('DOMContentLoaded', initSortableTables);
162 } else {
163 initSortableTables();
164 }
165 })();
166 </script>
71 </head> 167 </head>
72 <body> 168 <body>
73 <div class="container"> 169 <div class="container">
74 """ 170 """
75 171