@fxi/zartigl 0.11.3 → 0.13.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/dist/engine.d.ts CHANGED
@@ -238,6 +238,8 @@ export declare interface GeoVideoArchiveChunk extends GeoVideoChunkSpan {
238
238
  manifestUrl: string;
239
239
  /** Encoded samples, when the index lists them. */
240
240
  samples?: number;
241
+ /** Time of each encoded sample, UTC milliseconds, when the index lists them. */
242
+ times?: number[];
241
243
  provisional?: boolean;
242
244
  }
243
245
 
@@ -624,6 +626,12 @@ export declare interface GeoVideoIndex {
624
626
  sourceId: string;
625
627
  updatedAt: string | null;
626
628
  chunks: GeoVideoIndexChunk[];
629
+ /** On a surface index: the levels below it with playable chunks, shallow to deep. */
630
+ depths?: GeoVideoIndexDepth[];
631
+ /** On a surface index with depths: the surface level. */
632
+ surface?: GeoVideoVerticalLevel;
633
+ /** On a depth index: its level. */
634
+ vertical?: GeoVideoVerticalLevel;
627
635
  }
628
636
 
629
637
  /** One immutable, calendar-aligned artifact of a GeoVideo archive. */
@@ -636,6 +644,8 @@ export declare interface GeoVideoIndexChunk {
636
644
  start: string;
637
645
  end: string;
638
646
  samples: number;
647
+ /** Every encoded sample; absent from chunks indexed before it existed. */
648
+ times?: string[];
639
649
  key: string;
640
650
  /** Relative to the index URL. */
641
651
  manifestUrl: string;
@@ -648,6 +658,12 @@ export declare interface GeoVideoIndexChunk {
648
658
  */
649
659
  export declare function geoVideoIndexChunks(index: GeoVideoIndex, indexUrl: string): GeoVideoArchiveChunk[];
650
660
 
661
+ /** A level besides the surface, with the index of its own chunks. */
662
+ declare interface GeoVideoIndexDepth extends GeoVideoVerticalLevel {
663
+ /** Relative to the surface index URL. */
664
+ indexUrl: string;
665
+ }
666
+
651
667
  export declare interface GeoVideoManifest {
652
668
  schemaVersion: 3;
653
669
  id: string;
@@ -912,6 +928,15 @@ export declare class GeoVideoVectorSource extends GeoVideoFrameSource<GeoVideoVe
912
928
  protected capture(video: HTMLVideoElement, rows: number, mask: Uint8Array): Promise<GeoVideoVectorFrame | null>;
913
929
  }
914
930
 
931
+ /** A native vertical level: the store coordinate's identity and exact value. */
932
+ declare interface GeoVideoVerticalLevel {
933
+ name: string;
934
+ units: string;
935
+ /** CF `positive`: "up" for elevation, "down" for depth. */
936
+ positive: string;
937
+ value: number;
938
+ }
939
+
915
940
  /**
916
941
  * Palettes to offer, without deprecated ones (still resolvable for old
917
942
  * configs) unless `includeDeprecated`.
package/dist/engine.js CHANGED
@@ -1,5 +1,5 @@
1
- import { K as o, L as s, G as r, M as i, j as d, N as G, O as c, P as t, Q as l, R as V, m as n, S, U as C, V as L, T as u, W as m, X as O, Y as _, Z as p, b as R, _ as A, c as T, $ as x, a0 as g, n as k, B as F, F as I, a1 as h, a2 as v, p as D, x as E, u as f, C as B, E as b, o as N, D as P, a3 as y, a4 as M, a5 as W, a6 as U, q as H, a7 as K, a8 as Y, a9 as j, H as q, aa as J, ab as Q, J as X, v as Z, ac as $ } from "./engine-BBxJ6x3s.js";
2
- import { B as z, a as aa, f as ea, b as oa, e as sa, c as ra, g as ia, i as da, r as Ga, d as ca } from "./backdrop-Dceb4d8E.js";
1
+ import { O as o, P as s, G as r, Q as d, j as i, R as G, S as c, U as t, V as l, W as V, m as n, X as S, Y as C, Z as L, T as u, _ as m, $ as O, a0 as _, a1 as p, b as R, a2 as A, c as T, a3 as g, a4 as k, n as x, C as F, K as I, a5 as f, L as h, p as v, y as E, u as D, E as B, J as b, o as N, F as y, a6 as P, a7 as W, a8 as M, a9 as U, q as H, aa as K, ab as Y, ac as j, H as q, ad as J, ae as Q, N as X, v as Z, af as $ } from "./engine-Bhb-WayM.js";
2
+ import { B as z, a as aa, f as ea, b as oa, e as sa, c as ra, g as da, i as ia, r as Ga, d as ca } from "./backdrop-Dceb4d8E.js";
3
3
  export {
4
4
  z as BACKDROP_OFF,
5
5
  o as COLOR_GRADE_GLSL,
@@ -7,8 +7,8 @@ export {
7
7
  ea as COLOR_GRADE_VIBRANT,
8
8
  s as GEOVIDEO_SCALAR_GLSL,
9
9
  r as GLOW_GAIN,
10
- i as GLOW_GLSL,
11
- d as GLOW_SCALE,
10
+ d as GLOW_GLSL,
11
+ i as GLOW_SCALE,
12
12
  G as GeoVideoArchiveSource,
13
13
  c as GeoVideoClock,
14
14
  t as GeoVideoCodecScalarSource,
@@ -29,25 +29,25 @@ export {
29
29
  R as createColorRampTexture,
30
30
  A as createGeoVideoFrameSource,
31
31
  T as createProgram,
32
- x as createShader,
33
- g as fadeToFrames,
34
- k as fadeToOpacity,
32
+ g as createShader,
33
+ k as fadeToFrames,
34
+ x as fadeToOpacity,
35
35
  F as formatUnit,
36
36
  I as geoVideoChunkSources,
37
- h as geoVideoGrid,
38
- v as geoVideoIndexChunks,
39
- D as geoVideoScalarUniforms,
37
+ f as geoVideoGrid,
38
+ h as geoVideoIndexChunks,
39
+ v as geoVideoScalarUniforms,
40
40
  E as geoVideoTimelineValues,
41
- f as getPalettes,
42
- ia as gradeToColorGrade,
41
+ D as getPalettes,
42
+ da as gradeToColorGrade,
43
43
  B as isGeoVideoArchiveSource,
44
- da as isHexColor,
44
+ ia as isHexColor,
45
45
  b as loadGeoVideoIndex,
46
46
  N as loadGeoVideoManifest,
47
- P as nextChunk,
48
- y as nextChunkSpan,
49
- M as pairChunk,
50
- W as pairChunkSpan,
47
+ y as nextChunk,
48
+ P as nextChunkSpan,
49
+ W as pairChunk,
50
+ M as pairChunkSpan,
51
51
  U as parseTimeRange,
52
52
  Ga as resolveBackdrop,
53
53
  ca as resolveColorGrade,
@@ -191,7 +191,7 @@ function _e(e, a, i = {}) {
191
191
  }
192
192
  return M(s);
193
193
  }
194
- const S = "0.11.3", N = { "maplibre-gl": "^5.17.0" }, le = {
194
+ const S = "0.13.0", N = { "maplibre-gl": "^5.17.0" }, le = {
195
195
  version: S,
196
196
  devDependencies: N
197
197
  }, F = "https://sos-ch-gva-2.exo.io/mapx-zartigl/catalog/v2/catalog.json";
package/dist/zartigl.d.ts CHANGED
@@ -212,6 +212,11 @@ export declare interface DepthMeta {
212
212
  label: "depth" | "pressure" | string;
213
213
  units?: string;
214
214
  current?: number;
215
+ /**
216
+ * The field has depths the source cannot show yet: a GeoVideo archive
217
+ * that publishes none, shown at its surface. A depth control stays fixed.
218
+ */
219
+ locked?: boolean;
215
220
  }
216
221
 
217
222
  export declare function deriveDirectionMagnitudeComponents(directionDegrees: number, magnitude: number, derivation: VectorDerivation): {
@@ -1578,6 +1583,16 @@ export declare class Zartigl {
1578
1583
  private wmtsMetadata;
1579
1584
  private fieldSources;
1580
1585
  private archiveChunks;
1586
+ /** Samples of each archive chunk the index lists them for, by manifest URL. */
1587
+ private chunkTimes;
1588
+ /** Published levels of each archive, by surface index URL. */
1589
+ private archiveRoots;
1590
+ /** Level of the archive chunk shown: null for the surface. */
1591
+ private archiveLevel;
1592
+ /** A field with depths shown at its surface only, until GeoVideo publishes them. */
1593
+ private depthLocked;
1594
+ /** Level of each archive chunk, by manifest URL: null for the surface. */
1595
+ private chunkLevels;
1581
1596
  /** Manifest of the archive chunk expected next, requested ahead of it. */
1582
1597
  private nextChunkManifest;
1583
1598
  private activeFieldSource;
@@ -1609,11 +1624,9 @@ export declare class Zartigl {
1609
1624
  private loadSource;
1610
1625
  private changeSource;
1611
1626
  /**
1612
- * Source switch after init: leave the current GeoVideo when it cannot show
1613
- * the requested time, window, or depth and another source can. A time
1614
- * change alone never switches back, so scrubbing a Zarr timeline does not
1615
- * flip sources; in "auto", selecting the surface depth, alone or with a
1616
- * date GeoVideo covers, returns to GeoVideo.
1627
+ * Source switch after init. An archive moves between its own chunks with
1628
+ * the time, the window, or the depth (its published levels); no time or
1629
+ * depth ever switches to another source.
1617
1630
  */
1618
1631
  private needsSourceSwitch;
1619
1632
  private applyVisible;
@@ -1709,7 +1722,6 @@ export declare class Zartigl {
1709
1722
  * In "auto", a GeoVideo that fails while it renders (media, mask) yields
1710
1723
  * to another source, paused, keeping the date and depth.
1711
1724
  */
1712
- private fallBackFromGeoVideo;
1713
1725
  private applyMutableSettings;
1714
1726
  private getQuerySource;
1715
1727
  private getFieldSource;
@@ -1719,15 +1731,16 @@ export declare class Zartigl {
1719
1731
  */
1720
1732
  private sourceTimeRequest;
1721
1733
  /**
1722
- * Source for a preference and target. In "auto", a GeoVideo that cannot show
1723
- * the requested depth (it renders the surface level) yields to Zarr.
1734
+ * Source for a preference and target. An archive (pinned, or the
1735
+ * GeoVideo of "geovideo" and "auto") shows its chunk for the time; an
1736
+ * archive that cannot load fails a pinned or "geovideo" preference, and
1737
+ * "auto" moves on to Zarr. Regional artifacts show only when pinned. In
1738
+ * "auto", a level deeper than the surface GeoVideo renders shows Zarr.
1724
1739
  */
1725
1740
  private selectSource;
1726
1741
  private isFailedGeoVideo;
1727
1742
  /** The entry without GeoVideo artifacts that failed to load. */
1728
1743
  private withoutFailedGeoVideo;
1729
- /** Whether `depth` resolves to the surface level that GeoVideo renders. */
1730
- private geoVideoServesDepth;
1731
1744
  private isArchiveChunk;
1732
1745
  /**
1733
1746
  * The archive chunk that follows the current one inside the active time
@@ -1748,14 +1761,34 @@ export declare class Zartigl {
1748
1761
  private continueArchivePlayback;
1749
1762
  /** The entry's initialised field Zarr, or null when it has none. */
1750
1763
  private entryFieldZarr;
1751
- /** Zarr time and vertical axes; unavailable metadata leaves the artifact's own timeline. */
1752
- private zarrAxes;
1764
+ /**
1765
+ * Every sample of an archive's chunks, sorted, from its index. Chunks
1766
+ * indexed before the index listed them read their manifest once, a few at
1767
+ * a time; one that cannot be read only leaves its samples out.
1768
+ */
1769
+ private archiveTimes;
1770
+ /**
1771
+ * The archive sample a request shows: the one nearest its time inside its
1772
+ * window (a trailing window counts back from the archive's last sample),
1773
+ * the latest without a time. Snapping once, here, keeps the chunk loaded
1774
+ * and the time shown in agreement.
1775
+ */
1776
+ private archiveSample;
1753
1777
  /**
1754
1778
  * Entry whose archive sources are replaced by one fixed-period source per
1755
- * published chunk. An unreachable index drops the archive, so selection
1779
+ * published chunk at `level` (null: the surface). An unreachable index, or
1780
+ * a level the archive does not publish, drops the archive, so selection
1756
1781
  * falls back to the entry's other sources.
1757
1782
  */
1758
1783
  private resolveArchives;
1784
+ /** The published levels of an archive, read from its surface index. */
1785
+ private archiveLevels;
1786
+ /**
1787
+ * Chunks of one index of an archive: its surface index (`level` null),
1788
+ * which also lists the levels below, or a depth's, which must record that
1789
+ * level. Revalidated like any archive index.
1790
+ */
1791
+ private archiveChunksAt;
1759
1792
  private resolveSource;
1760
1793
  private querySource;
1761
1794
  private isMapReady;
@@ -1822,6 +1855,11 @@ declare type ZartiglEventMap = {
1822
1855
  }) => void;
1823
1856
  /** The render layer was added to the map, e.g. for the host to order it. */
1824
1857
  layerAttach: (id: string) => void;
1858
+ /**
1859
+ * The time or vertical axis changed without a source change, e.g. on
1860
+ * another depth of a GeoVideo archive: read getTimeMeta and getDepthMeta.
1861
+ */
1862
+ axesChange: () => void;
1825
1863
  };
1826
1864
 
1827
1865
  export declare class ZartiglFrameUnavailableError extends Error {