PrivatevertexPrivatesegmentPrivatewidthPrivatecolorPrivatesharpnessPrivatescalarPer-vertex scalar buffer for colormap lookup. Allocated as
Float32Array initially; replaced with Uint8Array on first fill if
the input scalars are Uint8. Float16 input stays in the default
Float32 buffer (widened at fill time via the typed-array .set()
numeric conversion).
PrivatetypesPrivatehasPrivatehasPrivatehastracks whether scalars were ever filled this session.
Private_Flips to true on dispose(); fill/ensureCapacity then throw.
PrivateusedHighest vertex / segment indices touched by any fill() call.
Lets ensureCapacity() copy only the live prefix into the new
buffers instead of the full capacity.
PrivateusedPrivatecolorComponents per color entry: 3 (RGB) or 4 (RGBA — alpha = per-vertex opacity).
PrivatevertexPrivatesegmentPrivatendimPrivateallocationsPrivatetotalPrivateassertIntrospection — true if dispose() has been called.
Declare the color layout (3 = RGB, 4 = RGBA) BEFORE the first color
fill. The loader knows the layout from the zarr array shape at open
time; the accumulator needs it to size every color buffer. Throws if
colors were already written with a different layout — the layout is a
property of the dataset, not of an individual load. Mirrors
LoadedPointsDataAccumulator.configureColorComponents.
PrivateinitializeInitialize types from first data fill (like Points accumulator)
Ensure capacity for both vertices and segments.
Actual vertex count needed
OptionalsegmentCount: number
Optional actual segment count. When omitted,
defaults to vertexCount. This is exact for particle tracks
(N vertices → N-1 segments, ratio 1:1) and a safe over-estimate
for typical line meshes (ratio 1.5:1 vertices-to-segments).
true if buffers grew
Always pass the actual segment count when known. The fallback is sized for safety, not for efficiency — under-sizing here causes silent buffer truncation when the loader later writes segments past the estimated boundary.
CORRECTED: getData returns LoadedLinesData with proper nullable handling NOTE: widths is per-VERTEX (vertexCount), NOT per-segment!
Fill accumulator buffers with multi-type support
Detects attribute types on first fill and creates appropriately-typed buffers. Subsequent fills must use matching types. Preserves native types (no conversion).
NOTE: widths uses vertexOffset (per-vertex), NOT segmentOffset!
Get statistics
Direct accessor for the per-vertex scalar buffer.
Lazy-allocated on first access. Non-scalar line datasets keep
scalarBuffer.length === 0 indefinitely, saving 4 B/vertex.
mark scalars as present. Used by loaders that write directly
into scalarBuffer via getScalarBuffer() (zero-copy path) and
therefore need to flip hasScalars without going through fill().
Dispose (release memory)
Lines data accumulator with FULL multi-type support
CRITICAL: Flat buffers matching types/lines.ts:170-194 CRITICAL: widths is PER-VERTEX (N,), NOT per-segment!
Handles Float32Array, Uint8Array, and Uint16Array for colors natively (no conversion) to maintain memory efficiency and consistency with multi-type GPU buffer pool.
Type is detected on first fill() and remains fixed for the accumulator's lifetime.