Visualization¶
The visualization widget contract in
lightfall.visualization.base_visualization. Visualizations are widgets
that read from a Tiled BlueskyRun entry; the Visualization panel scores
the available widget classes against an incoming run and instantiates the
best match.
from lightfall.visualization.base_visualization import BaseVisualization
BaseVisualization¶
BaseVisualization extends QWidget and defines a seven-method abstract
contract. The controller (VisualizationPanel) orchestrates the selection
flow in this order:
can_handle(run)— score every candidate classset_run(run)— bind the winning instance to the runget_streams()— populate the stream comboset_stream(name)— display (auto-picks the best field)get_fields()— populate the field comboset_field(name)— user override of the fieldrefresh()— polled on a timer for live runs
Subclasses must also define class-level metadata:
Attribute |
Description |
|---|---|
|
Unique identifier (e.g. |
|
UI label (e.g. |
|
Icon name (default |
The contract¶
Method |
Contract |
|---|---|
|
Static method. Score 0–100 for how well this visualization handles the given run. The panel picks the highest scorer. |
|
Bind the Tiled |
|
Stream names, sorted by this visualization’s preference. |
|
Select a stream: read its metadata, auto-pick the best field, render. |
|
Field names for the current stream, sorted by preference. |
|
Switch to a different field within the current stream. |
|
Poll for new data during a live run. Must be a no-op for completed runs. |
__init__ stores self._run, self._stream_name, and self._field_name
(empty until set); call super().__init__(parent) from subclasses.
🖼️ Image placeholder — Screenshot: the Visualization panel during a live scan, with the stream and field combo boxes and an active plot widget.
Built-in visualizations¶
The Visualization panel currently selects from a fixed set of built-in
widget classes (lightfall.visualization.widgets): image stack, 1-D plot,
heatmap, scatter, table, and the adaptive-experiment heatmap and plot.
Plugin visualizations: current status¶
Infrastructure for plugin-provided visualizations exists but is not yet wired end to end on this branch:
VisualizationRegistry(lightfall.visualization.registry.VisualizationRegistry) is a thread-safe singleton withregister_visualization(),get_visualization(),get_all_visualizations(), and introspection.PluginLoadercontains a registration branch for a"visualization"plugin type that registers instances with this registry.
However, there is no VisualizationPlugin base class, the
"visualization" type is not registered during application startup (so
manifest entries of that type are skipped), and VisualizationPanel
selects only from the built-in widget list — it does not consult
VisualizationRegistry. Custom visualizations therefore cannot yet be
added by a plugin; subclassing BaseVisualization is the contract that
panel wiring will build on.