thumbnail_cell
anomaly_match_ui.widgets.thumbnail_cell
¶
Single thumbnail cell for the prediction gallery.
ThumbnailCell(on_magnify=None, on_star=None)
¶
A single image thumbnail with filename, score, and action buttons.
Displays a 200x200 preview image with an overlay bar containing magnify button, score label, and star button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
on_magnify
|
Callable[[str], None] | None
|
Callback invoked with the filename when magnify is clicked. |
None
|
on_star
|
Callable[[str], None] | None
|
Callback invoked with the filename when star is clicked. |
None
|
Source code in anomaly_match_ui/widgets/thumbnail_cell.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
update(filename, score, image_bytes, esasky_url=None, display_name=None)
¶
Refresh the cell with new image data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The source filename, passed back to |
required |
score
|
float
|
The anomaly score. |
required |
image_bytes
|
bytes
|
PNG-encoded image bytes. |
required |
esasky_url
|
str | None
|
Optional ESASky URL. Shows globe button when set. |
None
|
display_name
|
str | None
|
Caption text to show instead of filename, for callers whose real id is misleading to show verbatim (e.g. a Zarr source id carrying a pre-conversion file extension). Defaults to filename. |
None
|
Source code in anomaly_match_ui/widgets/thumbnail_cell.py
mark_loading(filename=None, score=None)
¶
Show a loading spinner in the image slot without resizing the cell.
The spinner occupies the same square box the image will fill, so paging to an uncached image shows an in-place spinner that the pixels replace without a layout jump. When filename is known the overlay bar (magnify / score / star) is shown too so the user can act on the cell while it streams in; a bare call (page just flipped, metadata not yet queried) shows only the spinner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str | None
|
Source filename, or |
None
|
score
|
float | None
|
Anomaly score, or |
None
|
Source code in anomaly_match_ui/widgets/thumbnail_cell.py
clear()
¶
Reset the cell to an empty placeholder.