@fxi/zartigl 0.9.2 → 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/README.md +28 -1
- package/dist/catalog.d.ts +25 -5
- package/dist/catalog.js +203 -174
- package/dist/engine.d.ts +78 -8
- package/dist/engine.js +48 -38
- package/dist/{geovideo-index-CzQo6UIG.js → geovideo-index-BJjE_fgO.js} +378 -250
- package/dist/zartigl.d.ts +60 -7
- package/dist/zartigl.js +668 -663
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -103,6 +103,7 @@ the MapX `ArcoMapLegend` and the snippets the demo exports.
|
|
|
103
103
|
```jsonc
|
|
104
104
|
{
|
|
105
105
|
"palette": "thermal",
|
|
106
|
+
"reversePalette": false,
|
|
106
107
|
"renderMode": "particles", // or "raster", "raster+particles"
|
|
107
108
|
"particles": {
|
|
108
109
|
"density": 0.03,
|
|
@@ -111,10 +112,36 @@ the MapX `ArcoMapLegend` and the snippets the demo exports.
|
|
|
111
112
|
"grade": "vibrant",
|
|
112
113
|
"backdrop": { "enabled": true, "color": "#000000", "opacity": 0.3 }
|
|
113
114
|
},
|
|
114
|
-
"raster": {
|
|
115
|
+
"raster": {
|
|
116
|
+
"opacity": 0.9, "logScale": false, "vibrance": 0.2, "colorDomain": null,
|
|
117
|
+
"alphaFadeLow": 0, "alphaFadeHigh": 0, "alphaFadeCurve": "linear"
|
|
118
|
+
}
|
|
115
119
|
}
|
|
116
120
|
```
|
|
117
121
|
|
|
122
|
+
`reversePalette` runs the palette from its last color to its first, for the
|
|
123
|
+
raster and the particles.
|
|
124
|
+
|
|
125
|
+
`raster.alphaFadeLow` and `alphaFadeHigh` make the ends of the color range
|
|
126
|
+
transparent, with any palette. Each is a fraction of the range as displayed
|
|
127
|
+
(the color domain, after log scale): `alphaFadeLow: 0.25` fades the lowest
|
|
128
|
+
quarter in from transparent, `alphaFadeHigh: 0.5` fades the upper half out,
|
|
129
|
+
and values beyond the domain take its transparent ends. A field that is
|
|
130
|
+
mostly zero, such as fire radiative power or coral heat stress, then shows
|
|
131
|
+
only where something happens. `alphaFadeCurve` shapes both fades, with the
|
|
132
|
+
curves of `logScale`: `"linear"`, `"log"` (`log10(1 + 9x)`, rises fast) or
|
|
133
|
+
`"exp"` (its inverse, stays faint longer, which also hides codec noise at the
|
|
134
|
+
ends of a GeoVideo). The fade is part of the color ramp
|
|
135
|
+
(`resolveColorRamp(palette, { reverse, alphaFade })`), so Zarr, GeoVideo,
|
|
136
|
+
projversor and legends show the same transparency. Neither key changes how
|
|
137
|
+
GeoVideo archives are encoded, so restyling never re-renders them.
|
|
138
|
+
|
|
139
|
+
`heat-alert`, which faded low values in through transparent palette stops, is
|
|
140
|
+
deprecated: `migrateLegacyStyle` reads it as `heat` with `alphaFadeLow: 0.25`
|
|
141
|
+
(the closest fit of its alpha), wherever a style enters, so old catalogs,
|
|
142
|
+
share links and story views keep working. `getPalettes()` leaves deprecated
|
|
143
|
+
palettes out of pickers.
|
|
144
|
+
|
|
118
145
|
`particles.grade` is `"off"`, `"vibrant"`, or a tuned vibrant grade
|
|
119
146
|
`{ exposure, contrast, saturation, highlights }`; it is replaced as a whole.
|
|
120
147
|
|
package/dist/catalog.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** Shape of an alpha fade inside its zone; the same curves as `logScale`. */
|
|
2
|
+
export declare type AlphaFadeCurve = "linear" | "log" | "exp";
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Solid color under the particle trails, drawn on valid data cells only: it
|
|
3
6
|
* keeps particles readable over a light basemap. Off by default; an object
|
|
@@ -155,6 +158,8 @@ export declare const LAYER_STYLE_DEFAULTS: Readonly<LayerStyle>;
|
|
|
155
158
|
export declare interface LayerStyle {
|
|
156
159
|
/** Palette id; undefined lets the engine pick its own. */
|
|
157
160
|
palette?: string;
|
|
161
|
+
/** Run the palette from its last color to its first, for raster and particles. */
|
|
162
|
+
reversePalette: boolean;
|
|
158
163
|
renderMode: StyleRenderMode;
|
|
159
164
|
particles: ParticleStyle;
|
|
160
165
|
raster: RasterStyle;
|
|
@@ -163,6 +168,7 @@ export declare interface LayerStyle {
|
|
|
163
168
|
/** A partial style: any key left out takes the value below it. */
|
|
164
169
|
export declare interface LayerStyleInput {
|
|
165
170
|
palette?: string;
|
|
171
|
+
reversePalette?: boolean;
|
|
166
172
|
renderMode?: StyleRenderMode;
|
|
167
173
|
particles?: ParticleStyleInput;
|
|
168
174
|
raster?: Partial<RasterStyle>;
|
|
@@ -176,6 +182,14 @@ export declare type LocalizedText = Record<string, string>;
|
|
|
176
182
|
*/
|
|
177
183
|
export declare function mergeStyles(...inputs: (LayerStyleInput | undefined)[]): LayerStyleInput;
|
|
178
184
|
|
|
185
|
+
/**
|
|
186
|
+
* `input` with legacy palettes rewritten, so old catalogs, share links and
|
|
187
|
+
* story views keep their look. Keys the input sets itself win.
|
|
188
|
+
*/
|
|
189
|
+
export declare function migrateLegacyStyle(input: LayerStyleInput): LayerStyleInput;
|
|
190
|
+
|
|
191
|
+
export declare function migrateLegacyStyle(input: LayerStyleInput | undefined): LayerStyleInput | undefined;
|
|
192
|
+
|
|
179
193
|
/**
|
|
180
194
|
* Validate a style, throwing an error that names the offending path, e.g.
|
|
181
195
|
* `views.swell.config.style.particles.density must be a number in (0, 0.2]`.
|
|
@@ -241,6 +255,17 @@ export declare interface RasterStyle {
|
|
|
241
255
|
vibrance: number;
|
|
242
256
|
/** Fixed physical-value domain; null follows the data. */
|
|
243
257
|
colorDomain: [number, number] | null;
|
|
258
|
+
/**
|
|
259
|
+
* Fraction of the color range, from its low end, over which colors fade in
|
|
260
|
+
* from transparent, [0, 1]: a field that is mostly zero (fires, heat
|
|
261
|
+
* stress) shows only where something happens. Values below the domain are
|
|
262
|
+
* transparent too.
|
|
263
|
+
*/
|
|
264
|
+
alphaFadeLow: number;
|
|
265
|
+
/** Fraction of the color range, from its high end, fading out, [0, 1]. */
|
|
266
|
+
alphaFadeHigh: number;
|
|
267
|
+
/** Shape of both fades: "log" rises fast, "exp" stays faint longer. */
|
|
268
|
+
alphaFadeCurve: AlphaFadeCurve;
|
|
244
269
|
}
|
|
245
270
|
|
|
246
271
|
export declare function requireCatalogEntry(id: string, data?: Catalog): CatalogEntry;
|
|
@@ -284,11 +309,6 @@ export declare interface StyledEntry {
|
|
|
284
309
|
/** `style` without the keys a layer of `kind` cannot draw. */
|
|
285
310
|
export declare function styleForKind(style: LayerStyleInput, kind: StyledEntry["kind"] | undefined): LayerStyleInput;
|
|
286
311
|
|
|
287
|
-
/**
|
|
288
|
-
* Layer style: how a layer looks, with the same keys in the catalog
|
|
289
|
-
* `defaults`, the engines and story views. Playback (how time moves) is not
|
|
290
|
-
* part of it, so `particles.speed` is always the particle speed.
|
|
291
|
-
*/
|
|
292
312
|
export declare type StyleRenderMode = "particles" | "raster" | "raster+particles";
|
|
293
313
|
|
|
294
314
|
export { }
|