@fxi/zartigl 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -11
- package/dist/GeoVideoScalarSource-DoQAnyTy.js +38 -0
- package/dist/catalog.d.ts +40 -2
- package/dist/catalog.js +111 -62
- package/dist/engine.d.ts +616 -0
- package/dist/engine.js +29 -0
- package/dist/geovideo-index-CD5wflJT.js +833 -0
- package/dist/land-50m-BX3pQS4x.js +15 -0
- package/dist/projversor.d.ts +919 -0
- package/dist/projversor.js +2374 -0
- package/dist/scalar-color-domain-PEK8Hxg1.js +12 -0
- package/dist/story.d.ts +398 -0
- package/dist/story.js +561 -0
- package/dist/zartigl.d.ts +356 -34
- package/dist/zartigl.js +3606 -2637
- package/package.json +49 -7
package/dist/engine.d.ts
ADDED
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
declare interface CatalogEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
aliases?: string[];
|
|
4
|
+
title: LocalizedText;
|
|
5
|
+
description?: LocalizedText;
|
|
6
|
+
category: string;
|
|
7
|
+
tags?: string[];
|
|
8
|
+
kind: "scalar" | "vector";
|
|
9
|
+
sources: CatalogSource[];
|
|
10
|
+
defaults: {
|
|
11
|
+
sourceId: string;
|
|
12
|
+
querySourceId?: string;
|
|
13
|
+
palette?: string;
|
|
14
|
+
renderMode?: "particles" | "raster" | "raster+particles";
|
|
15
|
+
particles?: {
|
|
16
|
+
density?: number;
|
|
17
|
+
speed?: number;
|
|
18
|
+
fade?: number;
|
|
19
|
+
};
|
|
20
|
+
raster?: {
|
|
21
|
+
opacity?: number;
|
|
22
|
+
logScale?: boolean;
|
|
23
|
+
vibrance?: number;
|
|
24
|
+
colorDomain?: [number, number];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* An incremental archive of calendar-aligned artifacts listed by a mutable
|
|
31
|
+
* index; zartigl resolves it to the chunk covering the requested time.
|
|
32
|
+
*/
|
|
33
|
+
declare interface CatalogGeoVideoArchiveSource extends CatalogSourceBase {
|
|
34
|
+
type: "geovideo";
|
|
35
|
+
indexUrl: string;
|
|
36
|
+
manifestUrl?: never;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** One published artifact. */
|
|
40
|
+
declare interface CatalogGeoVideoSource extends CatalogSourceBase {
|
|
41
|
+
type: "geovideo";
|
|
42
|
+
manifestUrl: string;
|
|
43
|
+
indexUrl?: never;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare type CatalogSource = CatalogZarrSource | CatalogWmtsSource | CatalogGeoVideoSource | CatalogGeoVideoArchiveSource;
|
|
47
|
+
|
|
48
|
+
declare interface CatalogSourceBase {
|
|
49
|
+
id: string;
|
|
50
|
+
title: LocalizedText;
|
|
51
|
+
provenance?: CatalogSourceProvenance;
|
|
52
|
+
temporal?: CatalogTemporalSummary;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare interface CatalogSourceProvenance {
|
|
56
|
+
provider: string;
|
|
57
|
+
identifiers?: Record<string, string>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare interface CatalogTemporalSummary {
|
|
61
|
+
cadence?: string;
|
|
62
|
+
mode: "historical" | "near-real-time" | "analysis-forecast" | "fixed";
|
|
63
|
+
start?: string;
|
|
64
|
+
end?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare type CatalogVariables = {
|
|
68
|
+
kind: "scalar";
|
|
69
|
+
value: string;
|
|
70
|
+
} | {
|
|
71
|
+
kind: "vector";
|
|
72
|
+
u?: string;
|
|
73
|
+
v?: string;
|
|
74
|
+
derivation?: CatalogVectorDerivation;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare interface CatalogVectorDerivation {
|
|
78
|
+
kind: "direction_magnitude";
|
|
79
|
+
direction_variable: string;
|
|
80
|
+
magnitude_variable: string;
|
|
81
|
+
direction_convention: "from" | "toward";
|
|
82
|
+
output_direction: "from" | "toward";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare interface CatalogWmtsSource extends CatalogSourceBase {
|
|
86
|
+
type: "wmts";
|
|
87
|
+
capabilitiesUrl: string;
|
|
88
|
+
baseUrl?: string;
|
|
89
|
+
layer: string;
|
|
90
|
+
tileMatrixSet?: string;
|
|
91
|
+
format?: string;
|
|
92
|
+
style?: string;
|
|
93
|
+
tileUrlTemplate?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare interface CatalogZarrSource extends CatalogSourceBase {
|
|
97
|
+
type: "zarr";
|
|
98
|
+
endpoints: {
|
|
99
|
+
field: string;
|
|
100
|
+
pointSeries?: string;
|
|
101
|
+
};
|
|
102
|
+
variables: CatalogVariables;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export declare const COLOR_GRADE_OFF: Readonly<ColorGrade>;
|
|
106
|
+
|
|
107
|
+
export declare const COLOR_GRADE_VIBRANT: Readonly<ColorGrade>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Optional color grade applied when particle trails are composited
|
|
111
|
+
* (`shaders/color-grade.glsl`): more intense highlights, deeper shadows and
|
|
112
|
+
* richer colors, without hard clipping. Off by default; when off, the
|
|
113
|
+
* composite returns the trail colors unchanged.
|
|
114
|
+
*/
|
|
115
|
+
export declare interface ColorGrade {
|
|
116
|
+
enabled: boolean;
|
|
117
|
+
/** Mid-tone lift [0, 4]; 0 keeps the tones. */
|
|
118
|
+
exposure: number;
|
|
119
|
+
/** S-curve strength [0, 1]. */
|
|
120
|
+
contrast: number;
|
|
121
|
+
/** Vibrance-weighted saturation [-1, 1]. */
|
|
122
|
+
saturation: number;
|
|
123
|
+
/** Push of the bright half toward white [0, 1]. */
|
|
124
|
+
highlights: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** `u_grade` uniform: (exposure, contrast, saturation, highlights). */
|
|
128
|
+
export declare function colorGradeVec4(grade: ColorGrade): [number, number, number, number];
|
|
129
|
+
|
|
130
|
+
export declare type ColorRampInput = string | string[] | Record<number, string>;
|
|
131
|
+
|
|
132
|
+
declare interface CoordArrays {
|
|
133
|
+
time: Float64Array | Float32Array;
|
|
134
|
+
vertical: Float32Array;
|
|
135
|
+
latitude: Float32Array;
|
|
136
|
+
longitude: Float32Array;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export declare function createColorRampTexture(gl: WebGL2RenderingContext, ramp?: ColorRampInput): WebGLTexture;
|
|
140
|
+
|
|
141
|
+
export declare function createProgram(gl: WebGL2RenderingContext, vertSource: string, fragSource: string): WebGLProgram;
|
|
142
|
+
|
|
143
|
+
/** Trail length in frames for a 0–1 `fade`. */
|
|
144
|
+
export declare function fadeToFrames(fade: number): number;
|
|
145
|
+
|
|
146
|
+
/** Per-frame trail opacity multiplier for a 0–1 `fade`. */
|
|
147
|
+
export declare function fadeToOpacity(fade: number): number;
|
|
148
|
+
|
|
149
|
+
export declare type GeoVideoBounds = [
|
|
150
|
+
west: number,
|
|
151
|
+
south: number,
|
|
152
|
+
east: number,
|
|
153
|
+
north: number
|
|
154
|
+
];
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Fixed-period GeoVideo sources, one per chunk. They keep the archive source
|
|
158
|
+
* id, which the chunk manifests carry as their identity.
|
|
159
|
+
*/
|
|
160
|
+
export declare function geoVideoChunkSources(source: CatalogGeoVideoArchiveSource, index: GeoVideoIndex, entry: CatalogEntry): CatalogGeoVideoSource[];
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* GeoVideo frames read one time step at a time (seek, no playback): video
|
|
164
|
+
* and static mask loading, luma readback, a serial decode queue that
|
|
165
|
+
* cancelAll() aborts, and a small LRU cache of decoded frames. Subclasses
|
|
166
|
+
* turn the luma codes of a frame into values.
|
|
167
|
+
*/
|
|
168
|
+
export declare abstract class GeoVideoFrameSource<TFrame> {
|
|
169
|
+
/** Grid size; the video stacks `planes` grids vertically. */
|
|
170
|
+
readonly width: number;
|
|
171
|
+
readonly height: number;
|
|
172
|
+
protected readonly manifest: GeoVideoManifest;
|
|
173
|
+
protected readonly times: Float64Array;
|
|
174
|
+
private readonly planes;
|
|
175
|
+
private readonly cacheSize;
|
|
176
|
+
private readonly reader;
|
|
177
|
+
private video;
|
|
178
|
+
private mask;
|
|
179
|
+
private initPromise;
|
|
180
|
+
private presented;
|
|
181
|
+
private primed;
|
|
182
|
+
private queue;
|
|
183
|
+
private epoch;
|
|
184
|
+
private readonly frames;
|
|
185
|
+
constructor(manifest: GeoVideoManifest, planes: number, options?: {
|
|
186
|
+
cacheSize?: number;
|
|
187
|
+
});
|
|
188
|
+
/** Codes of the stacked planes and the per-cell mask to frame values. */
|
|
189
|
+
protected abstract decodeCodes(codes: Uint8Array, mask: Uint8Array, threshold: number): TFrame;
|
|
190
|
+
init(): Promise<void>;
|
|
191
|
+
/** Abort queued frame decodes; frames already decoded stay cached. */
|
|
192
|
+
cancelAll(): void;
|
|
193
|
+
/** Release the video element and GL context; a later init() reloads them. */
|
|
194
|
+
release(): void;
|
|
195
|
+
/** One decode per time step, cached. */
|
|
196
|
+
frame(index: number): Promise<TFrame>;
|
|
197
|
+
private load;
|
|
198
|
+
private loadMask;
|
|
199
|
+
private loadVideo;
|
|
200
|
+
/** Seek to a frame and wait until it is presented. */
|
|
201
|
+
private presentFrame;
|
|
202
|
+
/**
|
|
203
|
+
* Some mobile browsers expose no decoded pixels to WebGL until playback
|
|
204
|
+
* started once. A muted play/pause primes the decoder, only when needed:
|
|
205
|
+
* playback would otherwise buffer far beyond the requested frame.
|
|
206
|
+
*/
|
|
207
|
+
private primeDecoder;
|
|
208
|
+
protected decode(index: number, epoch: number): Promise<TFrame>;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Mutable listing of an archive's published chunks, written by the renderer. */
|
|
212
|
+
export declare interface GeoVideoIndex {
|
|
213
|
+
schemaVersion: 1;
|
|
214
|
+
type: "geovideo-index";
|
|
215
|
+
catalogEntryId: string;
|
|
216
|
+
sourceId: string;
|
|
217
|
+
updatedAt: string | null;
|
|
218
|
+
chunks: GeoVideoIndexChunk[];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** One immutable, calendar-aligned artifact of a GeoVideo archive. */
|
|
222
|
+
export declare interface GeoVideoIndexChunk {
|
|
223
|
+
period: {
|
|
224
|
+
start: string;
|
|
225
|
+
end: string;
|
|
226
|
+
};
|
|
227
|
+
/** First and last encoded sample. */
|
|
228
|
+
start: string;
|
|
229
|
+
end: string;
|
|
230
|
+
samples: number;
|
|
231
|
+
key: string;
|
|
232
|
+
/** Relative to the index URL. */
|
|
233
|
+
manifestUrl: string;
|
|
234
|
+
provisional?: boolean;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export declare interface GeoVideoManifest {
|
|
238
|
+
schemaVersion: 3;
|
|
239
|
+
id: string;
|
|
240
|
+
type: "geovideo";
|
|
241
|
+
projection: "equirectangular";
|
|
242
|
+
bounds: GeoVideoBounds;
|
|
243
|
+
media: {
|
|
244
|
+
url: string;
|
|
245
|
+
mimeType: "video/mp4" | string;
|
|
246
|
+
width: number;
|
|
247
|
+
height: number;
|
|
248
|
+
fps: number;
|
|
249
|
+
durationSeconds: number;
|
|
250
|
+
codec: "h264" | string;
|
|
251
|
+
};
|
|
252
|
+
encoding: GeoVideoScalarEncoding | GeoVideoVectorEncoding;
|
|
253
|
+
mask: {
|
|
254
|
+
kind: "static-validity";
|
|
255
|
+
url: string;
|
|
256
|
+
mimeType: "image/png" | string;
|
|
257
|
+
width: number;
|
|
258
|
+
height: number;
|
|
259
|
+
threshold: number;
|
|
260
|
+
};
|
|
261
|
+
timeline: GeoVideoRangeTimeline | GeoVideoSnapshotLoopTimeline | GeoVideoSampleSequenceTimeline;
|
|
262
|
+
provenance: {
|
|
263
|
+
catalogEntryId: string;
|
|
264
|
+
inputSourceId: string;
|
|
265
|
+
provider?: string;
|
|
266
|
+
identifiers?: Record<string, string>;
|
|
267
|
+
variables: string[];
|
|
268
|
+
generatedAt: string;
|
|
269
|
+
};
|
|
270
|
+
style: {
|
|
271
|
+
palette: string;
|
|
272
|
+
colorDomain: [number, number];
|
|
273
|
+
unit?: string;
|
|
274
|
+
logScale?: boolean;
|
|
275
|
+
vibrance?: number;
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
declare interface GeoVideoRangeTimeline {
|
|
280
|
+
kind: "range";
|
|
281
|
+
dateStart: string;
|
|
282
|
+
dateEnd: string;
|
|
283
|
+
interpolation: "linear" | "nearest";
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare interface GeoVideoSampleSequenceTimeline {
|
|
287
|
+
kind: "sample-sequence";
|
|
288
|
+
values: string[];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export declare interface GeoVideoScalarEncoding {
|
|
292
|
+
kind: "scalar-luma";
|
|
293
|
+
bits: 8;
|
|
294
|
+
codeMin: number;
|
|
295
|
+
codeMax: number;
|
|
296
|
+
valueMin: number;
|
|
297
|
+
valueMax: number;
|
|
298
|
+
transfer: "linear";
|
|
299
|
+
colorSpace: "bt709";
|
|
300
|
+
colorRange: "limited" | "full";
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Scalar-luma GeoVideo read frame by frame (seek, no playback), for values
|
|
305
|
+
* sampled on the GPU rather than the styled playback of GeoVideoLayer.
|
|
306
|
+
*/
|
|
307
|
+
export declare class GeoVideoScalarSource extends GeoVideoFrameSource<Float32Array> {
|
|
308
|
+
private readonly encoding;
|
|
309
|
+
constructor(manifest: GeoVideoManifest, options?: {
|
|
310
|
+
cacheSize?: number;
|
|
311
|
+
});
|
|
312
|
+
protected decodeCodes(codes: Uint8Array, mask: Uint8Array, threshold: number): Float32Array;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
declare interface GeoVideoSnapshotLoopTimeline {
|
|
316
|
+
kind: "snapshot-loop";
|
|
317
|
+
date: string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export declare function geoVideoTimelineValues(manifest: GeoVideoManifest): number[];
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* u and v stacked vertically in luma (u rows on top). Each component maps
|
|
324
|
+
* [-valueDomain, valueDomain] to [codeMin, codeMax]; "sqrt" stores
|
|
325
|
+
* sign(x)·sqrt(|x|/valueDomain) to keep precision on slow flows. The static
|
|
326
|
+
* mask covers one component (media height / 2).
|
|
327
|
+
*/
|
|
328
|
+
export declare interface GeoVideoVectorEncoding {
|
|
329
|
+
kind: "vector-luma";
|
|
330
|
+
bits: 8;
|
|
331
|
+
codeMin: number;
|
|
332
|
+
codeMax: number;
|
|
333
|
+
valueDomain: number;
|
|
334
|
+
transfer: "linear" | "sqrt";
|
|
335
|
+
layout: "stacked-uv";
|
|
336
|
+
colorSpace: "bt709";
|
|
337
|
+
colorRange: "limited" | "full";
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** Decoded u/v planes of one frame, NaN where the static mask is invalid. */
|
|
341
|
+
export declare interface GeoVideoVectorFrame {
|
|
342
|
+
u: Float32Array;
|
|
343
|
+
v: Float32Array;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* VectorLayer field source backed by a vector-luma GeoVideo: each time step is
|
|
348
|
+
* one video frame, decoded on demand (frame by frame, no playback) into a
|
|
349
|
+
* single chunk covering the whole grid.
|
|
350
|
+
*/
|
|
351
|
+
export declare class GeoVideoVectorSource extends GeoVideoFrameSource<GeoVideoVectorFrame> implements VectorFieldSource {
|
|
352
|
+
private readonly encoding;
|
|
353
|
+
private readonly coords;
|
|
354
|
+
constructor(manifest: GeoVideoManifest, options?: {
|
|
355
|
+
cacheSize?: number;
|
|
356
|
+
});
|
|
357
|
+
getValueDomain(): number;
|
|
358
|
+
getCoords(): {
|
|
359
|
+
time: Float64Array;
|
|
360
|
+
vertical: Float32Array;
|
|
361
|
+
latitude: Float32Array;
|
|
362
|
+
longitude: Float32Array;
|
|
363
|
+
};
|
|
364
|
+
getDimensions(): string[];
|
|
365
|
+
getChunkShape(): number[];
|
|
366
|
+
findDepthIndex(): number;
|
|
367
|
+
findTimeIndex(time: string | number): number;
|
|
368
|
+
getChunksForBounds(_variable: string, timeIdx: number, depthIdx: number): Array<{
|
|
369
|
+
timeIdx: number;
|
|
370
|
+
depthIdx: number;
|
|
371
|
+
latIdx: number;
|
|
372
|
+
lonIdx: number;
|
|
373
|
+
latRange: [number, number];
|
|
374
|
+
lonRange: [number, number];
|
|
375
|
+
latSize: number;
|
|
376
|
+
lonSize: number;
|
|
377
|
+
}>;
|
|
378
|
+
fetchSpatialChunkResult(variable: string, selection: {
|
|
379
|
+
timeIndex: number;
|
|
380
|
+
}): Promise<ZarrChunkFetchResult>;
|
|
381
|
+
protected decodeCodes(codes: Uint8Array, mask: Uint8Array, threshold: number): GeoVideoVectorFrame;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export declare function getPalettes(): PaletteMeta[];
|
|
385
|
+
|
|
386
|
+
export declare function isGeoVideoArchiveSource(source: CatalogSource): source is CatalogGeoVideoArchiveSource;
|
|
387
|
+
|
|
388
|
+
export declare function loadGeoVideoIndex(url: string, signal?: AbortSignal): Promise<GeoVideoIndex>;
|
|
389
|
+
|
|
390
|
+
export declare function loadGeoVideoManifest(source: string | GeoVideoManifest, signal?: AbortSignal): Promise<GeoVideoManifest>;
|
|
391
|
+
|
|
392
|
+
declare type LocalizedText = Record<string, string>;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* The chunk of `current`'s archive that follows it inside `range`, or with
|
|
396
|
+
* `loop`, the first one inside it, with the time playback resumes at.
|
|
397
|
+
*/
|
|
398
|
+
export declare function nextChunk<T extends CatalogSource>(chunks: readonly T[], current: CatalogSource, options?: {
|
|
399
|
+
range?: readonly [number, number] | null;
|
|
400
|
+
loop?: boolean;
|
|
401
|
+
}): {
|
|
402
|
+
source: T;
|
|
403
|
+
time: number;
|
|
404
|
+
} | null;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* The candidate whose sample range overlaps `chunk` the most: archives
|
|
408
|
+
* sampled at different hours (six-hourly from 00:00, daily at 12:00) still
|
|
409
|
+
* pair by calendar period. Null when none overlaps.
|
|
410
|
+
*/
|
|
411
|
+
export declare function pairChunk<T extends CatalogSource>(chunk: CatalogSource, candidates: readonly T[]): T | null;
|
|
412
|
+
|
|
413
|
+
export declare interface PaletteMeta {
|
|
414
|
+
id: string;
|
|
415
|
+
label: string;
|
|
416
|
+
tags: string[];
|
|
417
|
+
colors: string[];
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Complete grade from partial input. Missing or non-finite values take the
|
|
422
|
+
* vibrant preset, others are clamped to their range; `enabled` defaults to
|
|
423
|
+
* true when any input is given, so `{}` means "vibrant".
|
|
424
|
+
*/
|
|
425
|
+
export declare function resolveColorGrade(input?: Partial<ColorGrade>): ColorGrade;
|
|
426
|
+
|
|
427
|
+
export declare function resolveColorRamp(input: ColorRampInput, options?: {
|
|
428
|
+
reverse?: boolean;
|
|
429
|
+
}): Record<number, string>;
|
|
430
|
+
|
|
431
|
+
export declare type ScalarColorDomain = [number, number];
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Camera-aware per-frame fade opacity: eases toward a short retention while
|
|
435
|
+
* the camera moves, then back to the configured one. Smoothstep avoids
|
|
436
|
+
* visible slope changes at both ends.
|
|
437
|
+
*/
|
|
438
|
+
export declare class TrailFade {
|
|
439
|
+
private base;
|
|
440
|
+
private moving;
|
|
441
|
+
private from;
|
|
442
|
+
private to;
|
|
443
|
+
private start;
|
|
444
|
+
private duration;
|
|
445
|
+
constructor(base: number);
|
|
446
|
+
/** Configured opacity, applied at once unless the camera moves. */
|
|
447
|
+
setBase(base: number): void;
|
|
448
|
+
setMoving(moving: boolean, now: number): void;
|
|
449
|
+
value(now: number): number;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export declare function validateGeoVideoIndex(value: unknown): GeoVideoIndex;
|
|
453
|
+
|
|
454
|
+
export declare function validateGeoVideoManifest(value: unknown): GeoVideoManifest;
|
|
455
|
+
|
|
456
|
+
export declare function validateScalarColorDomain(domain: ScalarColorDomain | null): ScalarColorDomain | null;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Field source contract used by VectorLayer. ZarrSource satisfies it; frame
|
|
460
|
+
* sources such as GeoVideoVectorSource implement it to feed decoded frames.
|
|
461
|
+
*/
|
|
462
|
+
declare type VectorFieldSource = Pick<ZarrSource, "init" | "cancelAll" | "getCoords" | "getDimensions" | "getChunkShape" | "findTimeIndex" | "findDepthIndex" | "getChunksForBounds" | "fetchSpatialChunkResult"> & {
|
|
463
|
+
/**
|
|
464
|
+
* Fixed symmetric component domain [-d, d]. When provided, it replaces the
|
|
465
|
+
* per-frame min/max so speed and color normalization stay stable in time.
|
|
466
|
+
*/
|
|
467
|
+
getValueDomain?(): number;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
declare interface ZarrAttrs {
|
|
471
|
+
_ARRAY_DIMENSIONS?: string[];
|
|
472
|
+
units?: string;
|
|
473
|
+
standard_name?: string;
|
|
474
|
+
long_name?: string;
|
|
475
|
+
calendar?: string;
|
|
476
|
+
positive?: "up" | "down" | string;
|
|
477
|
+
[key: string]: unknown;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
declare interface ZarrChunkFetchResult {
|
|
481
|
+
data: Float32Array;
|
|
482
|
+
missing: boolean;
|
|
483
|
+
status?: number;
|
|
484
|
+
url: string;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
declare interface ZarrPointSample {
|
|
488
|
+
axisValue: number;
|
|
489
|
+
time?: number;
|
|
490
|
+
depth?: number;
|
|
491
|
+
values: Record<string, number>;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
declare interface ZarrPointSeriesResult {
|
|
495
|
+
longitude: number;
|
|
496
|
+
latitude: number;
|
|
497
|
+
depth?: number;
|
|
498
|
+
time?: number;
|
|
499
|
+
points: ZarrPointSample[];
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
declare class ZarrSource {
|
|
503
|
+
private root;
|
|
504
|
+
private meta;
|
|
505
|
+
private coords;
|
|
506
|
+
private initPromise;
|
|
507
|
+
private verticalName;
|
|
508
|
+
private timeUnits;
|
|
509
|
+
private timeCalendar;
|
|
510
|
+
private cache;
|
|
511
|
+
private maxCacheSize;
|
|
512
|
+
private abortControllers;
|
|
513
|
+
private bloscCodecCache;
|
|
514
|
+
constructor(root: string, maxCacheSize?: number);
|
|
515
|
+
init(): Promise<void>;
|
|
516
|
+
private getArrayMeta;
|
|
517
|
+
private getAttrs;
|
|
518
|
+
getDimensionSeparator(variable: string): string;
|
|
519
|
+
getShape(variable: string): number[];
|
|
520
|
+
getChunkShape(variable: string): number[];
|
|
521
|
+
getCoords(): CoordArrays;
|
|
522
|
+
getTimeDimension(): ZarrTimeDimension;
|
|
523
|
+
getVerticalDimension(variable?: string): ZarrVerticalDimension | undefined;
|
|
524
|
+
hasVariable(variable: string): boolean;
|
|
525
|
+
getVariableAttrs(variable: string): ZarrAttrs;
|
|
526
|
+
getDimensions(variable: string): string[];
|
|
527
|
+
findNearestIndex(array: Float32Array | Float64Array, value: number): number;
|
|
528
|
+
findTimeIndex(time: string | number): number;
|
|
529
|
+
/**
|
|
530
|
+
* Convert a Unix-ms timestamp to the native time units used by this zarr
|
|
531
|
+
* (read from the time variable's .zattrs "units" field).
|
|
532
|
+
* Unsupported units are rejected during initialization rather than guessed.
|
|
533
|
+
*/
|
|
534
|
+
private msToZarrTime;
|
|
535
|
+
private zarrTimeToMs;
|
|
536
|
+
private parseTimeEncoding;
|
|
537
|
+
private findNearestLongitudeIndex;
|
|
538
|
+
private sampleVariableAt;
|
|
539
|
+
private getFlatOffset;
|
|
540
|
+
findDepthIndex(depth: number): number;
|
|
541
|
+
sampleTimeSeries(options: {
|
|
542
|
+
variables: string[];
|
|
543
|
+
longitude: number;
|
|
544
|
+
latitude: number;
|
|
545
|
+
depth?: number;
|
|
546
|
+
timeStartIndex?: number;
|
|
547
|
+
timeEndIndex?: number;
|
|
548
|
+
stride?: number;
|
|
549
|
+
stopAfterMissingSamples?: number;
|
|
550
|
+
}): Promise<ZarrPointSeriesResult>;
|
|
551
|
+
sampleVerticalProfile(options: {
|
|
552
|
+
variables: string[];
|
|
553
|
+
longitude: number;
|
|
554
|
+
latitude: number;
|
|
555
|
+
time: string | number;
|
|
556
|
+
maxDepths?: number;
|
|
557
|
+
stride?: number;
|
|
558
|
+
stopAfterMissingSamples?: number;
|
|
559
|
+
}): Promise<ZarrPointSeriesResult>;
|
|
560
|
+
/** Return the actual name of the vertical dimension ("depth" or "elevation"). */
|
|
561
|
+
getVerticalDimName(): string;
|
|
562
|
+
/**
|
|
563
|
+
* Get chunk indices that intersect a geographic bounding box.
|
|
564
|
+
*/
|
|
565
|
+
getChunksForBounds(variable: string, timeIdx: number, depthIdx: number, bounds: {
|
|
566
|
+
west: number;
|
|
567
|
+
south: number;
|
|
568
|
+
east: number;
|
|
569
|
+
north: number;
|
|
570
|
+
}): Array<{
|
|
571
|
+
timeIdx: number;
|
|
572
|
+
depthIdx: number;
|
|
573
|
+
latIdx: number;
|
|
574
|
+
lonIdx: number;
|
|
575
|
+
latRange: [number, number];
|
|
576
|
+
lonRange: [number, number];
|
|
577
|
+
latSize: number;
|
|
578
|
+
lonSize: number;
|
|
579
|
+
}>;
|
|
580
|
+
fetchChunk(variable: string, indices: number[]): Promise<Float32Array>;
|
|
581
|
+
/**
|
|
582
|
+
* Fetch one latitude/longitude chunk and extract the requested time/vertical
|
|
583
|
+
* plane from it. Logical coordinate indices are converted to physical Zarr
|
|
584
|
+
* chunk indices before fetching.
|
|
585
|
+
*/
|
|
586
|
+
fetchSpatialChunkResult(variable: string, selection: {
|
|
587
|
+
timeIndex: number;
|
|
588
|
+
verticalIndex: number;
|
|
589
|
+
latitudeChunkIndex: number;
|
|
590
|
+
longitudeChunkIndex: number;
|
|
591
|
+
}): Promise<ZarrChunkFetchResult>;
|
|
592
|
+
fetchChunkResult(variable: string, indices: number[]): Promise<ZarrChunkFetchResult>;
|
|
593
|
+
cancelAll(): void;
|
|
594
|
+
private cacheChunk;
|
|
595
|
+
private getBloscCodec;
|
|
596
|
+
private decompress;
|
|
597
|
+
private loadCoordinates;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
declare interface ZarrTimeDimension {
|
|
601
|
+
min: number;
|
|
602
|
+
max: number;
|
|
603
|
+
step?: number;
|
|
604
|
+
size: number;
|
|
605
|
+
units: string;
|
|
606
|
+
values: number[];
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
declare interface ZarrVerticalDimension {
|
|
610
|
+
name: string;
|
|
611
|
+
label: "depth" | "pressure" | string;
|
|
612
|
+
units?: string;
|
|
613
|
+
values: number[];
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export { }
|
package/dist/engine.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { C as o, a as r, G as s, b as i, T as d, c as l, d as t, e as c, f as G, g as V, h as m, i as n, j as u, k as C, l as f, m as p, n as v, p as x, r as R, o as S, v as T, q as O } from "./geovideo-index-CD5wflJT.js";
|
|
2
|
+
import { G as h } from "./GeoVideoScalarSource-DoQAnyTy.js";
|
|
3
|
+
import { v as k } from "./scalar-color-domain-PEK8Hxg1.js";
|
|
4
|
+
export {
|
|
5
|
+
o as COLOR_GRADE_OFF,
|
|
6
|
+
r as COLOR_GRADE_VIBRANT,
|
|
7
|
+
s as GeoVideoFrameSource,
|
|
8
|
+
h as GeoVideoScalarSource,
|
|
9
|
+
i as GeoVideoVectorSource,
|
|
10
|
+
d as TrailFade,
|
|
11
|
+
l as colorGradeVec4,
|
|
12
|
+
t as createColorRampTexture,
|
|
13
|
+
c as createProgram,
|
|
14
|
+
G as fadeToFrames,
|
|
15
|
+
V as fadeToOpacity,
|
|
16
|
+
m as geoVideoChunkSources,
|
|
17
|
+
n as geoVideoTimelineValues,
|
|
18
|
+
u as getPalettes,
|
|
19
|
+
C as isGeoVideoArchiveSource,
|
|
20
|
+
f as loadGeoVideoIndex,
|
|
21
|
+
p as loadGeoVideoManifest,
|
|
22
|
+
v as nextChunk,
|
|
23
|
+
x as pairChunk,
|
|
24
|
+
R as resolveColorGrade,
|
|
25
|
+
S as resolveColorRamp,
|
|
26
|
+
T as validateGeoVideoIndex,
|
|
27
|
+
O as validateGeoVideoManifest,
|
|
28
|
+
k as validateScalarColorDomain
|
|
29
|
+
};
|