Live: set viewport
live_set_viewportAdjust the canvas viewport by zooming, panning, or fitting to selection or page. Use to frame the canvas before rendering or capturing.
Instructions
Control the live canvas viewport: zoom / pan / fit-to-selection / fit-to-page.
When to use: framing the canvas before a render/capture. To then render use live_render_view;
to edit (not just view) use live_apply_to_selection.
Key params: mode is one of the fixed verbs zoom | pan | fit_selection | fit_page (no
raw Action or code path — ADR-003). zoom takes a positive zoom and optional
center_x/center_y to recentre; pan takes both dx and dy (a delta in user units);
fit_selection/fit_page take no numerics. Every numeric is finite-checked and bounded
server-side before it crosses the transport (sec.12). Requires a session. VIEW-ONLY (no
Operation Record, no approval).
Return shape: LiveViewportResult — the applied viewport state.
Example: live_set_viewport("zoom", zoom=2.0)
Risk class: low (view-only; no document mutation, no Operation Record).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dx | No | ||
| dy | No | ||
| mode | Yes | ||
| zoom | No | ||
| center_x | No | ||
| center_y | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Viewport mode applied (zoom/pan/fit_selection/fit_page). | |
| detail | No | Short human-readable summary. | |
| applied | No | Whether the backend applied the viewport op. |