phenotypic.abc_.Control#
- class phenotypic.abc_.Control(label: str, kind: Literal['float', 'select', 'bool', 'text'], default: Any, bounds: tuple[float, float] | None = None, step: float | None = None, options: tuple[Any, ...] | None = None, help: str | None = None)[source]#
Bases:
objectRenderer-neutral input bound to a figure method’s keyword argument.
Bound by identity: the same instance referenced by several
@figuremethods renders as one shared widget; distinct instances (even with the samelabel) are independent widgets. There is no global name namespace, so two unrelated figures may each have asigmakwarg without colliding.- Parameters:
label (str) – Human-readable widget label.
kind (Literal['float', 'select', 'bool', 'text']) – One of
"float","select","bool","text".default (Any) – Initial value. Must be consistent with
kind(withinboundsforfloat; a member ofoptionsforselect; aboolforbool).bounds (tuple[float, float] | None) –
(low, high)range — required for"float".step (float | None) – Optional slider step for
"float".options (tuple[Any, ...] | None) – Allowed values — required for
"select".help (str | None) – Optional tooltip text.
- Raises:
ValueError – If the kind-specific requirements are not met.
Methods
__init__Attributes