@fxi/zartigl 0.10.1 → 0.10.3
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/dist/catalog.d.ts +19 -0
- package/dist/catalog.js +24 -21
- package/dist/engine.d.ts +266 -0
- package/dist/engine.js +69 -53
- package/dist/geovideo-index-BqOLqzgA.js +1839 -0
- package/dist/{index-Bf2yvpf1.js → index-vBlS9sIT.js} +116 -97
- package/dist/zartigl.d.ts +74 -131
- package/dist/zartigl.js +2333 -2633
- package/package.json +1 -1
- package/dist/geovideo-index-ClNfzbOG.js +0 -1342
package/dist/zartigl.d.ts
CHANGED
|
@@ -252,29 +252,14 @@ east: number,
|
|
|
252
252
|
north: number
|
|
253
253
|
];
|
|
254
254
|
|
|
255
|
-
declare type GeoVideoEventMap =
|
|
256
|
-
loading: () => void;
|
|
257
|
-
loaded: (meta: FieldMeta) => void;
|
|
258
|
-
error: (error: Error) => void;
|
|
259
|
-
status: (status: ZartiglStatus) => void;
|
|
260
|
-
timeChange: (time: number) => void;
|
|
261
|
-
playbackChange: (playing: boolean) => void;
|
|
262
|
-
/** Playback reached the end of the timeline without looping. */
|
|
263
|
-
playbackEnd: () => void;
|
|
264
|
-
};
|
|
255
|
+
declare type GeoVideoEventMap = GeoVideoPlaybackEvents;
|
|
265
256
|
|
|
266
257
|
export declare class GeoVideoLayer implements CustomLayerInterface {
|
|
267
258
|
readonly id: string;
|
|
268
259
|
readonly type: "custom";
|
|
269
260
|
readonly renderingMode: "3d";
|
|
270
261
|
private readonly source;
|
|
271
|
-
|
|
272
|
-
private playOnReady;
|
|
273
|
-
private loop;
|
|
274
|
-
private playbackRate;
|
|
275
|
-
private requestedTime;
|
|
276
|
-
private requestedTimeRange?;
|
|
277
|
-
private timeRange;
|
|
262
|
+
private readonly playback;
|
|
278
263
|
private opacity;
|
|
279
264
|
private colorRamp;
|
|
280
265
|
private colorDomain;
|
|
@@ -283,78 +268,25 @@ export declare class GeoVideoLayer implements CustomLayerInterface {
|
|
|
283
268
|
private map;
|
|
284
269
|
private gl;
|
|
285
270
|
private manifest;
|
|
286
|
-
private video;
|
|
287
|
-
/** Manifest of `video`, which still differs from `manifest` mid-swap. */
|
|
288
|
-
private videoManifest;
|
|
289
|
-
/** Incoming media of a swap, shown once its first frame is decodable. */
|
|
290
|
-
private pendingVideo;
|
|
291
|
-
private standby;
|
|
292
|
-
/** Ended on a preloaded artifact: playing until it is swapped in or paused. */
|
|
293
|
-
private awaitingNext;
|
|
294
|
-
private maskUrl;
|
|
295
|
-
private colorTexture;
|
|
296
|
-
private maskTexture;
|
|
297
271
|
private colorRampTexture;
|
|
298
|
-
private maskCanvas;
|
|
299
|
-
private maskContext;
|
|
300
272
|
private mercatorProgram;
|
|
301
273
|
private globeProgram;
|
|
302
274
|
private vertexBuffer;
|
|
303
275
|
private indexBuffer;
|
|
304
276
|
private indexCount;
|
|
305
|
-
private frameCallback;
|
|
306
|
-
private repaintFrame;
|
|
307
|
-
private frameDirty;
|
|
308
|
-
private maskDirty;
|
|
309
|
-
private colorTextureInitialized;
|
|
310
|
-
private maskTextureInitialized;
|
|
311
|
-
private maskCaptured;
|
|
312
|
-
private mediaReady;
|
|
313
|
-
private readyEmitted;
|
|
314
|
-
private hasVideoFrameCallback;
|
|
315
|
-
private lastBufferedMediaTime;
|
|
316
|
-
private lastUploadedMediaTime;
|
|
317
|
-
private decodedFrames;
|
|
318
|
-
private frameCallbackCount;
|
|
319
|
-
private frameCallbackTimes;
|
|
320
|
-
private lastFrameCallbackAt;
|
|
321
|
-
private bufferedFrames;
|
|
322
|
-
private skippedFrames;
|
|
323
|
-
private uploadedFrames;
|
|
324
|
-
private lastUploadDurationMs;
|
|
325
277
|
private abortController;
|
|
326
|
-
private resumePlayback;
|
|
327
|
-
private stepTimer;
|
|
328
|
-
private endEmitted;
|
|
329
278
|
private listeners;
|
|
330
279
|
constructor(options: GeoVideoLayerOptions);
|
|
331
280
|
onAdd(map: Map_2, context: WebGLRenderingContext | WebGL2RenderingContext): Promise<void>;
|
|
332
281
|
render(context: WebGLRenderingContext | WebGL2RenderingContext, options: CustomRenderMethodInput): void;
|
|
333
282
|
onRemove(): void;
|
|
334
283
|
setTime(time: string | number): void;
|
|
335
|
-
/**
|
|
336
|
-
* Switch to another artifact of the same frame size, such as the next
|
|
337
|
-
* archive chunk, keeping the map layer and GL state. The current frame stays
|
|
338
|
-
* on screen until the new media can show its first one, at once when it was
|
|
339
|
-
* preloaded. Returns false when the artifact needs a new layer.
|
|
340
|
-
*/
|
|
341
284
|
replaceManifest(manifest: GeoVideoManifest, options?: GeoVideoReplaceOptions): boolean;
|
|
342
|
-
/**
|
|
343
|
-
* Load the artifact expected next, such as the following archive chunk, so
|
|
344
|
-
* `replaceManifest` can show it without waiting for the network. Until then,
|
|
345
|
-
* reaching the end of the current artifact keeps the playing state and
|
|
346
|
-
* emits `playbackEnd` for the caller to swap it in, or to pause. Returns
|
|
347
|
-
* false when the artifact cannot replace the current one in place.
|
|
348
|
-
*/
|
|
349
285
|
preloadManifest(manifest: GeoVideoManifest, options?: GeoVideoReplaceOptions): boolean;
|
|
350
|
-
/** Clamped time range of a compatible replacement, else null. */
|
|
351
|
-
private replacementTimeRange;
|
|
352
|
-
/** The preloaded artifact when it holds this media; any other is dropped. */
|
|
353
|
-
private takeStandby;
|
|
354
286
|
setTimeAndDepth(time: string | number, _depth: number): void;
|
|
355
287
|
setDepth(_depth: number): void;
|
|
356
|
-
prefetchTime(
|
|
357
|
-
isFrameCached(
|
|
288
|
+
prefetchTime(ms: number): Promise<void>;
|
|
289
|
+
isFrameCached(ms: number): boolean;
|
|
358
290
|
cancelPrefetches(): void;
|
|
359
291
|
suspend(): void;
|
|
360
292
|
resume(): void;
|
|
@@ -366,24 +298,6 @@ export declare class GeoVideoLayer implements CustomLayerInterface {
|
|
|
366
298
|
setOpacity(value: number): void;
|
|
367
299
|
play(): Promise<void>;
|
|
368
300
|
pause(): void;
|
|
369
|
-
/**
|
|
370
|
-
* Playback is a request, applied once ready, while the manifest loads,
|
|
371
|
-
* mid-swap, or at an end waiting for the preloaded artifact.
|
|
372
|
-
*/
|
|
373
|
-
private deferredPlayback;
|
|
374
|
-
private isPlaying;
|
|
375
|
-
/**
|
|
376
|
-
* Below the slowest media rate browsers accept, keep the video paused and
|
|
377
|
-
* seek one sample (or frame) at a time.
|
|
378
|
-
*/
|
|
379
|
-
private startStepping;
|
|
380
|
-
private stopStepping;
|
|
381
|
-
private step;
|
|
382
|
-
/**
|
|
383
|
-
* The timeline ended without looping. With a preloaded artifact, keep the
|
|
384
|
-
* playing state for the caller to swap it in; otherwise stop.
|
|
385
|
-
*/
|
|
386
|
-
private reachEnd;
|
|
387
301
|
setLoop(loop: boolean): void;
|
|
388
302
|
setPlaybackRate(rate: number): void;
|
|
389
303
|
setTimeRange(range: [number, number]): void;
|
|
@@ -392,35 +306,6 @@ export declare class GeoVideoLayer implements CustomLayerInterface {
|
|
|
392
306
|
on<K extends keyof GeoVideoEventMap>(event: K, handler: GeoVideoEventMap[K]): this;
|
|
393
307
|
off<K extends keyof GeoVideoEventMap>(event: K, handler: GeoVideoEventMap[K]): this;
|
|
394
308
|
private initGl;
|
|
395
|
-
private initVideo;
|
|
396
|
-
/**
|
|
397
|
-
* Media element for a manifest. Its events drive the layer only while it is
|
|
398
|
-
* the current video and no swap is pending.
|
|
399
|
-
*/
|
|
400
|
-
private createVideo;
|
|
401
|
-
/** Track presented frames of the current video. */
|
|
402
|
-
private startFrameCallbacks;
|
|
403
|
-
/**
|
|
404
|
-
* Time a loading video opens at: its preload target, or the requested time
|
|
405
|
-
* within the active range.
|
|
406
|
-
*/
|
|
407
|
-
private startTime;
|
|
408
|
-
private checkVideoSize;
|
|
409
|
-
private cancelFrameCallback;
|
|
410
|
-
/** Stop the current video and free its media resources. */
|
|
411
|
-
private releaseVideo;
|
|
412
|
-
private discardStandby;
|
|
413
|
-
private discardPendingVideo;
|
|
414
|
-
private bufferFrame;
|
|
415
|
-
private createMaskImage;
|
|
416
|
-
/** Show the mask of a manifest once its image, possibly preloaded, loads. */
|
|
417
|
-
private applyMask;
|
|
418
|
-
private emitReady;
|
|
419
|
-
private createVideoTexture;
|
|
420
|
-
private uploadTextureSource;
|
|
421
|
-
private startRepaintLoop;
|
|
422
|
-
private stopRepaintLoop;
|
|
423
|
-
private presentedFps;
|
|
424
309
|
private bindGrid;
|
|
425
310
|
private unbindGrid;
|
|
426
311
|
private emit;
|
|
@@ -515,6 +400,34 @@ export declare interface GeoVideoOptions {
|
|
|
515
400
|
stepsPerSecond?: number;
|
|
516
401
|
}
|
|
517
402
|
|
|
403
|
+
declare type GeoVideoPlaybackEvents = {
|
|
404
|
+
loading: () => void;
|
|
405
|
+
loaded: (meta: FieldMeta) => void;
|
|
406
|
+
error: (error: Error) => void;
|
|
407
|
+
status: (status: ZartiglStatus) => void;
|
|
408
|
+
timeChange: (time: number) => void;
|
|
409
|
+
playbackChange: (playing: boolean) => void;
|
|
410
|
+
/** Playback reached the end of the timeline without looping. */
|
|
411
|
+
playbackEnd: () => void;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
declare interface GeoVideoPlaybackOptions {
|
|
415
|
+
time?: string | number;
|
|
416
|
+
timeRange?: [number, number];
|
|
417
|
+
autoplay?: boolean;
|
|
418
|
+
loop?: boolean;
|
|
419
|
+
playbackRate?: number;
|
|
420
|
+
stepsPerSecond?: number;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
declare interface GeoVideoPlaybackReplaceOptions {
|
|
424
|
+
time?: number;
|
|
425
|
+
stepsPerSecond?: number;
|
|
426
|
+
timeRange?: [number, number];
|
|
427
|
+
loop?: boolean;
|
|
428
|
+
playbackRate?: number;
|
|
429
|
+
}
|
|
430
|
+
|
|
518
431
|
export declare interface GeoVideoRangeTimeline {
|
|
519
432
|
kind: "range";
|
|
520
433
|
dateStart: string;
|
|
@@ -526,12 +439,7 @@ export declare interface GeoVideoRangeTimeline {
|
|
|
526
439
|
* Playback state for an artifact swapped in with `replaceManifest`, or
|
|
527
440
|
* loaded ahead with `preloadManifest`.
|
|
528
441
|
*/
|
|
529
|
-
declare
|
|
530
|
-
time?: number;
|
|
531
|
-
timeRange?: [number, number];
|
|
532
|
-
loop?: boolean;
|
|
533
|
-
playbackRate?: number;
|
|
534
|
-
}
|
|
442
|
+
declare type GeoVideoReplaceOptions = GeoVideoPlaybackReplaceOptions;
|
|
535
443
|
|
|
536
444
|
export declare interface GeoVideoSampleSequenceTimeline {
|
|
537
445
|
kind: "sample-sequence";
|
|
@@ -616,7 +524,7 @@ declare type LayerEventMap = {
|
|
|
616
524
|
cacheInvalidated: () => void;
|
|
617
525
|
};
|
|
618
526
|
|
|
619
|
-
declare type LayerEventMap_2 = {
|
|
527
|
+
declare type LayerEventMap_2 = GeoVideoPlaybackEvents & {
|
|
620
528
|
loading: () => void;
|
|
621
529
|
loaded: (meta: FieldMeta) => void;
|
|
622
530
|
error: (err: Error) => void;
|
|
@@ -674,6 +582,11 @@ declare type LocalizedText = Record<string, string>;
|
|
|
674
582
|
export declare interface MapxWidgetSnippetOptions {
|
|
675
583
|
layerId: string;
|
|
676
584
|
layerKind: CatalogEntry["kind"];
|
|
585
|
+
/** Legend header (MapX widget only); MapX derives it from the layer when unset. */
|
|
586
|
+
title?: LocalizedText | string;
|
|
587
|
+
subtitle?: LocalizedText | string;
|
|
588
|
+
/** Shown as the legend title's tooltip. */
|
|
589
|
+
description?: LocalizedText | string;
|
|
677
590
|
/**
|
|
678
591
|
* The layer's own style, the catalog `defaults`: only override keys that
|
|
679
592
|
* differ from it are written. Unknown, the whole override is written.
|
|
@@ -773,19 +686,19 @@ export declare class ParticleSimulation {
|
|
|
773
686
|
south: number;
|
|
774
687
|
east: number;
|
|
775
688
|
north: number;
|
|
776
|
-
}, isGlobe?: boolean, globeCenter?: [number, number, number], clippingPlane?: [number, number, number, number]): void;
|
|
689
|
+
}, isGlobe?: boolean, globeCenter?: [number, number, number], clippingPlane?: [number, number, number, number], velocityPair?: VelocityTexturePair): void;
|
|
777
690
|
renderGrid(velocityTexUnit: number, velocityMin: [number, number], velocityMax: [number, number], matrix: Iterable<number>, worldSize: number, worldCopyOffsets: number[], geoBounds: {
|
|
778
691
|
west: number;
|
|
779
692
|
south: number;
|
|
780
693
|
east: number;
|
|
781
694
|
north: number;
|
|
782
|
-
}, opacityScale?: number, solid?: Vec4): void;
|
|
695
|
+
}, opacityScale?: number, solid?: Vec4, velocityPair?: VelocityTexturePair): void;
|
|
783
696
|
renderGridGlobe(velocityTexUnit: number, velocityMin: [number, number], velocityMax: [number, number], matrix: Iterable<number>, geoBounds: {
|
|
784
697
|
west: number;
|
|
785
698
|
south: number;
|
|
786
699
|
east: number;
|
|
787
700
|
north: number;
|
|
788
|
-
}, clippingPlane: [number, number, number, number], opacityScale?: number, solid?: Vec4): void;
|
|
701
|
+
}, clippingPlane: [number, number, number, number], opacityScale?: number, solid?: Vec4, velocityPair?: VelocityTexturePair): void;
|
|
789
702
|
private setGridFieldUniforms;
|
|
790
703
|
private bindRasterGrid;
|
|
791
704
|
private unbindRasterGrid;
|
|
@@ -1199,9 +1112,12 @@ export declare class VectorLayer implements CustomLayerInterface {
|
|
|
1199
1112
|
readonly renderingMode: "3d";
|
|
1200
1113
|
private map;
|
|
1201
1114
|
private gl;
|
|
1115
|
+
private readonly playback;
|
|
1116
|
+
private readonly geoVideoManifest?;
|
|
1202
1117
|
private simulation;
|
|
1203
1118
|
private velocityField;
|
|
1204
|
-
private
|
|
1119
|
+
private readonly zarrSourceValue;
|
|
1120
|
+
private get zarrSource();
|
|
1205
1121
|
private variableU;
|
|
1206
1122
|
private variableV;
|
|
1207
1123
|
private vectorDerivation;
|
|
@@ -1256,6 +1172,13 @@ export declare class VectorLayer implements CustomLayerInterface {
|
|
|
1256
1172
|
suspend(): void;
|
|
1257
1173
|
resume(): void;
|
|
1258
1174
|
setDepth(depth: number): void;
|
|
1175
|
+
play(): Promise<void>;
|
|
1176
|
+
pause(): void;
|
|
1177
|
+
setLoop(loop: boolean): void;
|
|
1178
|
+
setStepsPerSecond(value: number): void;
|
|
1179
|
+
setTimeRange(range: [number, number]): void;
|
|
1180
|
+
replaceManifest(manifest: GeoVideoManifest, options?: GeoVideoPlaybackReplaceOptions): boolean;
|
|
1181
|
+
preloadManifest(manifest: GeoVideoManifest, options?: GeoVideoPlaybackReplaceOptions): boolean;
|
|
1259
1182
|
setSpeed(v: number): void;
|
|
1260
1183
|
setFade(v: number): void;
|
|
1261
1184
|
setParticleDensity(density: number): void;
|
|
@@ -1287,6 +1210,10 @@ export declare interface VectorLayerDebugInfo {
|
|
|
1287
1210
|
}
|
|
1288
1211
|
|
|
1289
1212
|
export declare interface VectorLayerOptions {
|
|
1213
|
+
/** Decoded GeoVideo playback; omitted for the unchanged Zarr field path. */
|
|
1214
|
+
geoVideo?: GeoVideoPlaybackOptions & {
|
|
1215
|
+
manifest: GeoVideoManifest;
|
|
1216
|
+
};
|
|
1290
1217
|
id: string;
|
|
1291
1218
|
source: string;
|
|
1292
1219
|
/** Optional initialized/shared source. When omitted, the layer creates one from `source`. */
|
|
@@ -1382,6 +1309,22 @@ export declare class VelocityField {
|
|
|
1382
1309
|
destroy(): void;
|
|
1383
1310
|
}
|
|
1384
1311
|
|
|
1312
|
+
/** One bound velocity texture and the physical range used to decode it. */
|
|
1313
|
+
declare interface VelocityTextureField {
|
|
1314
|
+
unit: number;
|
|
1315
|
+
min: [number, number];
|
|
1316
|
+
max: [number, number];
|
|
1317
|
+
/** Physical (u, v, validity, 0); otherwise normalized (u, v, 0, validity). */
|
|
1318
|
+
physical?: boolean;
|
|
1319
|
+
northToSouth?: boolean;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
declare interface VelocityTexturePair {
|
|
1323
|
+
a: VelocityTextureField;
|
|
1324
|
+
b: VelocityTextureField;
|
|
1325
|
+
mix: number;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1385
1328
|
declare interface WebGLRendererInfo {
|
|
1386
1329
|
vendor: string;
|
|
1387
1330
|
renderer: string;
|
|
@@ -1736,7 +1679,7 @@ export declare class Zartigl {
|
|
|
1736
1679
|
/** GeoVideo playback options shared by a new layer and an in-place swap. */
|
|
1737
1680
|
private geoVideoPlayback;
|
|
1738
1681
|
/**
|
|
1739
|
-
* Show another artifact of the same
|
|
1682
|
+
* Show another artifact of the same GeoVideo entry, such as the next
|
|
1740
1683
|
* archive chunk, in the attached layer. The last frame stays on screen until
|
|
1741
1684
|
* the new media is ready, instead of a blank map while a new layer loads.
|
|
1742
1685
|
*/
|