Commit a4fb707
feat: Add component sorting by any metric in metrics.tsv (#125)
* feat: Add component sorting by any metric via clickable table headers (#124)
- Clicking a column header sorts the component table by that metric (desc → asc → clear)
- Active sort column is highlighted in blue with ↑/↓ indicator
- Arrow-key figure navigation follows the same sorted order
- Sort preference persists across page reloads via localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: Show all metrics in table and prevent scroll-jump on arrow key navigation
- Replace DISPLAY_COLUMNS whitelist with PRIORITY_COLUMNS that includes all
labeled metrics (normalized variance explained, countsigFT2, countsigFS0,
signal-noise_p, optimal sign, variance explained rank, rationale); any
additional TSV columns are appended after the priority list
- Replace row.scrollIntoView() with container.scrollTo() so arrow-key
navigation only scrolls within the metrics table, not the whole page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: Address Copilot review comments on sorting feature
- Fix string-column sort: use localeCompare instead of subtraction to
avoid NaN when sorting Component, classification, tags, etc.
- Fix null handling: push missing values to end instead of treating as 0
- Fix cleared-sort table order: sortedIndices now returns original TSV
order when no sort column is active (keyboard arrow navigation still
uses pieData grouping as before)
- Fix sortedIndices empty-array falsy bug: guard with Array.isArray +
length check before using sortedIndices in table body
- Fix accessibility: move sort onClick from <th> to a <button> inside
each header; add aria-sort attribute to active column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 79252c9 commit a4fb707
2 files changed
Lines changed: 169 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | | - | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
73 | | - | |
| 81 | + | |
74 | 82 | | |
75 | | - | |
| 83 | + | |
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
79 | | - | |
80 | | - | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
84 | | - | |
85 | 89 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
94 | | - | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | | - | |
98 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| |||
217 | 223 | | |
218 | 224 | | |
219 | 225 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
238 | 286 | | |
239 | 287 | | |
240 | 288 | | |
241 | | - | |
242 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
243 | 295 | | |
244 | 296 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
249 | 301 | | |
250 | | - | |
| 302 | + | |
251 | 303 | | |
252 | 304 | | |
253 | 305 | | |
254 | 306 | | |
255 | 307 | | |
256 | 308 | | |
257 | 309 | | |
258 | | - | |
| 310 | + | |
259 | 311 | | |
260 | 312 | | |
261 | 313 | | |
| |||
264 | 316 | | |
265 | 317 | | |
266 | 318 | | |
267 | | - | |
| 319 | + | |
268 | 320 | | |
269 | 321 | | |
270 | 322 | | |
| |||
290 | 342 | | |
291 | 343 | | |
292 | 344 | | |
293 | | - | |
| 345 | + | |
294 | 346 | | |
295 | 347 | | |
296 | 348 | | |
| |||
299 | 351 | | |
300 | 352 | | |
301 | 353 | | |
302 | | - | |
303 | 354 | | |
304 | 355 | | |
305 | 356 | | |
306 | | - | |
| 357 | + | |
307 | 358 | | |
308 | 359 | | |
309 | 360 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
72 | 80 | | |
73 | 81 | | |
74 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
75 | 91 | | |
76 | 92 | | |
77 | 93 | | |
| |||
257 | 273 | | |
258 | 274 | | |
259 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
260 | 318 | | |
261 | 319 | | |
262 | 320 | | |
263 | 321 | | |
264 | 322 | | |
265 | 323 | | |
266 | 324 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
272 | 329 | | |
273 | 330 | | |
274 | 331 | | |
275 | 332 | | |
276 | | - | |
| 333 | + | |
277 | 334 | | |
278 | 335 | | |
279 | 336 | | |
280 | 337 | | |
281 | 338 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
287 | 343 | | |
288 | 344 | | |
289 | 345 | | |
290 | 346 | | |
291 | | - | |
| 347 | + | |
292 | 348 | | |
293 | 349 | | |
294 | 350 | | |
| |||
614 | 670 | | |
615 | 671 | | |
616 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
617 | 677 | | |
618 | 678 | | |
619 | 679 | | |
| |||
0 commit comments