Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Interface LuxarEmbedderEventMap

    Events an embedder can subscribe to via LuxarApp.on(event, listener).

    • dataset-loaded / dataset-error — fire around every dataset load (initial init(), the built-in browser, and switchDataset()).
    • dataset-fault — fires when an already-loaded dataset becomes unable to update, for example after an archive URL expires. The last complete frame remains visible; an explicit retry clears the fault, and a recurring fault fires the event again. Call getDatasetFault() to inspect the current state.
    • dimensions-changed — fires whenever a slice position changes (slider, keyboard, or setDimensionValue()), carrying a fresh EmbedderDimensions.
    • selection — fires on hover-pick changes (the element under the cursor, or null when the hover clears). Works on any dataset — the picking pipeline is provisioned when a selection listener exists at dataset load time, so subscribe BEFORE init() / switchDataset() (on scenes with labels it is always provisioned). Hover-driven: it reports what is under the cursor, not what was clicked.
    • element-click / element-contextmenu — fire when the user left- or right-clicks an element without dragging (issue #1917). Unlike selection, these are gesture-driven. They fire ALONGSIDE the built-in behaviour rather than instead of it: a host that wants exclusive control should also pass allowLinks: false (or load with ?noLinks), which suppresses navigation while still delivering the events. Like selection, a listener present at dataset-load time provisions the picking pipeline, so subscribe BEFORE init() / switchDataset() — on a scene with no labels and no interaction templates, subscribing afterwards leaves picking switched off and the event never fires.
    interface LuxarEmbedderEventMap {
        "dataset-loaded": { src: string };
        "camera-changed": CameraSnapshot;
        "dataset-error": { src: string; error: Error };
        "dataset-fault": DatasetFaultPayload;
        "dimensions-changed": EmbedderDimensions;
        selection: SelectionPayload | null;
        "element-click": ElementPointerPayload;
        "element-contextmenu": ElementPointerPayload;
        "sound-started": { name: string };
        "sound-ended": { name: string };
        "waypoint-departed": { index: number };
        "waypoint-arrived": { index: number; completed: boolean };
    }
    Index
    "dataset-loaded": { src: string }
    "camera-changed": CameraSnapshot

    Fires whenever the camera pose changes — interactive orbit/fly input, setCameraPose(), flyTo() frames, auto-rotate — at frame rate while the camera is moving. Consumers relaying over a network should throttle.

    "dataset-error": { src: string; error: Error }
    "dataset-fault": DatasetFaultPayload
    "dimensions-changed": EmbedderDimensions
    selection: SelectionPayload | null
    "element-click": ElementPointerPayload
    "element-contextmenu": ElementPointerPayload
    "sound-started": { name: string }

    A sound node started playing (after its delay_ms). name is the node name.

    "sound-ended": { name: string }

    A sound node stopped — its once clip ran out, or it faded out on the slab edge.

    "waypoint-departed": { index: number }

    The matched story waypoint changed away from index (viewer_config.waypoints order).

    "waypoint-arrived": { index: number; completed: boolean }

    The flight to waypoint index resolved (or it was snapped to at load). completed: false = the visitor cancelled the flight; it still counts as an arrival from wherever the camera stopped.