Skip to main content

loadDimensionValues()

function loadDimensionValues(
dimensionValues,
levelInfo,
dimIndices,
root,
zarrVersion,
slice?): Promise<number[] | string[] | Float64Array<ArrayBufferLike>>;

Loads the coordinate values for a specific dimension.

Behavior:

  • Uses cached values if available (does not reload unless the caller resets the cache).
  • Resolves the correct multiscale level if levelInfo is provided.
  • Converts Zarr buffers into plain JavaScript number arrays.
  • Converts bigint values to number.
  • If a slice [start, end] is supplied, only a sub-range is returned.

Parameters

ParameterTypeDescription
dimensionValuesDimensionValuesCache of already-loaded coordinate arrays.
levelInfostring | nullOptional multiscale subpath.
dimIndices{ array: Array<any, Readable> | null; index: number; name: string; }Dimension index info. See DimIndicesProps.
dimIndices.arrayArray<any, Readable> | null-
dimIndices.indexnumber-
dimIndices.namestring-
root?Location<FetchStore>Root Zarr group location.
zarrVersion?2 | 3 | nullZarr version (2 or 3).
slice?[number, number]Optional index range [start, end] to slice the loaded values.

Returns

Promise<number[] | string[] | Float64Array<ArrayBufferLike>>

The loaded coordinate array for the dimension.