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

    Main Data Loading Monitor class

    Index
    container: HTMLElement
    panel: HTMLElement | null = null
    loaders: Map<string, LoaderMonitor> = ...
    events: MonitorEvent[] = []
    metrics: Map<string, LoaderMetrics> = ...
    queries: Map<string, QueryInfo> = ...
    uiState: MonitorUIState = ...
    pollingLoop: PollingLoop
    lastEventCleanup: number = 0
    eventCleanupInterval: number = MonitorTimings.eventCleanupInterval
    maxEventAge: number = MonitorTimings.maxEventAge
    cachedRates: {
        queriesPerSec: number;
        loadsPerSec: number;
        bandwidth: number;
        lastCalculated: number;
    } = ...
    ratesCacheTimeout: number = MonitorTimings.ratesCacheTimeout
    uiEventHandler: (event: Event) => void = ...

    Type Declaration

      • (event: Event): void
      • Handle UI events through event delegation

        Parameters

        • event: Event

        Returns void

    providers: MonitorProviderRegistry = ...
    cacheActions: CacheActions = ...
    sceneGraphModel: SceneGraphModel = ...
    retryFailedLoadsInFlight: boolean = false

    In-flight guard so the banner's Retry button can't stack batches.

    lastFailedLoadsSignature: string = ''

    Last-rendered failed-loads state; a change marks the overview structure dirty.

    contentContainer: HTMLElement | null = null
    collapsedCacheSections: Set<string> = ...
    animateNextBuild: boolean = false
    structureDirty: boolean = false
    • Disconnect all loaders and reset monitor state This should be called when loading a new scene

      Returns void

    • Push the cache telemetry state resolved by cache-setup.ts. Called once per scene load so the UI shows the right disabled-reason (?noCache URL flag vs app-config disable vs pre-wiring transition). Without this, the aggregator falls back to provider-presence inference and misrepresents ?noCache runs as not-wired.

      Parameters

      Returns void

    • Set the L0 decompressed chunk cache provider for L0 cache monitoring. This enables the monitor to display L0 cache statistics in the Cache tab.

      Parameters

      • provider:
            | {
                getStats: () => | {
                    size: number;
                    count: number;
                    hits: number;
                    misses: number;
                    evictions: number;
                    hitRate: number;
                    maxSize?: number;
                }
                | undefined;
                clear: () => void;
            }
            | null

      Returns void

    • Register the SliceCache ("S-cache") stats/clear provider so the Cache tab shows its usage and hit rate. Mirrors setL0CacheProvider.

      Parameters

      • provider:
            | {
                getStats: () => | {
                    size: number;
                    count: number;
                    hits: number;
                    misses: number;
                    evictions: number;
                    hitRate: number;
                    thrashMisses?: number;
                    maxSize?: number;
                    fullLadderCount?: number;
                    ladderDepthHistogram?: Record<string, number>;
                }
                | undefined;
                clear: () => void;
            }
            | null

      Returns void

    • Set the GPU buffer pool provider for Memory tab stats. The provider should have a getStats() method that returns PoolStats.

      Parameters

      Returns void

    • Set the LOD-progress provider for live LOD / refinement / residency state in the scene-graph tree. Polled each tick. Passing a provider marks the structure dirty so the tree re-renders with chip slots.

      Parameters

      Returns void

    • Set the draw-order provider for live per-mesh compositing state (blending bucket / depthWrite / renderOrder) in the scene-graph tree. Polled each tick. Passing a provider marks the structure dirty so the tree re-renders with the draw-order chip slot.

      Parameters

      Returns void

    • Set an accumulator provider for Memory tab stats.

      Parameters

      • type: "points" | "lines" | "gsplats"

        Which accumulator, one of POOLED_GEOMETRY_TYPES

      • provider: AccumulatorProvider | null

        The accumulator with a getStats() method

      Returns void

    • Null every closure-bound provider tied to the active scene's loader (cache stats, L0 cache, GPU buffer pool, accumulators, profiler).

      Required when a scene reload disposes the previous SceneLoader: each provider was a closure that captured the now-disposed loader's fields (this.l0Cache, etc.). Calling them after dispose throws — e.g. the L0 closure () => this.l0Cache!.getStats() NPEs once the previous loader nulled its l0Cache. Under ?noCache the next scene never installs replacements either, so without this reset the stale closures live until tab close.

      Returns void

    • Reset scene graph display state.

      Called from disconnectAllLoaders() (scene reload) and dispose() (full teardown). Without this, a reload that fails before setSceneGraph() runs leaves the monitor showing the previous scene's tree, while loaders/providers have already been cleared — a "ghost tree" mismatch in the Scene Graph panel.

      Also resets expandedNodes so a new scene starts from a freshly collapsed tree (the root '/' marker preserves the previous default).

      Returns void

    • Clear L2 OPFS cache. Asks for confirmation first since the L2 persistent cache requires a network re-fetch to repopulate. The confirm dialog can be skipped by passing { skipConfirm: true } — used by tests and by the debug API where the caller has already confirmed intent.

      Parameters

      • Optionalopts: { skipConfirm?: boolean }

      Returns Promise<void>

    • Clear all caches (L0 + L1 + L2). Confirmation dialog can be skipped via { skipConfirm: true }.

      Parameters

      • Optionalopts: { skipConfirm?: boolean }

      Returns Promise<void>

    • Toggle expansion state of a node in the scene graph tree.

      Parameters

      • path: string

      Returns void

    • Check if a node is expanded in the tree view.

      Parameters

      • path: string

      Returns boolean

    • Update the count of currently visible elements of one geometry type.

      Called by SceneLoader (via updateVisibleCountsInMonitor) after the per-type commits, so the HUD reports post-nD-clipping and post-progressive-refinement counts rather than raw loaded ones. One kind-keyed setter rather than one method per type: the three bodies were identical apart from the field each wrote.

      Parameters

      Returns void

    • Per-node visible counts after nD slicing, keyed by scene-graph path. Pushed by the SceneLoader's visible-counts walk (only rendered meshes contribute). Merged into the tree nodes so badge tooltips can show "(N visible after slicing)" per layer; the merge happens in SceneGraphModel.syncVisibleCountsIntoTree(), run on the poll tick immediately before the incremental badge patch. Nodes whose path is absent from the latest map (the walk prunes non-visible subtrees) have their count cleared so tooltips never show a stale number.

      Parameters

      • counts: ReadonlyMap<string, number>

      Returns void

    • Polling tick handler - called periodically by the polling loop. This is the main update entry point that:

      1. Drains and processes queued events (batch processing)
      2. Pulls fresh stats from providers
      3. Updates the UI

      Returns void

    • Process a single event (called from polling tick, not from loaders). This is now decoupled from event emission - events are batched and processed during the polling tick.

      Parameters

      Returns void

    • Force an immediate UI update. Used when scene changes or loaders are connected. Triggers an immediate polling tick to process any queued events and refresh the UI.

      Returns void

    • Toggle a Cache-tab section between its full metric-card view and the compact one-line header summary. Both views are always in the DOM (visibility is CSS-driven), so the toggle is a pure class flip — no re-render, and the per-tick patcher keeps updating both.

      Parameters

      • sectionKey: string

      Returns void

    • Build the compact-view element summary. Shows one count per geometry type actually present in the scene, from the same shared headline table the Overview tab's hero cards use (headline-counts.ts) — so the badge can't disagree with the expanded panel about which types exist, and a lines-, gsplats- or mesh-only dataset no longer mislabels its elements as "points". Falls back to a points entry when nothing has loaded yet.

      Parameters

      Returns string

    • Try to update just the compact view values without replacing innerHTML. This preserves event handlers and prevents interaction loss during polling updates.

      Returns boolean

      true if incremental update succeeded, false if full rebuild is needed

    • Update compact view. Tries incremental value update first; only does full innerHTML rebuild when the structure doesn't exist yet (first render or after expand/minimize).

      Returns void

    • Update detailed view using targeted DOM patching.

      On each polling tick, tries incremental value updates first (updating only textContent/style of specific elements via data-field attributes). This preserves the DOM tree, event handlers, focus, and scroll position.

      Falls back to full innerHTML rebuild only when:

      • Structure doesn't exist yet (first render)
      • structureDirty flag is set (tree toggle, scene graph mutation)
      • Incremental update reports structure mismatch

      Returns void

    • Incrementally update overview tab values without rebuilding DOM. Updates primary metric cards, secondary metrics, and scene graph badges.

      Returns boolean

    • Incrementally update cache tab values without rebuilding DOM. Delegates to tabs/cache-tab.ts:updateCacheTab.

      Returns boolean

    • Retry every failed loader via the injected provider (the monitor-side trigger for SceneLoader.retryAllFailedLoaders; the loader serializes the batch against its update lock). Guards against double-clicks while a batch is in flight and refreshes the banner on completion.

      Returns void

    • Get cache metrics aggregated across all loaders. Delegates the multi-source roll-up to data-loading-monitor/metrics/cache.ts:aggregateCacheMetrics. The aggregator refreshes this.metrics snapshots and reads this.cachedRates (already updated by calculateRates() here).

      Returns CacheMetrics

    • Calculate all rates with caching. Delegates to data-loading-monitor/metrics/rates.ts:calculateRates.

      Returns void

    • Cycle through monitor states: hidden → mini → expanded → hidden This implements the three-state cycling as per the comprehensive plan

      Returns void