phenotypic.abc_.FigureProvider#
- class phenotypic.abc_.FigureProvider[source]#
Bases:
objectMixin turning
@figuremethods into.inspect()/.dash()/ a dashboard.Methods only — no fields, no
__init__, no instance state — so it is safe to mix into anypydantic.BaseModelin any MRO position (mirrorsLazyWidgetMixin). Mix it into the concrete class that owns the@figuremethods:class DiagnosticsPlotter(BasePlotter, FigureProvider): ... class MeasureSymmetricZones(MeasureFeatures, FigureProvider): ...
- Subject binding:
Helpers hold their subject — override
_figure_subject()to return it; their@figuremethods readselfand take no subject.Operations pass the subject at call time (
op.dash(image)); their@figuremethods take it as the first positional parameter.
Methods
__init__The interactive view.
Bind
subject→ a transientBoundFiguresthe Dash adapter consumes.The primary saveable
go.Figure.All
@figurespecs on this instance's class, in definition order.- iter_figures() list[FigureSpec][source]#
All
@figurespecs on this instance’s class, in definition order.Walks the MRO so inherited figures are included. Normal Python override semantics apply: a subclass method without
@figureshadows and removes the inherited figure, while a redecorated override keeps the inherited figure’s original position.- Return type:
- inspect(subject: Any = None, *, for_save: bool = False, **overrides: Any) go.Figure[source]#
The primary saveable
go.Figure.This is the default
inspect()contract used by control-free helpers and by the CLI’s--save-inspect. Classes that hand-write their owninspect(e.g.MeasureSymmetricZones) override this naturally.- Parameters:
subject (Any) – Subject to render against (operations);
Noneuses the held subject (helpers).for_save (bool) – Forwarded to the figure method if it accepts
for_save(so legend-only layers can be flattened for a static raster).**overrides (Any) – Override control defaults by keyword.
- Returns:
The themed primary
plotly.graph_objects.Figure.- Return type:
go.Figure
- dash(subject: Any = None) Any[source]#
The interactive view.
No
Controlanywhere → a composed subplotgo.Figure(preserving the repo-wide.dash() -> go.Figurecontract).Any
Controlpresent → the ipywidgets notebook dashboard.
- figures(subject: Any = None) BoundFigures[source]#
Bind
subject→ a transientBoundFiguresthe Dash adapter consumes. The per-render cache lives on the returned object, not here.- Parameters:
subject (Any)
- Return type: