@fxi/zartigl 0.9.3 → 0.10.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/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;
@@ -872,6 +898,17 @@ declare interface RasterStyle {
872
898
  vibrance: number;
873
899
  /** Fixed physical-value domain; null follows the data. */
874
900
  colorDomain: [number, number] | null;
901
+ /**
902
+ * Fraction of the color range, from its low end, over which colors fade in
903
+ * from transparent, [0, 1]: a field that is mostly zero (fires, heat
904
+ * stress) shows only where something happens. Values below the domain are
905
+ * transparent too.
906
+ */
907
+ alphaFadeLow: number;
908
+ /** Fraction of the color range, from its high end, fading out, [0, 1]. */
909
+ alphaFadeHigh: number;
910
+ /** Shape of both fades: "log" rises fast, "exp" stays faint longer. */
911
+ alphaFadeCurve: AlphaFadeCurve;
875
912
  }
876
913
 
877
914
  export declare type RenderMode = "raster" | "particles" | "raster+particles";
@@ -890,6 +927,16 @@ export declare function resolveBackdrop(input?: Partial<BackdropStyle>): Backdro
890
927
  */
891
928
  export declare function resolveColorGrade(input?: Partial<ColorGrade>): ColorGrade;
892
929
 
930
+ /**
931
+ * Stops of a ramp, reversed on request, then with `alphaFade` multiplied into
932
+ * the alpha of its ends. The fade follows positions, not colors: on a reversed
933
+ * ramp it still fades the low values.
934
+ */
935
+ export declare function resolveColorRamp(input: ColorRampInput, options?: {
936
+ reverse?: boolean;
937
+ alphaFade?: AlphaFade;
938
+ }): Record<number, string>;
939
+
893
940
  /** Resolve a native date/time control value against actual available times. */
894
941
  export declare function resolveTimeInputSelection(values: readonly number[], value: string, granularity: TimeGranularity): number | undefined;
895
942
 
@@ -1080,11 +1127,6 @@ export declare function stitchVelocityChunks(uChunks: Array<{
1080
1127
  north: number;
1081
1128
  }, latDescending?: boolean, scalarMode?: boolean): VelocityData;
1082
1129
 
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
1130
  declare type StyleRenderMode = "particles" | "raster" | "raster+particles";
1089
1131
 
1090
1132
  export declare type TimeGranularity = "year" | "month" | "day" | "hour" | "minute" | "second";
@@ -1844,6 +1886,8 @@ export declare interface ZartiglOptions {
1844
1886
 
1845
1887
  export declare interface ZartiglSettings {
1846
1888
  palette: ColorRampInput;
1889
+ /** Run the palette from its last color to its first. */
1890
+ reversePalette: boolean;
1847
1891
  particleDensity: number;
1848
1892
  speed: number;
1849
1893
  fade: number;
@@ -1860,6 +1904,10 @@ export declare interface ZartiglSettings {
1860
1904
  backdrop: Partial<BackdropStyle>;
1861
1905
  /** Fixed physical-value domain for scalar colors. Null uses frame extrema. */
1862
1906
  colorDomain: [number, number] | null;
1907
+ /** Transparent ends of the color range, as in RasterStyle. */
1908
+ alphaFadeLow: number;
1909
+ alphaFadeHigh: number;
1910
+ alphaFadeCurve: AlphaFadeCurve;
1863
1911
  particleState: ParticleStateMode;
1864
1912
  rgba8MaxParticleZoom: number;
1865
1913
  }