Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...
    Index
    container: HTMLElement
    rootGroup: Group<Object3DEventMap> | null = null
    cameraFramer: ((obj: Object3D) => boolean) | null = null

    Late-bound per-layer camera framing (SceneManager.fitCameraToObject).

    contextMenuClose: (() => void) | null = null

    Close handle of the open context menu, if any.

    audioPort: LayersAudioPort | null = null

    The sound layer, for sound rows (null before wiring / in tests).

    sceneGraph: SceneNode | null = null
    sceneNodeIndex: SceneNodeIndex | null = null

    Path index over sceneGraph: every leaf's root→leaf chain in O(1).

    animationController: AnimationController
    state: LayerStateManager = ...
    applyEngine: LayerApplyEngine = ...

    Scene-application engine: recomposes + pushes attrs to materials. Constructed with ACCESSORS for rootGroup/sceneNodeIndex (both reassigned in initFromScene), never captured values — see the stale-capture pitfall.

    controls: LayerControls = ...

    The controls section (sliders/selects/LOD readout) below the list.

    panelEl: HTMLElement | null = null
    listEl: HTMLElement | null = null
    filterWrapEl: HTMLElement | null = null

    Live filter over layer names; only rendered when the scene has many layers.

    filterInputEl: HTMLInputElement | null = null
    noMatchesEl: HTMLElement | null = null
    filterText: string = ''
    visible: boolean = false
    events: EventGroup = ...

    Tracks every event listener attached during buildPanel/renderList so clear()/dispose() can tear them all down with a single call. Without this, listeners attached to detached DOM nodes hold closures referencing the panel until the GC reclaims the subtree — fragile, hard to test, and inconsistent with the rest of the viewer's listener-tracking pattern. (The controls section's listeners are tracked by LayerControls' own group.)

    rowElements: Map<string, HTMLElement> = ...
    failedLoadsProvider: FailedLoadsProviderPort | null = null

    Failed-load provider (paths + per-path reason), injected by the app after initFromScene (see core/app/dataset/load-dataset.ts). The SAME provider the data monitor uses — reads the loader's live failure set. Null before a scene loads and after dispose.

    pickBufferInvalidator: (() => void) | null = null

    Late-bound accessor to the current PickingSystem's markDirty, injected by the app. Kept as a callback (not a captured PickingSystem) so it survives the per-dataset picking re-creation. Null before wiring / in tests.

    lastFailedLoadsSignature: string | null = null

    Fallback for providers without a version. The JSON signature includes sorted [path, reason] pairs so reason-only changes refresh tooltips. Both detectors use null as a reset sentinel when rows or providers change.

    lastFailedLoadsVersion: number | null = null
    unsubscribeState: (() => void) | null = null
    resizeObserver: ResizeObserver | null = null
    FILTER_THRESHOLD: 8

    Scenes with more layers than this get the live name filter.

    • Initialize the panel from a loaded scene. Must be called after the scene is loaded and rootGroup is available.

      sceneIndex is the scene loader's SceneNodeIndex over sceneGraph (SceneLoader.sceneNodeIndex); without one, or with one over another graph, the panel builds its own (one O(N) pass).

      Parameters

      Returns void

    • Reset every layer's parameters — visibility, display range, gamma, opacity, blending mode, colormap, the mesh shading values (Ambient, Shade falloff, Specular, Shininess, Alpha cutoff), a physical mesh's knobs, a sound row's gain and a locked Active level — back to their authored defaults.

      Re-derives the default state from the scene graph (the same walk initFromScene uses) and pushes every parameter through the regular apply paths, so the materials, the row list, and the controls all agree. No-op before a scene loads or when the scene exposes no layers.

      Returns void

    • Push a freshly re-derived layer back through every apply path — the one apply set both resets share, so the scene and the audio graph agree with the readouts afterwards.

      Parameters

      Returns void

    • Style a data leaf the scene loader built AFTER this panel initialised (a partition part activated by the LOD registry, a lazily built level) with its layers' CURRENT state, before it is first drawn. Wired by core/app/dataset/load-dataset.ts to SceneLoader.setLeafMaterializedListener.

      sceneGraph is the graph the leaf belongs to; a leaf of any graph other than the one this panel was initialised from (a load still running under a previous dataset's panel) is left alone — its own initFromScene styles it.

      Parameters

      • sceneGraph: SceneNode
      • path: string
      • object: Object3D

      Returns void

    • Inject the shared failed-loads provider so per-row error badges can surface a node whose loader threw (corrupt data / network failure). The app wires the SAME provider the data monitor uses, after initFromScene. Resets the change signature and applies the current failure set immediately so a scene that already had failures at load lights up its rows without waiting for a frame. Passing null (dispose) clears the provider and removes any badges (the null reset sentinel forces the following pass through the gate even when the resulting failed set is empty).

      Parameters

      Returns void

    • Inject the per-layer camera framer (the app wires SceneManager.fitCameraToObject, same late-binding pattern as the failed-loads provider). Null disables the "Frame camera" menu item.

      Parameters

      • framer: ((obj: Object3D) => boolean) | null

      Returns void

    • Inject a callback that marks the GPU pick buffer dirty (PickingSystem.markDirty). Late-bound so it survives per-dataset picking re-creation.

      Parameters

      • fn: (() => void) | null

      Returns void

    • Visibility, for pixels AND sound: the scene object toggles as before, and the sound layer mutes the node (or, for a group, every sound under it). Every visibility path in the panel routes through here.

      Parameters

      • path: string
      • visible: boolean

      Returns void

    • Route a secondary gesture at target (right-click or touch long-press) to the eye / row / header menu. Right-clicking an unselected row selects it first (Finder/napari convention); an already-selected row keeps the current multi-selection.

      Parameters

      • target: HTMLElement
      • clientX: number
      • clientY: number

      Returns boolean

    • Open the eye / row / header menu. layerPath is null for the header menu. The opener gets aria-expanded while the menu is up; focus returns to it on close (the utility handles both via onClose/focus-restore).

      Parameters

      • kind: "row" | "header" | "eye"
      • layerPath: string | null
      • x: number
      • y: number
      • opener: HTMLElement | null

      Returns void

    • Reset ONE layer to its authored state. Re-derives the LayerInfo with a throwaway LayerStateManager over the kept scene graph (deliberately not factoring the private walkSceneGraph derivation — this reuses it verbatim, so reset can never drift from load), applies it through the state manager (which preserves selection and clears any solo capture — a direct Object.assign here would rewrite visibility behind the capture's back), and patches only this row (renderList would drop focus and reset the failed-loads signature).

      Parameters

      • path: string

      Returns void

    • Programmatic per-layer appearance patch (LuxarApp.setLayer()). Each field takes the SAME route the panel's own control does — state-manager setter (clamping, persistence, change notification) then the apply engine — so a remote controller can never put the row, the material and the stored state out of step with one another. Only the fields present in patch are touched.

      Parameters

      Returns void

      on an unknown layer path: a controller typo must not fail silently.

    • Sync one row's eye icon + hidden class to the live state (no rebuild).

      Parameters

      • path: string

      Returns void

    • Set one layer's colormap with the fail-closed contract the dropdown uses (layer-controls): re-default the window on off↔on flips BEFORE applying, and if the C1 guard rejects the palette on every leaf, drop it and restore the identity window rather than leaving contradictory state.

      Parameters

      • path: string
      • cmName: string | undefined

      Returns void

    • Copy the source layer's appearance to every other layer, type-gated: display window clamped into each target's data bounds, gamma verbatim, blending resolved per target type, colormap only where supported. Order matters: the colormap copy runs LAST, so a target whose colormap mode flips gets that mode's re-defaulted window (via setLayerColormap) rather than the copied one — a window is only meaningful within one mode, so carrying it across the flip would mis-scale the new value. Deliberately NOT copied: mesh-only knobs, volumetric-only absorption, layer order, and opacity/visibility — those are per-layer compositing choices, not "appearance" (copying opacity would flatten a scene the user balanced layer-by-layer, while copying order would collapse every layer into one band). Sound rows neither give nor receive: they have no material, only placeholder appearance fields.

      Parameters

      • sourcePath: string

      Returns void

    • Apply the live name filter to the rows (case-insensitive substring). Hidden rows keep their DOM (state indices stay valid) and are skipped by the listbox arrow navigation.

      Returns void

    • True when the row for a path is hidden by the live filter.

      Parameters

      • path: string

      Returns boolean

    • Patch each row's load-failure badge from the injected provider's failed set. A layer is in error if its own path failed OR any descendant leaf failed (failedPath === layer.path || failedPath.startsWith(layer.path + '/')), so a failure inside a kind=lod/kind=partition group lights up the group's row. Version-gated for the scene loader; structural providers without a version still use a signature that includes each path's reason.

      Returns void

    • Add / update / remove a single row's error badge + --error class. The badge is a warning glyph with an accessible label naming the reason; the row's own aria-label is left untouched so the base "name (type)" reading is preserved.

      Parameters

      • row: HTMLElement
      • matches: string[]

      Returns void

    • Tooltip text for a failing row. Prefers the provider's per-path reason (loader error.message / classified kind); falls back to a clear generic message. Appends the descendant-failure count when more than one leaf under the row failed.

      Parameters

      • matches: string[]

      Returns string

    • Reposition the rendering controls (.luxar-gui) so it sits below the layers panel when visible, or resets to its default position when hidden.

      Returns void