Appearance
Presentation
Prepare and assemble presentations: save and capture camera views, lay them out on sheets, place diagram images, and import reference assets. Reads describe the artifacts a presentation is built from (saved views, layout sheets); writes assemble them. Accessed via snaptrude.presentation.
All methods are host API calls that return Promises. Reads never throw for a missing artifact (get/getActive return null, list returns []) — the one exception is views.capture, which throws if you pass a viewId (per-view capture is not supported yet; capture the current viewport instead). Several members require Present mode to be open (the documentation editor) — see the precondition table below; outside Present mode those writes throw and sheet reads return empty.
Sub-namespaces
Views
Saved 2D/3D views — camera bookmarks, not geometry. List and read them, capture them to base64 images, activate one (move the camera to it), and save the current camera as a new view. Works from the Design context; Present mode is not required. (snaptrude.presentation.views)
Sheets
Layout sheets — the pages in Present mode that views and diagrams are placed onto. List/get sheets, create new ones, and place a saved view onto a sheet as a canvas shape. (snaptrude.presentation.sheets)
Diagrams
Diagram placement — drop ready diagram images onto a sheet by URL. Adjacency data itself is read and computed via snaptrude.program.adjacency. (snaptrude.presentation.diagrams)
Import
Reference assets — bring an external image or PDF (each PDF page vectorized to SVG) onto the current Present sheet from a url or dataUrl. (snaptrude.presentation.import)
AI Inspiration
Present-mode AI image/video generation — list models and presets, generate/refine from Present canvas sources (blocking or as trackable jobs), inspect workflow lineage, and manage reusable project recipes. (snaptrude.presentation.aiInspiration)
At a glance
| Method | What it does | Mutates? |
|---|---|---|
views — saved 2D/3D views | ||
views.list() | List the saved 2D/3D views | — |
views.get(viewId) | Read one view by id | — |
views.getActive() | Get the currently active view | — |
views.capture(options?) | Screenshot the current viewport as base64 | — |
views.setActive(viewId) | Move the camera to a saved view | ✓ |
views.create(name?, options?) | Save the current camera as a new named view | ✓ |
sheets — layout sheets (Present mode) | ||
sheets.list() | List the layout sheets | — |
sheets.get(sheetId) | Read one sheet by id | — |
sheets.create(name?) | Add a new layout sheet | ✓ |
sheets.place(sheetId, viewId, options?) | Drop a saved view onto a sheet | ✓ |
diagrams — diagram placement | ||
diagrams.place(sheetId, urls, options?) | Drop diagram images (by URL) onto a sheet | ✓ |
import — reference assets (Present mode) | ||
import.image(source, options?) | Place a reference image on the current sheet | ✓ |
import.pdf(source, options?) | Place a PDF on the current sheet, one SVG shape per page | ✓ |
aiInspiration — Present-mode AI generation — see AI Inspiration for the full 18-method surface (models, sources, generate/refine, jobs, workflow lineage, recipes) |
Present mode preconditions
Present mode required for assembly
Sheet writes, diagram placement, and imports operate on the Present canvas and throw when Present mode is not open. Sheet reads do not throw — they return []/null instead. Views are camera bookmarks on the design scene and work without Present mode.
| Member | Needs Present mode open? |
|---|---|
views.* | No — works from the Design context |
sheets.list / sheets.get | Reads return [] / null when Present mode is closed |
sheets.create / sheets.place | Yes — throws when Present mode is not open |
diagrams.place | Yes — throws when Present mode is not open |
import.image / import.pdf | Yes — throws when Present mode is not open |
aiInspiration.* | Canvas-facing calls (sources, selection, generate/refine, workflow, recipes) throw when Present mode is not open; model/preset/job reads work anywhere |
Worked example: from camera to sheet
Save the current camera as a view, create a sheet, and place the view on it. The view can be saved from the Design context; Present mode must be open for the sheet steps.
ts
// Design context: bookmark the current camera as a named view
const view = await snaptrude.presentation.views.create("Hero Perspective");
// Present mode must be open from here on
const sheet = await snaptrude.presentation.sheets.create("Cover");
const { shapeId } = await snaptrude.presentation.sheets.place(sheet.id, view.id);
console.log(`Placed "${view.name}" on "${sheet.name}" as shape ${shapeId}`);