viewer
etrack.logic.viewer
logic/viewer: Viewer — the live canvas of a system: its declared graph, laid out once, and every thread it keeps.
Hand it the sink that keeps the frames (LiveAdapter, or any WatchPort) and the graph a topology adapter read; it
places the graph and builds the app. labels names nodes for people — by node id, over any label the graph declared —
for graphs whose nodes you did not declare yourself (a library's middleware, a mounted subgraph); kinds gives their
nature the same way, so the canvas colours them by family. The host chooses where it lives: mounted in its own ASGI app (viewer.app under
any prefix) or served on a port of its own, in the same process (GranianAdapter(viewer.app)).
Viewer
Viewer(
watch: WatchPort,
topology: Topology,
labels: Mapping[str, str] = MappingProxyType({}),
kinds: Mapping[str, EventKind] = MappingProxyType({}),
)
One system's canvas: the topology placed on its grid, the threads read from the watched sink.
app
property
The ASGI app: /api/topology, /api/threads, /api/threads/{thread}/events (SSE), the canvas at /.
topology
property
topology: Topology
The declared graph as the canvas draws it: ranks, lanes and loops set.