@fxi/zartigl 0.9.3 → 0.10.1

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/zartigl.d.ts CHANGED
@@ -2,6 +2,19 @@ import { CustomLayerInterface } from 'maplibre-gl';
2
2
  import { CustomRenderMethodInput } from 'maplibre-gl';
3
3
  import { Map as Map_2 } from 'maplibre-gl';
4
4
 
5
+ /**
6
+ * Transparent ends of a ramp, as fractions of the ramp from each end: `low`
7
+ * fades the lowest values in from transparent, `high` fades the highest out.
8
+ */
9
+ export declare interface AlphaFade {
10
+ low?: number;
11
+ high?: number;
12
+ curve?: AlphaFadeCurve;
13
+ }
14
+
15
+ /** Shape of an alpha fade inside its zone; the same curves as `logScale`. */
16
+ export declare type AlphaFadeCurve = "linear" | "log" | "exp";
17
+
5
18
  /** Particle backdrop off: see BackdropStyle. */
6
19
  export declare const BACKDROP_OFF: Readonly<BackdropStyle>;
7
20
 
@@ -532,7 +545,7 @@ declare interface GeoVideoScalarEncoding {
532
545
  codeMax: number;
533
546
  valueMin: number;
534
547
  valueMax: number;
535
- transfer: "linear";
548
+ transfer: "linear" | "log10-1p9";
536
549
  colorSpace: "bt709";
537
550
  colorRange: "limited" | "full";
538
551
  }
@@ -566,7 +579,13 @@ declare interface GeoVideoVectorEncoding {
566
579
  colorRange: "limited" | "full";
567
580
  }
568
581
 
569
- export declare function getPalettes(): PaletteMeta[];
582
+ /**
583
+ * Palettes to offer, without deprecated ones (still resolvable for old
584
+ * configs) unless `includeDeprecated`.
585
+ */
586
+ export declare function getPalettes(options?: {
587
+ includeDeprecated?: boolean;
588
+ }): PaletteMeta[];
570
589
 
571
590
  export declare function getVectorDerivationVariables(derivation: VectorDerivation): [string, string];
572
591
 
@@ -611,6 +630,8 @@ declare type LayerEventMap_2 = {
611
630
  declare interface LayerStyle {
612
631
  /** Palette id; undefined lets the engine pick its own. */
613
632
  palette?: string;
633
+ /** Run the palette from its last color to its first, for raster and particles. */
634
+ reversePalette: boolean;
614
635
  renderMode: StyleRenderMode;
615
636
  particles: ParticleStyle;
616
637
  raster: RasterStyle;
@@ -619,6 +640,7 @@ declare interface LayerStyle {
619
640
  /** A partial style: any key left out takes the value below it. */
620
641
  declare interface LayerStyleInput {
621
642
  palette?: string;
643
+ reversePalette?: boolean;
622
644
  renderMode?: StyleRenderMode;
623
645
  particles?: ParticleStyleInput;
624
646
  raster?: Partial<RasterStyle>;
@@ -630,6 +652,10 @@ export declare const LEGACY_STYLE_SETTINGS: Readonly<Partial<Record<keyof Zartig
630
652
  export declare type Legend = {
631
653
  type: "gradient";
632
654
  palette: string;
655
+ /** The palette runs from its last color to its first. */
656
+ reverse?: boolean;
657
+ /** Transparent ends of the ramp, already in the legend colors. */
658
+ alphaFade?: AlphaFade;
633
659
  min?: number;
634
660
  max?: number;
635
661
  unit?: string;
@@ -663,6 +689,12 @@ export declare interface MapxWidgetSnippetOptions {
663
689
  style?: LayerStyleInput;
664
690
  /** Engine tuning; flat style keys are ignored. */
665
691
  settings?: Partial<ZartiglSettings>;
692
+ /**
693
+ * The layer definition, written inline (MapX widget only): for a layer
694
+ * MapX may not know, such as a custom or unpublished entry. Left out, the
695
+ * widget names the layer and MapX reads it from the live catalog.
696
+ */
697
+ entry?: CatalogEntry;
666
698
  }
667
699
 
668
700
  export declare interface PaletteMeta {
@@ -872,6 +904,17 @@ declare interface RasterStyle {
872
904
  vibrance: number;
873
905
  /** Fixed physical-value domain; null follows the data. */
874
906
  colorDomain: [number, number] | null;
907
+ /**
908
+ * Fraction of the color range, from its low end, over which colors fade in
909
+ * from transparent, [0, 1]: a field that is mostly zero (fires, heat
910
+ * stress) shows only where something happens. Values below the domain are
911
+ * transparent too.
912
+ */
913
+ alphaFadeLow: number;
914
+ /** Fraction of the color range, from its high end, fading out, [0, 1]. */
915
+ alphaFadeHigh: number;
916
+ /** Shape of both fades: "log" rises fast, "exp" stays faint longer. */
917
+ alphaFadeCurve: AlphaFadeCurve;
875
918
  }
876
919
 
877
920
  export declare type RenderMode = "raster" | "particles" | "raster+particles";
@@ -890,6 +933,16 @@ export declare function resolveBackdrop(input?: Partial<BackdropStyle>): Backdro
890
933
  */
891
934
  export declare function resolveColorGrade(input?: Partial<ColorGrade>): ColorGrade;
892
935
 
936
+ /**
937
+ * Stops of a ramp, reversed on request, then with `alphaFade` multiplied into
938
+ * the alpha of its ends. The fade follows positions, not colors: on a reversed
939
+ * ramp it still fades the low values.
940
+ */
941
+ export declare function resolveColorRamp(input: ColorRampInput, options?: {
942
+ reverse?: boolean;
943
+ alphaFade?: AlphaFade;
944
+ }): Record<number, string>;
945
+
893
946
  /** Resolve a native date/time control value against actual available times. */
894
947
  export declare function resolveTimeInputSelection(values: readonly number[], value: string, granularity: TimeGranularity): number | undefined;
895
948
 
@@ -1080,11 +1133,6 @@ export declare function stitchVelocityChunks(uChunks: Array<{
1080
1133
  north: number;
1081
1134
  }, latDescending?: boolean, scalarMode?: boolean): VelocityData;
1082
1135
 
1083
- /**
1084
- * Layer style: how a layer looks, with the same keys in the catalog
1085
- * `defaults`, the engines and story views. Playback (how time moves) is not
1086
- * part of it, so `particles.speed` is always the particle speed.
1087
- */
1088
1136
  declare type StyleRenderMode = "particles" | "raster" | "raster+particles";
1089
1137
 
1090
1138
  export declare type TimeGranularity = "year" | "month" | "day" | "hour" | "minute" | "second";
@@ -1844,6 +1892,8 @@ export declare interface ZartiglOptions {
1844
1892
 
1845
1893
  export declare interface ZartiglSettings {
1846
1894
  palette: ColorRampInput;
1895
+ /** Run the palette from its last color to its first. */
1896
+ reversePalette: boolean;
1847
1897
  particleDensity: number;
1848
1898
  speed: number;
1849
1899
  fade: number;
@@ -1860,6 +1910,10 @@ export declare interface ZartiglSettings {
1860
1910
  backdrop: Partial<BackdropStyle>;
1861
1911
  /** Fixed physical-value domain for scalar colors. Null uses frame extrema. */
1862
1912
  colorDomain: [number, number] | null;
1913
+ /** Transparent ends of the color range, as in RasterStyle. */
1914
+ alphaFadeLow: number;
1915
+ alphaFadeHigh: number;
1916
+ alphaFadeCurve: AlphaFadeCurve;
1863
1917
  particleState: ParticleStateMode;
1864
1918
  rgba8MaxParticleZoom: number;
1865
1919
  }