All docs
Docs/ API Reference/ lsdtools.views reference
API Reference

lsdtools.views reference

Generated public SDK reference for lsdtools.views.

SDK distribution 1.0.0; API contract 1.0; generator 1.0.0.

Product source digest: 4ea39055732e8883c03ccfecf12af6ccebd2041a12ce1b843e4a769e200f5ef9.

Generated from declared public exports and source syntax. Signatures and annotations are declaration spellings; decorators, factories and annotations are never executed. Class members below are declared members; base classes remain explicit. Source docstrings describe their owning implementation; they do not grant app permissions.

text
``lsdtools.views`` — the data-view façade. Lazy imports (the ``generate_step`` pattern): importing
``lsdtools`` never drags a view package (or cairo/GTK) into the process; each factory imports its
package on first use and raises a clear error if it is not installed.

    from lsdtools import views
    v = views.table(my_table)                    # a TableView, fed
    c = views.chart(kind="line", title="Loss")
    f = views.flowchart("A\n  B\n  C")
    print(v.to_text()); c.to_image("chart.png")

A custom data view registers its GTK drawing shell here — the one sanctioned place a package writes
GTK. In your view's ``gtk`` module (loaded via the ``lsd.view_gtk`` entry point)::

    from lsdtools.views import set_view_shell
    set_view_shell("my.kind", build_my_shell)     # build_my_shell(view) -> a Gtk.Widget

lsdtools.views.HierarchyActionChoice#

Kind: class. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:113.

Source docstring:

text
One fresh exact input choice for a hierarchy View action.

Renderers must enumerate choices again at invocation and pass the exact
``values`` mapping.  A first/default choice is never inferred.

Implementation alias: lsd_view_hierarchy.HierarchyActionChoice.

lsdtools.views.HierarchyActionChoice.id#

Kind: attribute. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:120.

Python
id: str

lsdtools.views.HierarchyActionChoice.label#

Kind: attribute. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:121.

Python
label: str

lsdtools.views.HierarchyActionChoice.values#

Kind: attribute. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:122.

Python
values: Mapping[str, Any]

lsdtools.views.HierarchyActionChoice.description#

Kind: attribute. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:123.

Python
description: str
Python
description = ''

lsdtools.views.HierarchyActionChoice.values_dict#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:137.

Python
values_dict(self) -> dict[str, Any]
Python
self: (unannotated)

Source docstring:

text
Return a detached mutable copy of the exact input values.

lsdtools.views.HierarchyActionChoiceRequired#

Kind: class. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:64.

Source docstring:

text
Raised when an action exposes fresh choices but none was supplied.

Implementation alias: lsd_view_hierarchy.HierarchyActionChoiceRequired.

Declared bases: HierarchyActionError.

lsdtools.views.HierarchyActionChoiceUnavailable#

Kind: class. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:68.

Source docstring:

text
Raised when supplied values do not match one freshly enumerated choice.

Implementation alias: lsd_view_hierarchy.HierarchyActionChoiceUnavailable.

Declared bases: HierarchyActionError.

lsdtools.views.HierarchyActionError#

Kind: class. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:60.

Source docstring:

text
A safe, user-facing error raised by the hierarchy action-input contract.

Implementation alias: lsd_view_hierarchy.HierarchyActionError.

Declared bases: ValueError.

lsdtools.views.HierarchyView#

Kind: class. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:320.

Python
HierarchyView(self, **config: Any) -> None

Source docstring:

text
A scalable keyed hierarchy with package-overridable interaction hooks.

Implementation alias: lsd_view_hierarchy.HierarchyView.

Declared bases: View.

lsdtools.views.HierarchyView.kind#

Kind: attribute. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:323.

Python
kind = 'hierarchy'

lsdtools.views.HierarchyView.search#

Kind: attribute. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:325.

Python
search = param(str, default='', label='Search', description='Case-insensitive label, description, and node-kind search.')

lsdtools.views.HierarchyView.selection#

Kind: attribute. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:331.

Python
selection = param(str, default='single', choices=['none', 'single', 'multi'], label='Selection')

lsdtools.views.HierarchyView.__init__#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:338.

Python
__init__(self, **config: Any) -> None
Python
config: Any
self: (unannotated)

lsdtools.views.HierarchyView.get_action_choices#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:362.

Python
get_action_choices(self, action_name: str) -> Sequence[HierarchyActionChoice]
Python
action_name: str
self: (unannotated)

Source docstring:

text
Return fresh exact choices for *action_name*; subclasses override.

lsdtools.views.HierarchyView.invoke_action#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:394.

Python
invoke_action(self, action_name: str, *, values: Mapping[str, Any] | None=None) -> Any
Python
action_name: str
self: (unannotated)
values: Mapping[str, Any] | None

Source docstring:

text
Invoke an action with an optional freshly validated exact choice.

lsdtools.views.HierarchyView.action_input#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:435.

Python
action_input(self, action_name: str | None=None) -> dict[str, Any] | None
Python
action_name: str | None
self: (unannotated)

Source docstring:

text
Return a detached exact choice only while its action is executing.

lsdtools.views.HierarchyView.feed#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:446.

Python
feed(self, data: Any) -> HierarchyView
Python
data: Any
self: (unannotated)

Source docstring:

text
Replace the forest after validating every row, edge, cycle, and count.

Input order is the stable order for roots and siblings.  Optional fields
may be omitted, but unknown fields are rejected and the exposed rows
always contain the complete canonical contract.

lsdtools.views.HierarchyView.nodes#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:541.

Python
nodes(self) -> tuple[dict[str, Any], ...]
Python
self: (unannotated)

Source docstring:

text
All canonical rows in stable forest preorder (detached copies).

lsdtools.views.HierarchyView.semantic_item_count#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:545.

Python
semantic_item_count(self) -> int
Python
self: (unannotated)

Source docstring:

text
Return the number of canonical hierarchy items, independent of UI state.

lsdtools.views.HierarchyView.semantic_items#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:549.

Python
semantic_items(self, *, offset: int=0, limit: int=100) -> tuple[dict[str, Any], ...]
Python
limit: int
offset: int
self: (unannotated)

Source docstring:

text
Return one bounded detached page of canonical items in forest preorder.

Discovery is independent of search, expansion, and selection. The
preorder is sliced before row dictionaries are materialized so a small
request never copies the complete hierarchy.

lsdtools.views.HierarchyView.node#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:574.

Python
node(self, node_id: str) -> dict[str, Any]
Python
node_id: str
self: (unannotated)

Source docstring:

text
Return one canonical detached row by exact node id.

lsdtools.views.HierarchyView.selected_ids#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:580.

Python
selected_ids(self) -> tuple[str, ...]
Python
self: (unannotated)

Source docstring:

text
Durable selection ids in user selection order, including pending restored ids.

lsdtools.views.HierarchyView.expanded_ids#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:585.

Python
expanded_ids(self) -> tuple[str, ...]
Python
self: (unannotated)

Source docstring:

text
Durable expansion ids in first-expanded order, including pending restored ids.

lsdtools.views.HierarchyView.visible_nodes#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:614.

Python
visible_nodes(self) -> tuple[dict[str, Any], ...]
Python
self: (unannotated)

Source docstring:

text
Rows currently visible under search and expansion, in stable preorder.

Search reveals each match and its ancestor path without mutating durable
expansion state.  With no search, only roots and descendants of expanded
nodes are returned.

lsdtools.views.HierarchyView.expand#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:639.

Python
expand(self, node_id: str) -> None
Python
node_id: str
self: (unannotated)

lsdtools.views.HierarchyView.collapse#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:647.

Python
collapse(self, node_id: str) -> None
Python
node_id: str
self: (unannotated)

lsdtools.views.HierarchyView.toggle#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:655.

Python
toggle(self, node_id: str) -> None
Python
node_id: str
self: (unannotated)

lsdtools.views.HierarchyView.select#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:662.

Python
select(self, node_ids: str | Iterable[str]) -> Any
Python
node_ids: str | Iterable[str]
self: (unannotated)

Source docstring:

text
Set the keyed selection, then invoke ``on_selection_changed``.

Explicit interactive selection accepts only resident ids.  Restored
state may retain pending ids until a later feed, mirroring keyed table
selection across asynchronous data delivery.

lsdtools.views.HierarchyView.clear_selection#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:687.

Python
clear_selection(self) -> Any
Python
self: (unannotated)

lsdtools.views.HierarchyView.activate#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:690.

Python
activate(self, node_id: str) -> Any
Python
node_id: str
self: (unannotated)

Source docstring:

text
Activate one resident node and invoke ``on_activated``.

lsdtools.views.HierarchyView.on_selection_changed#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:696.

Python
on_selection_changed(self, selected_ids: tuple[str, ...]) -> Any
Python
selected_ids: tuple[str, ...]
self: (unannotated)

Source docstring:

text
Override to project generic keyed selection into domain behavior.

lsdtools.views.HierarchyView.on_activated#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:700.

Python
on_activated(self, node_id: str) -> Any
Python
node_id: str
self: (unannotated)

Source docstring:

text
Override to handle row activation without coupling the generic view.

lsdtools.views.HierarchyView.get_state#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:704.

Python
get_state(self) -> dict[str, Any]
Python
self: (unannotated)

lsdtools.views.HierarchyView.apply_state#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:710.

Python
apply_state(self, state: dict[str, Any]) -> None
Python
self: (unannotated)
state: dict[str, Any]

lsdtools.views.HierarchyView.to_text#

Kind: method. Source: views/hierarchy/src/lsd_view_hierarchy/__init__.py:746.

Python
to_text(self) -> str
Python
self: (unannotated)

lsdtools.views.TableActionChoice#

Kind: class. Source: views/table/src/lsd_view_table/widget.py:77.

Source docstring:

text
One fresh, exact input choice for an inherited :func:`lsdtools.action`.

``id`` is stable identity for renderers, while ``values`` is the exact JSON-safe mapping that is
validated again at invocation time. Containers are recursively frozen; :meth:`values_dict`
returns a detached ordinary dictionary for a caller that needs one.

Implementation alias: lsd_view_table.widget.TableActionChoice.

lsdtools.views.TableActionChoice.id#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:85.

Python
id: str

lsdtools.views.TableActionChoice.label#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:86.

Python
label: str

lsdtools.views.TableActionChoice.values#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:87.

Python
values: Mapping[str, Any]

lsdtools.views.TableActionChoice.description#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:88.

Python
description: str
Python
description = ''

lsdtools.views.TableActionChoice.values_dict#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:102.

Python
values_dict(self) -> dict[str, Any]
Python
self: (unannotated)

Source docstring:

text
A detached mutable copy of the exact action values.

lsdtools.views.TableActionChoiceRequired#

Kind: class. Source: views/table/src/lsd_view_table/widget.py:27.

Source docstring:

text
Raised when an action declares choices but no exact choice was supplied.

Implementation alias: lsd_view_table.widget.TableActionChoiceRequired.

Declared bases: TableActionError.

lsdtools.views.TableActionChoiceUnavailable#

Kind: class. Source: views/table/src/lsd_view_table/widget.py:31.

Source docstring:

text
Raised when supplied action values do not match a freshly enumerated choice.

Implementation alias: lsd_view_table.widget.TableActionChoiceUnavailable.

Declared bases: TableActionError.

lsdtools.views.TableActionError#

Kind: class. Source: views/table/src/lsd_view_table/widget.py:23.

Source docstring:

text
A safe, user-facing error raised by the table action-input contract.

Implementation alias: lsd_view_table.widget.TableActionError.

Declared bases: ValueError.

lsdtools.views.TableView#

Kind: class. Source: views/table/src/lsd_view_table/widget.py:107.

Python
TableView(self, **config: Any) -> None

Source docstring:

text
Show a :class:`~lsdtools.Table` as an interactive grid. ``feed(table_or_data)`` sets the data;
the config params below choose the presentation (column subset, page size, selection mode) and the
live view state (``sort_by`` / ``sort_desc`` / ``filter``). The headless ``to_text()`` is the
aligned-ASCII preview of the composed (filtered + sorted) view.

Implementation alias: lsd_view_table.widget.TableView.

Declared bases: View.

lsdtools.views.TableView.kind#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:113.

Python
kind = 'table'

lsdtools.views.TableView.columns#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:115.

Python
columns = param(str, default='', label='Columns', description='Comma-separated subset to show; empty = all')

lsdtools.views.TableView.page_size#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:117.

Python
page_size = param(int, default=20, min=1, max=10000, label='Rows per page')

lsdtools.views.TableView.selection#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:118.

Python
selection = param(str, default='none', choices=['none', 'single', 'multi'], label='Selection')

lsdtools.views.TableView.key_columns#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:119.

Python
key_columns = param(str, default='', label='Key columns', description='Comma-separated columns that uniquely identify a row. When set, selection survives sorting, filtering, paging, and replacement feeds.')

lsdtools.views.TableView.sort_by#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:128.

Python
sort_by = param(str, default='', label='Sort by', description="Column to sort on; empty = the data's natural order")

lsdtools.views.TableView.sort_desc#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:130.

Python
sort_desc = param(bool, default=False, label='Descending')

lsdtools.views.TableView.filter#

Kind: attribute. Source: views/table/src/lsd_view_table/widget.py:131.

Python
filter = param(str, default='', label='Filter', description='Case-insensitive substring; keeps rows matching in any shown column')

lsdtools.views.TableView.__init__#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:134.

Python
__init__(self, **config: Any) -> None
Python
config: Any
self: (unannotated)

lsdtools.views.TableView.get_action_choices#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:144.

Python
get_action_choices(self, action_name: str) -> Sequence[TableActionChoice]
Python
action_name: str
self: (unannotated)

Source docstring:

text
Return fresh exact choices for *action_name*.

Subclasses override this for actions whose inputs depend on live project state. Returning an
empty sequence preserves ordinary zero-argument ``View.invoke`` behaviour. Choices are never
cached by the model and must not be treated as durable domain state.

lsdtools.views.TableView.invoke_action#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:171.

Python
invoke_action(self, action_name: str, *, values: Mapping[str, Any] | None=None) -> Any
Python
action_name: str
self: (unannotated)
values: Mapping[str, Any] | None

Source docstring:

text
Invoke an inherited action with an optional exact dynamic choice.

Choices are re-enumerated on every call. If one or more exist, *values* must exactly match
one fresh choice; no first/default choice is inferred. The validated detached mapping is
available only for the duration of the ordinary zero-argument action through
:meth:`action_input`, preserving the canonical :meth:`View.invoke` dispatch and event.

lsdtools.views.TableView.action_input#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:214.

Python
action_input(self, action_name: str | None=None) -> dict[str, Any] | None
Python
action_name: str | None
self: (unannotated)

Source docstring:

text
Return the validated input for the currently executing action, else ``None``.

The result is detached on every read. Supplying *action_name* guards against accidentally
consuming a nested action's input and raises when it does not name the active action.

lsdtools.views.TableView.feed#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:230.

Python
feed(self, data: Any) -> None
Python
data: Any
self: (unannotated)

Source docstring:

text
Accept a table-like value.

Positional selection is cleared. Keyed selection is retained, including keys not present
in this feed: a filter, remote page, or temporarily incomplete rerun must not silently
destroy the user's semantic selection.

lsdtools.views.TableView.key_column_names#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:265.

Python
key_column_names(self) -> List[str]
Python
self: (unannotated)

Source docstring:

text
Configured key columns in declaration order (a copy safe for callers to mutate).

lsdtools.views.TableView.view_table#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:294.

Python
view_table(self) -> Optional[Table]
Python
self: (unannotated)

Source docstring:

text
The composed view: the configured column subset, filtered by ``filter`` and ordered by
``sort_by`` / ``sort_desc`` — **all** matching rows (paging is applied separately by
:meth:`page_table`). ``None`` until fed.

lsdtools.views.TableView.semantic_item_count#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:300.

Python
semantic_item_count(self) -> int
Python
self: (unannotated)

Source docstring:

text
Number of rows addressable through the generic View semantic protocol.

lsdtools.views.TableView.semantic_items#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:305.

Python
semantic_items(self, *, offset: int=0, limit: int=100) -> tuple[dict[str, Any], ...]
Python
limit: int
offset: int
self: (unannotated)

Source docstring:

text
Return one composed row page using stable configured keys when available.

This is the sole control-plane projection for table rows.  Hidden key columns remain
usable as identity without being added back to the presented row data.

lsdtools.views.TableView.page_table#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:366.

Python
page_table(self) -> Optional[Table]
Python
self: (unannotated)

Source docstring:

text
The current page of the composed view (``page_size`` rows starting at ``_page``).

lsdtools.views.TableView.row_count#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:374.

Python
row_count(self) -> int
Python
self: (unannotated)

Source docstring:

text
Rows in the composed (filtered) view — not the raw fed table.

lsdtools.views.TableView.total_count#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:379.

Python
total_count(self) -> int
Python
self: (unannotated)

Source docstring:

text
Rows across every page; cursor-backed subclasses may override.

lsdtools.views.TableView.page_count#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:383.

Python
page_count(self) -> int
Python
self: (unannotated)

lsdtools.views.TableView.set_page#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:386.

Python
set_page(self, page: int) -> None
Python
page: int
self: (unannotated)

Source docstring:

text
Select and clamp a zero-based page.

Cursor-backed subclasses override this to fetch their remote page.

lsdtools.views.TableView.selected_rows#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:460.

Python
selected_rows(self) -> List[int]
Python
self: (unannotated)

Source docstring:

text
Selected positions in the current composed/resident table.

With ``key_columns``, :attr:`selected_keys` is authoritative and these positions are
recomputed whenever presentation order changes.

lsdtools.views.TableView.selected_keys#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:477.

Python
selected_keys(self) -> List[List[Any]]
Python
self: (unannotated)

Source docstring:

text
The authoritative semantic selection as ordered JSON-safe compound keys.

lsdtools.views.TableView.selected_page_rows#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:482.

Python
selected_page_rows(self) -> List[int]
Python
self: (unannotated)

Source docstring:

text
Zero-based positions selected on the current page, for any presentation shell.

lsdtools.views.TableView.select_keys#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:494.

Python
select_keys(self, keys: Any) -> None
Python
keys: Any
self: (unannotated)

Source docstring:

text
Set semantic selection directly.

Keys are ordered lists whose width matches ``key_columns``. Values must be JSON scalars;
unresolved keys are retained so remote paging and transient reruns cannot erase intent.

lsdtools.views.TableView.select_rows#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:521.

Python
select_rows(self, rows: Any) -> None
Python
rows: Any
self: (unannotated)

Source docstring:

text
Set selection by composed-view row positions.

With ``key_columns`` the positions are immediately resolved to semantic keys. Otherwise this
retains the original positional behaviour. Emits ``selection-changed``.

lsdtools.views.TableView.select_page_rows#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:538.

Python
select_page_rows(self, rows: Any) -> None
Python
rows: Any
self: (unannotated)

Source docstring:

text
Apply a UI gesture expressed as positions within the current page.

In keyed multi-select mode, selections on unloaded pages are retained. Positional mode keeps
its historical page-relative-to-global conversion.

lsdtools.views.TableView.get_selection#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:558.

Python
get_selection(self) -> Optional[Table]
Python
self: (unannotated)

Source docstring:

text
Selected resident rows as a sub-table in current view order.

A remote keyed view can retain keys from unloaded pages; only selected rows in the resident
page are returned here.

lsdtools.views.TableView.set_column_renderer#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:582.

Python
set_column_renderer(self, column: str, renderer: Optional[str]) -> None
Python
column: str
renderer: Optional[str]
self: (unannotated)

Source docstring:

text
Render *column*'s cells through the registered cell renderer named *renderer* (see
:func:`lsd_view_table.register_cell_renderer`) instead of the default label. ``renderer=None``
(or ``""``) clears it. Headless config: it's stored as data here and applied by the GTK shell;
an unknown name simply falls back to the label. Emits ``data-changed`` so a live grid rebuilds.

lsdtools.views.TableView.column_renderers#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:594.

Python
column_renderers(self) -> Dict[str, str]
Python
self: (unannotated)

Source docstring:

text
The ``{column: renderer_name}`` map the GTK shell passes to ``ColumnGrid.set_columns``.

lsdtools.views.TableView.to_text#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:599.

Python
to_text(self) -> str
Python
self: (unannotated)

lsdtools.views.TableView.to_csv#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:607.

Python
to_csv(self) -> str
Python
self: (unannotated)

Source docstring:

text
The composed (filtered + sorted) view as CSV text — the copy / export payload.

lsdtools.views.TableView.get_state#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:620.

Python
get_state(self) -> dict
Python
self: (unannotated)

lsdtools.views.TableView.apply_state#

Kind: method. Source: views/table/src/lsd_view_table/widget.py:630.

Python
apply_state(self, state: dict) -> None
Python
self: (unannotated)
state: dict

lsdtools.views.View#

Kind: class. Source: core/lsd/src/lsd/core/view.py:449.

Python
View(self, *, name: str='', icon: Optional[str]=None, **config: Any) -> None

Source docstring:

text
A presentable surface: ``param()`` fields + ``@action`` operations + optional data.

Subclass it for a **panel** (params + actions). Set a ``kind`` and override ``feed`` /
``to_text`` / ``to_image`` for a **data view** (table / chart / flowchart / custom).

Implementation alias: lsd.core.view.View.

Declared bases: Configurable.

lsdtools.views.View.kind#

Kind: attribute. Source: core/lsd/src/lsd/core/view.py:455.

Python
kind: ClassVar[str]
Python
kind = ''

lsdtools.views.View.ctx#

Kind: attribute. Source: core/lsd/src/lsd/core/view.py:461.

Python
ctx: ClassVar[Any]
Python
ctx = None

lsdtools.views.View.title#

Kind: attribute. Source: core/lsd/src/lsd/core/view.py:463.

Python
title = param(str, default='', label='Title')

lsdtools.views.View.location#

Kind: attribute. Source: core/lsd/src/lsd/core/view.py:464.

Python
location = param(str, default='editor', choices=['editor', 'sidebar'], label='Location', visibility='hidden')

lsdtools.views.View.__init__#

Kind: method. Source: core/lsd/src/lsd/core/view.py:485.

Python
__init__(self, *, name: str='', icon: Optional[str]=None, **config: Any) -> None
Python
config: Any
icon: Optional[str]
name: str
self: (unannotated)

lsdtools.views.View.engine#

Kind: method. Source: core/lsd/src/lsd/core/view.py:506.

Python
engine(self) -> Any
Python
self: (unannotated)

Source docstring:

text
The :class:`~lsd.runtime.engine.Engine` this view is attached to (``engine.add(view)``),
or ``None`` — the symmetry partner of :attr:`Entity.engine`.

lsdtools.views.View.watch#

Kind: method. Source: core/lsd/src/lsd/core/view.py:512.

Python
watch(self, *targets: Any) -> 'View'
Python
self: (unannotated)
targets: Any

Source docstring:

text
Hold the output of each :class:`~lsd.tree.entity.Entity` in *targets*, and refresh on re-run.

Each target is an ``Entity``, a stable entity id, or an unambiguous display name (sugar).
Returns ``self``, so
``views.table().watch(assays)`` reads as one phrase. **Any order works**:

* *add-then-watch*, *watch-then-add* (view or entity first) — all equivalent;
* a missing string reference is kept **pending** and resolves when that entity is added;
* **auto-pull** — watching an entity that has *already* run delivers its output immediately,
  which is what makes drag-and-drop and reopened projects feel instant.

Watches are stored by entity **id**, so they survive a rename and a project reload; removal
from the Workspace auto-unwatches them. Delivery goes through :meth:`on_output` (default:
``feed(output)``) on ``engine/entity/finished`` with ``ok=True``.

lsdtools.views.View.watch_output#

Kind: method. Source: core/lsd/src/lsd/core/view.py:551.

Python
watch_output(self, *references: OutputRef) -> 'View'
Python
references: OutputRef
self: (unannotated)

Source docstring:

text
Watch exact named step outputs and refresh them after successful runs.

Each reference contains only stable ``entity_id`` + ``step_id`` +
declared ``output_port`` coordinates.  A structurally valid reference
may be registered before its entity is attached; once the entity is
present, a missing step or undeclared port is rejected and never falls
back to :attr:`Entity.output`.

lsdtools.views.View.unwatch_output#

Kind: method. Source: core/lsd/src/lsd/core/view.py:629.

Python
unwatch_output(self, *references: OutputRef) -> 'View'
Python
references: OutputRef
self: (unannotated)

Source docstring:

text
Stop watching exact output references; unknown references are ignored.

lsdtools.views.View.unwatch#

Kind: method. Source: core/lsd/src/lsd/core/view.py:637.

Python
unwatch(self, *targets: Any) -> 'View'
Python
self: (unannotated)
targets: Any

Source docstring:

text
Stop watching each entity (or entity name) in *targets*. Unknown targets are ignored.
Already-delivered data stays — unwatching breaks the link, it does not clear the view.

lsdtools.views.View.watched#

Kind: method. Source: core/lsd/src/lsd/core/view.py:660.

Python
watched(self) -> List[str]
Python
self: (unannotated)

Source docstring:

text
The names of the entities this view watches — live (a renamed entity reports its new name),
plus any names still pending an entity. Watch order is preserved.

lsdtools.views.View.watched_outputs#

Kind: method. Source: core/lsd/src/lsd/core/view.py:671.

Python
watched_outputs(self) -> List[OutputRef]
Python
self: (unannotated)

Source docstring:

text
Exact output references in watch order (a detached copy).

lsdtools.views.View.on_output#

Kind: method. Source: core/lsd/src/lsd/core/view.py:675.

Python
on_output(self, entity: Any, output: Any) -> None
Python
entity: Any
output: Any
self: (unannotated)

Source docstring:

text
Called with a watched *entity*'s fresh output. The default hands it to :meth:`feed`.

Override for a view that watches several entities at once (e.g. a 3-D viewer keying layers by
``entity.id``), where last-write-wins ``feed`` is not what you want.

lsdtools.views.View.on_output_ref#

Kind: method. Source: core/lsd/src/lsd/core/view.py:682.

Python
on_output_ref(self, entity: Any, reference: OutputRef, output: Any) -> None
Python
entity: Any
output: Any
reference: OutputRef
self: (unannotated)

Source docstring:

text
Receive one exact named output; defaults to :meth:`on_output`.

Multi-output views may override this method to retain ``reference`` as
the semantic key while legacy views continue to override ``on_output``.

lsdtools.views.View.get_actions#

Kind: method. Source: core/lsd/src/lsd/core/view.py:988.

Python
get_actions(self) -> List[ActionInfo]
Python
self: (unannotated)

Source docstring:

text
Snapshot of all actions, in declaration order — for a renderer / CLI to build controls.

lsdtools.views.View.set_action_input_initial#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1013.

Python
set_action_input_initial(self, name: str, value: Mapping[str, Any] | None) -> None
Python
name: str
self: (unannotated)
value: Mapping[str, Any] | None

Source docstring:

text
Replace one complete action-form snapshot, or make that form unavailable.

This is runtime presentation state, never persisted View configuration. A caller must
supply every declared field, including hidden versions and optimistic fences. Removing a
snapshot disables the form; it never turns an input action into a zero-input command.

lsdtools.views.View.set_action_input_initials#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1037.

Python
set_action_input_initials(self, values: Mapping[str, Mapping[str, Any]]) -> None
Python
self: (unannotated)
values: Mapping[str, Mapping[str, Any]]

Source docstring:

text
Atomically replace every currently available typed-action form snapshot.

lsdtools.views.View.invoke#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1064.

Python
invoke(self, name: str, *, input: Any=_NO_ACTION_INPUT) -> Any
Python
input: Any
name: str
self: (unannotated)

Source docstring:

text
Run an action by name and return its result. The single dispatch entry for every
front-end. Emits ``view/action/invoked``. Unknown name → ``AttributeError``; a disabled
action is a logged no-op.

lsdtools.views.View.feed#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1096.

Python
feed(self, data: Any) -> 'View'
Python
data: Any
self: (unannotated)

Source docstring:

text
Give the view its data (a Table, a payload dict, a graph…). Data views store it and call
:meth:`_data_changed`; a params-and-actions panel has no data, so the base raises.

lsdtools.views.View.on_view_event#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1119.

Python
on_view_event(self, event: str, cb: Callable[..., None]) -> None
Python
cb: Callable[..., None]
event: str
self: (unannotated)

lsdtools.views.View.off_view_event#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1122.

Python
off_view_event(self, event: str, cb: Callable[..., None]) -> None
Python
cb: Callable[..., None]
event: str
self: (unannotated)

lsdtools.views.View.emit_view_event#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1127.

Python
emit_view_event(self, event: str, **data: Any) -> None
Python
data: Any
event: str
self: (unannotated)

lsdtools.views.View.to_text#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1135.

Python
to_text(self) -> str
Python
self: (unannotated)

Source docstring:

text
A plain-text rendering (agents / CLI / logs). Data views override; the base (a panel) is a
params + actions summary.

lsdtools.views.View.to_image#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1148.

Python
to_image(self, path: Optional[str]=None, *, width: int=1024, height: int=768) -> 'bytes | str'
Python
height: int
path: Optional[str]
self: (unannotated)
width: int

Source docstring:

text
Render to a PNG — returns the bytes, or writes to *path* and returns it. Data views that
can draw override this (lazily importing cairo); the base signals it is unsupported.

lsdtools.views.View.get_state#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1155.

Python
get_state(self) -> dict
Python
self: (unannotated)

Source docstring:

text
A JSON-able snapshot: the config param values plus the ``watch`` links (data views extend
with data/selection). ``watch`` is ``{"ids": {entity id: name}, "pending": [name]}`` — ids,
so a restored view re-links to the same entities across a rename and a project reload.

lsdtools.views.View.apply_state#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1174.

Python
apply_state(self, state: dict) -> None
Python
self: (unannotated)
state: dict

lsdtools.views.View.show#

Kind: method. Source: core/lsd/src/lsd/core/view.py:1271.

Python
show(self, mode: str='auto') -> Any
Python
mode: str
self: (unannotated)

Source docstring:

text
Present the view. ``mode``: ``"window"`` opens a front-end window (needs a presenter),
``"text"`` prints the console rendering, ``"auto"`` (default) is a window if a presenter is
registered (a front-end is loaded), else text.

lsdtools.views.available#

Kind: function. Source: sdk/src/lsdtools/views.py:191.

Python
available() -> list[str]

Source docstring:

text
Installed data-view kinds, discovered without importing their packages.

lsdtools.views.cadquery_studio#

Kind: function. Source: sdk/src/lsdtools/views.py:170.

Python
cadquery_studio(*, recipe: Any, view_id: str | None=None)
Python
recipe: Any
view_id: str | None

Source docstring:

text
Build the native code-left / 3-D-right CadQuery Studio presentation.

``recipe`` must be immutable package-owned source with bounded typed
parameters.  This factory intentionally exposes no source-string executor:
arbitrary project Python remains behind Desktop's explicit code-consent
workflow.

lsdtools.views.chart#

Kind: function. Source: sdk/src/lsdtools/views.py:130.

Python
chart(data: Any=None, *, kind: str='line', **config: Any)
Python
config: Any
data: Any
kind: str

Source docstring:

text
A :class:`ChartView` (from ``lsd-view-chart``) of *kind*, fed *data* if given.

lsdtools.views.dashboard#

Kind: function. Source: sdk/src/lsdtools/views.py:142.

Python
dashboard(data: Any=None, *, document: Any=None, **config: Any)
Python
config: Any
data: Any
document: Any

Source docstring:

text
A :class:`DashboardView` (from ``lsd-view-dashboard``), optionally fed *data*.

``document`` is a versioned report definition; source tables remain transient and are never
embedded into its persisted state.

lsdtools.views.flowchart#

Kind: function. Source: sdk/src/lsdtools/views.py:158.

Python
flowchart(source: Any=None, **config: Any)
Python
config: Any
source: Any

Source docstring:

text
A :class:`FlowchartView` (from ``lsd-view-flowchart``), fed *source* (DSL/Graph) if given.

lsdtools.views.hierarchy#

Kind: function. Source: sdk/src/lsdtools/views.py:118.

Python
hierarchy(data: Any=None, **config: Any)
Python
config: Any
data: Any

Source docstring:

text
A generic keyed :class:`HierarchyView`, fed *data* when supplied.

lsdtools.views.set_view_shell#

Kind: function. Source: core/lsd/src/lsd/core/view.py:1441.

Python
set_view_shell(kind: str, factory: Callable[..., Any]) -> None
Python
factory: Callable[..., Any]
kind: str

Source docstring:

text
Register the callable that turns a data view of *kind* into a front-end control (a GTK widget).
Called by a view package's ``gtk`` module — the only sanctioned place to write GTK.

Implementation alias: lsd.core.view.set_view_shell.

lsdtools.views.table#

Kind: function. Source: sdk/src/lsdtools/views.py:106.

Python
table(data: Any=None, **config: Any)
Python
config: Any
data: Any

Source docstring:

text
A :class:`TableView` (from ``lsd-view-table``), fed *data* if given.

lsdtools.views.view_shell#

Kind: function. Source: core/lsd/src/lsd/core/view.py:1485.

Python
view_shell(view: 'View', **kwargs: Any) -> Any
Python
kwargs: Any
view: 'View'

Source docstring:

text
Build the front-end control for a data *view* via its registered shell, or raise a clear error.

Implementation alias: lsd.core.view.view_shell.

lsdtools.views.view_type#

Kind: function. Source: core/lsd/src/lsd/core/view.py:1336.

Python
view_type(kind: str) -> Optional[type]
Python
kind: str

Implementation alias: lsd.core.view.view_type.

By LSD Team · Last updated Sep 09, 2026 Ask a question View as Markdown
Type to search every doc, guide, and tutorial.
↑↓ navigate openesc close