Skip to content

PreviewSpec

🛈 DocStrings

An open params form with live preview.

mode="add": a new step of op_id on inputs (normally (target,)); mode="edit": new params for the existing node target (inputs = its parents). params=None until the form has valid values.

Source code in src/datacook/app/state.py
@dataclass(frozen=True, slots=True)
class PreviewSpec:
    """An open params form with live preview.

    `mode="add"`: a new step of `op_id` on `inputs` (normally `(target,)`); `mode="edit"`:
    new params for the existing node `target` (inputs = its parents). `params=None` until
    the form has valid values.
    """

    mode: Literal["add", "edit"]
    op_id: str
    target: str | None
    inputs: tuple[str, ...]
    params: Params | None = None

:fa-brands-github: Show source on GitHub