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

    Lines data loader using spatial indices for efficient nD queries.

    Key features:

    • Segment-first loading: segments → vertices
    • Index remapping from global to local indices
    • nD endpoint clipping for partial segment visibility
    • Per-vertex attribute interpolation for clipped segments

    Implements

    Index
    chunkIndex: LinesDualChunkIndex | null = null
    zarrLocation: Location<Readable>
    node: SceneNode
    _lifetime: LoaderLifetime = ...

    Disposed latch, lifetime signal, one-shot initialization and the per-call demand-load context (lifetime.calls) the wrapped arrays' getChunk reads through the () => this._lifetime.calls.signal / .probe thunks below (see LoaderLifetime, ActiveLoadContext).

    rangeLoader: RangeLoader
    zarrStore: Readable | null = null
    _accumulator: LinesDataAccumulator | null = null
    _accumulatorConfig:
        | {
            initialVertexCapacity: number;
            initialSegmentCapacity: number;
            ndim: number;
        }
        | null = null
    _accumulatorReleased: boolean = false
    l0Cache: DecompressedChunkCache | null = null
    prefetcher: ChunkPrefetcher | null = null
    sliceCache: SliceCache | null = null
    _initialLoadDone: boolean = false
    colorComponents: 3 | 4 = 3
    events: LoaderEventEmitter = ...
    metrics: LoaderMetrics
    activeQueries: Map<string, QueryInfo> = ...
    nextQueryId: number = 0
    totalQueryCells: number = 0
    facadeCtx: SpatialFacadeCtx
    arrays: {
        vertices?: Array<DataType, Readable>;
        segments?: Array<DataType, Readable>;
        widths?: Array<DataType, Readable>;
        colors?: Array<DataType, Readable>;
        sharpness?: Array<DataType, Readable>;
        scalars?: Array<DataType, Readable>;
    } = {}

    Type Declaration

    • Optionalvertices?: Array<DataType, Readable>
    • Optionalsegments?: Array<DataType, Readable>
    • Optionalwidths?: Array<DataType, Readable>
    • Optionalcolors?: Array<DataType, Readable>
    • Optionalsharpness?: Array<DataType, Readable>
    • Optionalscalars?: Array<DataType, Readable>

      optional per-vertex scalars for colormap lookup.

    • Thin wrapper around the shared registerLinesArrayBounds helper so the call sites read more naturally than passing the prefetcher and node path on every call.

      Parameters

      • arrayName: string
      • array: Array<DataType, Readable>

      Returns void

    • Initialize metadata once without loading any attribute payload chunks, under the disposed latch (LoaderLifetime.ensureInitialized): a disposed loader refuses to re-initialize, and an initialization still in flight when dispose runs is discarded instead of repopulating the loader.

      priority classes the chunk_bounds read of an initialization THIS call starts (B6: a progressive loader warms rung k+1's index at 'refinement' while rung k loads; the speculative entry points pass 'speculative'). A later call without one raises an in-flight warm to demand.

      Parameters

      Returns Promise<void>

    • Release pooled decoded buffers after a progressive parent has copied them. Earlier payloads remain valid because dispose() replaces the accumulator buffers rather than clearing their old arrays. This deliberately gives up pooling across view changes: retaining the pool would keep the second copy that progressive Lines releases here.

      Returns void

    • Warm the cache for the given viewState without producing geometry.

      Mirrors the gsplats / points prefetchChunks(viewState) so a dimension-animation hook can prefetch the next slice while the current frame renders. Segments are keyed by segment ranges; vertices, widths, colors, sharpness, and scalars are keyed by vertex ranges. Querying both published indexes keeps speculative reads in the same row currency as the demand path instead of treating segment offsets as vertex offsets. Each distinct chunk those ranges touch is fetched and decoded into L0 via the proxy's warmChunk — no zarr get(), so no output selection is assembled, and the demand load's abort signal / residency probe are not consulted (see prefetchRangesIntoCache).

      Parameters

      • viewState: ViewState
      • Optionalsignal: AbortSignal

      Returns Promise<void>

    • Parameters

      Returns {
          chunkBounds: Float32Array<ArrayBufferLike>;
          chunkCount: number;
          metadata: { ndim: number; chunk_size: number };
      }

    • Load vertex ranges with optional target buffer for zero-allocation operation.

      Uses RangeLoader for unified encoding dispatch (broadcasted, quantized, lut, direct). Array references are handled specially (need zarrStore access to resolve target).

      Parameters

      • arrayName: string
      • ranges: SegmentRange[]
      • elementsPerVertex: number
      • OptionaltargetBuffer: Float32Array<ArrayBufferLike>

      Returns Promise<Float32Array<ArrayBufferLike>>

    • Load color ranges with multi-type support (preserves original_dtype)

      This method handles the full encoding/decoding pipeline for colors, including original_dtype restoration for encoded arrays.

      Parameters

      • ranges: SegmentRange[]
      • OptionaltargetBuffer:
            | Uint8Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Uint16Array<ArrayBufferLike>

      Returns Promise<
          | Uint8Array<ArrayBufferLike>
          | Float32Array<ArrayBufferLike>
          | Uint16Array<ArrayBufferLike>,
      >