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

    Interface ElementPointerPayload

    Payload for LuxarEmbedderEventMap.element-click and element-contextmenu (issue #1917).

    Extends the hover SelectionPayload fields with the gesture itself, so all of that type's caveats about elementIndex apply here unchanged.

    interface ElementPointerPayload {
        nodeName: string;
        elementIndex: number;
        hitNodeName: string;
        button: number;
        x: number;
        y: number;
        link: string | null;
    }

    Hierarchy (View Summary)

    Index
    nodeName: string

    Scene-node (zarr path) of the picked layer — the outermost kind=partition wrapper when the hit sits under one, otherwise the hit node itself.

    elementIndex: number

    Index of the picked element within the hit leaf — under a partition that is the part_<i> leaf, not nodeName. Index it against hitNodeName.

    This is the ON-DISK element index (the one the leaf's arrays and its per-element string/image CSRs are keyed by) wherever the node can resolve one — through a published slot → on-disk map, or trivially where the identity already holds and no map is published. Today: a Points, GSplats or Lines node declaring has_labels / has_image_labels / has_keys — flat, or, for Points, an additive-LOD ladder (see below) — and Mesh, whose gl_VertexID already is the on-disk ordinal. For a LINES node that on-disk index is the picked segment's START vertex, not a segment index: line string/image channels are per-vertex, and a segment carries a single pick id, so its start endpoint is the one reported. A multi-additive-LOD (laddered) node carries one labels/keys CSR per present channel on the ladder parent, spanning the levels, and declares has_labels / has_keys there (#1422). On POINTS that resolves like a flat node: the per-level maps are composed into the union CSR's index space (#1439), so the index holds under culling and compaction too, degrading to the raw committed slot only when the levels' own metadata is inconsistent. On LINES no map is composed across the levels, so it reports the raw committed slot, which is a per-segment one against the per-vertex union CSR — wrong at the granularity whatever the slicing (#1439 covers Points only). Otherwise it is the element's slot in the buffer that reached the GPU, which after spatial range loading or nD compaction is NOT the on-disk index — and on a Lines node without a per-element string channel it is a per-segment slot in what is a per-vertex element space whatever the slicing. See rendering/picking/picking-system/element-id-map.ts.

    hitNodeName: string

    Scene node (zarr path) elementIndex is local to — the part_<i> leaf actually hit under a kind=partition layer, and the node itself otherwise. This is the path an embedder should index against; nodeName is for display.

    button: number

    Which pointer button: 0 = primary, 2 = secondary.

    Reports the raw DOM value, so a macOS Ctrl+primary-click — the platform's secondary gesture — arrives as 0 on an element-contextmenu event. Switch on the event NAME, not on this, to tell the two gestures apart.

    x: number

    Viewport coordinates of the gesture, in CSS pixels.

    y: number
    link: string | null

    The URL the built-in handler resolved from the element's link template, or null when it has none, the template could not be made safe, or link opening is disabled. Reported so a host can mirror or override the behaviour without re-implementing template resolution.