@nika-js/onlymap 0.8.4 → 0.9.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/CHANGELOG.md +32 -0
- package/README.md +56 -3
- package/dist/{LercDecode.es-BKustV-1.js → LercDecode.es-IEPCRZOv.js} +1 -1
- package/dist/{basemap-B0SwrOqQ.js → basemap-DL0mk9Bf.js} +780 -780
- package/dist/dem-decode.d.ts +58 -0
- package/dist/elements/om-map.d.ts +12 -0
- package/dist/{geoparquet-C5E6N6G0.js → geoparquet-DJxZA0if.js} +1 -1
- package/dist/hillshade-DR3TxO1a.js +186 -0
- package/dist/hillshade-apron-Bem3DWyJ.js +40 -0
- package/dist/hillshade-apron.d.ts +54 -0
- package/dist/hillshade-shader-n_zManfZ.js +160 -0
- package/dist/hillshade-shader.d.ts +152 -0
- package/dist/hillshade.d.ts +133 -0
- package/dist/html-data.d.ts +2 -2
- package/dist/{index-BLIjrGOE.js → index-BjcPjICh.js} +28 -28
- package/dist/{index-xUVMTGZG.js → index-CvuDsvnk.js} +23 -23
- package/dist/index-DO_w0tqR.js +514 -0
- package/dist/{index-BnQDfKfE.js → index-DdTZSuAb.js} +1 -1
- package/dist/{index-D5Fqn_eZ.js → index-oY3XHIux.js} +13145 -12484
- package/dist/{index-CaM1C93G.js → index-vLXZuog4.js} +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/lerc-Bph62dCb.js +22 -0
- package/dist/onlymap.standalone.js +28919 -27259
- package/dist/onlymapjs.js +95 -92
- package/dist/post-process/catalogue.d.ts +61 -0
- package/dist/post-process/compile.d.ts +37 -0
- package/dist/post-process/index.d.ts +71 -0
- package/dist/post-process/ops.d.ts +22 -0
- package/dist/post-process/presets.d.ts +33 -0
- package/dist/post-process/validate.d.ts +8 -0
- package/dist/programmatic.d.ts +11 -0
- package/dist/{raster-B_wekCHv.js → raster-D-eTzCE3.js} +609 -499
- package/dist/raster-hillshade.d.ts +119 -0
- package/dist/{raster-pipeline-Dn2fkLYx.js → raster-pipeline-BlOnMPJe.js} +510 -484
- package/dist/raster-pipeline.d.ts +10 -0
- package/dist/raster.d.ts +5 -0
- package/dist/runtime-core.d.ts +39 -1
- package/dist/terrain-heightfield.d.ts +0 -16
- package/dist/terrain-sample.d.ts +0 -13
- package/dist/version.d.ts +1 -1
- package/dist/volumetrics.d.ts +7 -0
- package/dist/{zarr-Dan2ab-l.js → zarr-BGDoEtFb.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/docs/design/hillshade.md +290 -0
- package/docs/effects.md +208 -0
- package/docs/hillshade.md +203 -0
- package/llms.txt +3 -1
- package/onlymapjs.attributes.json +27 -2
- package/onlymapjs.html-data.json +207 -6
- package/package.json +13 -9
- package/skills/onlymapjs/SKILL.md +4 -2
- package/skills/onlymapjs/references/syntax.md +17 -2
- package/dist/lerc-TxsFLMlC.js +0 -30
package/dist/onlymapjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aV as e, aW as r, aX as t, B as o, aY as b, aZ as i, C as c, a_ as n, a$ as l, b0 as S, b1 as E, e as g, b2 as L, b3 as T, b4 as d, b5 as _, b6 as A, b7 as p, b8 as m, b9 as I, ba as u, bb as D, bc as M, bd as y, be as f, bf as O, bg as P, aJ as R, bh as N, T as F, bi as h, bj as B, bk as C, W as v, bl as x, bm as G, bn as W, bo as w, bp as U, bq as Y, br as X, bs as k, bt as H, bu as J, bv as K, bw as V, bx as j, by as z, bz as q, bA as Z, bB as $, bC as Q, j as aa, bD as sa, bE as ea, bF as ra, bG as ta, bH as oa, bI as ba, bJ as ia, bK as ca, bL as na, bM as la, bN as Sa, bO as Ea, g as ga, bP as La, bQ as Ta, b as da, bR as _a, bS as Aa, bT as pa, bU as ma, bV as Ia, bW as ua, bX as Da, bY as Ma, bZ as ya, b_ as fa, b$ as Oa, c0 as Pa, c1 as Ra, c2 as Na, c3 as Fa, c4 as ha, c5 as Ba, c6 as Ca, c7 as va, c8 as xa, c9 as Ga, ca as Wa, cb as wa, cc as Ua, cd as Ya, ce as Xa, cf as ka, cg as Ha, ch as Ja, ci as Ka, cj as Va, ck as ja, cl as za, cm as qa, cn as Za, co as $a, cp as Qa, cq as as, cr as ss, cs as es, ct as rs, cu as ts, cv as os, cw as bs } from "./index-oY3XHIux.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ALL_POSITION_VALUES,
|
|
4
4
|
r as AUDIT_EXEMPTIONS,
|
|
@@ -6,108 +6,111 @@ export {
|
|
|
6
6
|
o as BitmapLayer,
|
|
7
7
|
b as COORDINATE_SYSTEM,
|
|
8
8
|
i as CompileError,
|
|
9
|
-
|
|
9
|
+
c as CompositeLayer,
|
|
10
10
|
n as DEFAULT_AUDIT_WIDTHS,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
L as
|
|
16
|
-
T as
|
|
17
|
-
d as
|
|
18
|
-
_ as
|
|
19
|
-
A as
|
|
20
|
-
p as
|
|
11
|
+
l as DEFAULT_FOLD_BREAKPOINT_PX,
|
|
12
|
+
S as DRONE_SENSOR_DATABASE,
|
|
13
|
+
E as EDGE_TOLERANCE_PX,
|
|
14
|
+
g as EFFECT_PRESET_NAMES,
|
|
15
|
+
L as FOLD_BOTTOM_CLEARANCE_PX,
|
|
16
|
+
T as FOLD_HYSTERESIS_PX,
|
|
17
|
+
d as FOLD_SIDES,
|
|
18
|
+
_ as FOLD_SINGLE_SIDED_RATIO,
|
|
19
|
+
A as GeoJsonLayer,
|
|
20
|
+
p as IconLayer,
|
|
21
|
+
m as LEGACY_POSITION_ALIASES,
|
|
21
22
|
I as LIGHTING_PRESET_NAMES,
|
|
22
|
-
|
|
23
|
+
u as Layer,
|
|
23
24
|
D as LayerExtension,
|
|
24
25
|
M as MANAGED_SLOTS,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
y as MapController,
|
|
27
|
+
f as OmMap,
|
|
27
28
|
O as ScatterplotLayer,
|
|
28
|
-
|
|
29
|
+
P as ScenegraphLayer,
|
|
29
30
|
R as SimpleMeshLayer,
|
|
30
31
|
N as Tile3DLayer,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
F as TileLayer,
|
|
33
|
+
h as UNIT_SYSTEMS,
|
|
34
|
+
B as WGS84_MEAN_RADIUS_M,
|
|
35
|
+
C as WIDGET_STYLE_KEY_NAMES,
|
|
36
|
+
v as WebMercatorViewport,
|
|
37
|
+
x as arrowTableToColumnar,
|
|
38
|
+
G as asRows,
|
|
39
|
+
W as auditLayout,
|
|
40
|
+
w as badgeMode,
|
|
41
|
+
U as bottomEndLiftPx,
|
|
42
|
+
Y as compileExpression,
|
|
43
|
+
X as compileFullJsAccessorBlockInSandbox,
|
|
44
|
+
k as computeTimeline,
|
|
44
45
|
H as configureBasemap,
|
|
45
|
-
|
|
46
|
+
J as configureData,
|
|
46
47
|
K as configureIfc,
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
V as configureLicense,
|
|
49
|
+
j as configureTelemetry,
|
|
49
50
|
z as descriptorToIR,
|
|
50
|
-
|
|
51
|
+
q as destroySandbox,
|
|
51
52
|
Z as distanceMeters,
|
|
52
53
|
$ as effectiveFoldBreakpointPx,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
Q as evaluateInSandbox,
|
|
55
|
+
aa as expandPreset,
|
|
56
|
+
sa as foldDrawerStyle,
|
|
57
|
+
ea as foldPanelStyle,
|
|
58
|
+
ra as foldSideForSlot,
|
|
59
|
+
ta as foldToggleSlot,
|
|
60
|
+
oa as foldToggleStyle,
|
|
61
|
+
ba as formatArea,
|
|
62
|
+
ia as formatLength,
|
|
63
|
+
ca as getBasemap,
|
|
64
|
+
na as getEntitlements,
|
|
63
65
|
la as getLayerSchema,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Ua as
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
66
|
+
Sa as getMeasureRadiusMeters,
|
|
67
|
+
Ea as getRoutingProvider,
|
|
68
|
+
ga as getTerrain,
|
|
69
|
+
La as isBrowser,
|
|
70
|
+
Ta as isColumnar,
|
|
71
|
+
da as isEffectPreset,
|
|
72
|
+
_a as isStoreToken,
|
|
73
|
+
Aa as lineStringLengthMeters,
|
|
74
|
+
pa as loadIfc,
|
|
75
|
+
ma as loadRasterModule,
|
|
76
|
+
Ia as midpoint,
|
|
77
|
+
ua as mountForTest,
|
|
78
|
+
Da as niceNumber,
|
|
79
|
+
Ma as normalizeData,
|
|
80
|
+
ya as parseDurationMs,
|
|
81
|
+
fa as parseTerrainAttrs,
|
|
82
|
+
Oa as parseUnitSystem,
|
|
83
|
+
Pa as parseWidgetStyle,
|
|
84
|
+
Ra as pathLengthMeters,
|
|
85
|
+
Na as registerAction,
|
|
86
|
+
Fa as registerBasemap,
|
|
87
|
+
ha as registerFormat,
|
|
88
|
+
Ba as registerLayer,
|
|
89
|
+
Ca as registerRoutingProvider,
|
|
90
|
+
va as registerSource,
|
|
91
|
+
xa as registerTerrain,
|
|
92
|
+
Ga as registerWidget,
|
|
93
|
+
Wa as releaseDataOwner,
|
|
94
|
+
wa as resolveFoldBreakpointPx,
|
|
95
|
+
Ua as resolveImageOverlay,
|
|
96
|
+
Ya as resolveLighting,
|
|
97
|
+
Xa as resolveSlot,
|
|
98
|
+
ka as ringAreaMeters2,
|
|
99
|
+
Ha as ringEnclosesPole,
|
|
100
|
+
Ja as ringPerimeterMeters,
|
|
101
|
+
Ka as rowAt,
|
|
102
|
+
Va as sandboxHtml,
|
|
103
|
+
ja as scaleBarStep,
|
|
104
|
+
za as setKeepBadge,
|
|
105
|
+
qa as setMeasureRadiusMeters,
|
|
106
|
+
Za as settleLayout,
|
|
107
|
+
$a as shouldFoldAtWidth,
|
|
108
|
+
Qa as slotContainerStyle,
|
|
109
|
+
as as slotLayout,
|
|
110
|
+
ss as snapshotDescriptorIR,
|
|
111
|
+
es as snapshotIR,
|
|
112
|
+
rs as solarAzElDegrees,
|
|
113
|
+
ts as subscribeLicense,
|
|
114
|
+
os as validateManifest,
|
|
115
|
+
bs as validateManifestString
|
|
113
116
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The op catalogue's METADATA — names, kinds, knobs.
|
|
3
|
+
*
|
|
4
|
+
* Split from the GLSL deliberately. `OmMap.validate` is synchronous and lives
|
|
5
|
+
* in the core bundle, so the rules it runs cannot come from a lazy chunk; the
|
|
6
|
+
* shader source can, and does (`ops.ts`). Keeping the descriptions here means
|
|
7
|
+
* a map with no `<om-effect>` never downloads a line of GLSL, while the
|
|
8
|
+
* validator, the schema and the inspector still know every knob.
|
|
9
|
+
*
|
|
10
|
+
* An op is one named image operation with named knobs — `grain`, `edges`,
|
|
11
|
+
* `tint`. Authors compose them in document order and tune them by attribute;
|
|
12
|
+
* a preset is nothing more than a saved list of them (see `presets.ts`), which
|
|
13
|
+
* is the test of whether this tier is honest.
|
|
14
|
+
*
|
|
15
|
+
* Two kinds, and the difference is not cosmetic — it decides how the pipeline
|
|
16
|
+
* compiles:
|
|
17
|
+
*
|
|
18
|
+
* - POINTWISE ops read only the pixel they are writing, so any run of them
|
|
19
|
+
* fuses into a single fragment function and therefore a single pass.
|
|
20
|
+
* - NEIGHBOURHOOD ops sample texels around the pixel, so each one needs the
|
|
21
|
+
* previous stage finished and resident in a texture — one pass each.
|
|
22
|
+
*
|
|
23
|
+
* Spatial knobs are in MILLIMETRES, converted against `pxPerMm` inside the
|
|
24
|
+
* shader rather than baked in at build time. That is what makes a look
|
|
25
|
+
* resolution-independent: the same document printed at 600 dpi keeps the same
|
|
26
|
+
* physical grain and ink width it had on screen, where a pixel-valued knob
|
|
27
|
+
* would render four times finer and quietly lose the look.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Pixels per millimetre at 96 CSS dpi, before any device or capture scaling.
|
|
31
|
+
*
|
|
32
|
+
* Lives here rather than beside the compiler so the runtime can read it
|
|
33
|
+
* WITHOUT pulling in the GLSL: one value import from the lazy chunk is all it
|
|
34
|
+
* takes to make the chunk eager, which is exactly what the browser test that
|
|
35
|
+
* guards this caught.
|
|
36
|
+
*/
|
|
37
|
+
export declare const CSS_PX_PER_MM: number;
|
|
38
|
+
/** How a run of ops compiles. See the file header. */
|
|
39
|
+
export type OpKind = "pointwise" | "neighbourhood";
|
|
40
|
+
/**
|
|
41
|
+
* What a knob means, which decides how its attribute is parsed and how it
|
|
42
|
+
* reaches the shader: `length` accepts `0.12mm` and stays in mm, `color`
|
|
43
|
+
* becomes a vec4, everything else is a plain number.
|
|
44
|
+
*/
|
|
45
|
+
export type ParamKind = "amount" | "length" | "color" | "angle" | "count";
|
|
46
|
+
export interface OpParamDef {
|
|
47
|
+
name: string;
|
|
48
|
+
kind: ParamKind;
|
|
49
|
+
/** Millimetres for `length`, a CSS colour for `color`, else a number. */
|
|
50
|
+
default: number | string;
|
|
51
|
+
description: string;
|
|
52
|
+
}
|
|
53
|
+
export interface OpMeta {
|
|
54
|
+
name: string;
|
|
55
|
+
kind: OpKind;
|
|
56
|
+
description: string;
|
|
57
|
+
params: OpParamDef[];
|
|
58
|
+
}
|
|
59
|
+
export declare const OP_META: OpMeta[];
|
|
60
|
+
export declare const OP_NAMES: readonly string[];
|
|
61
|
+
export declare function opMeta(name: string): OpMeta | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile a run of ops into ONE luma shader module.
|
|
3
|
+
*
|
|
4
|
+
* This is what makes the op tier a generator rather than a stack of effects.
|
|
5
|
+
* Ten colour knobs are not ten fullscreen passes: every consecutive run of
|
|
6
|
+
* POINTWISE ops fuses into a single fragment function, and only a
|
|
7
|
+
* NEIGHBOURHOOD op — one that samples texels around the pixel, and so needs
|
|
8
|
+
* the previous stage finished and resident in a texture — starts a new pass.
|
|
9
|
+
* deck's `PostProcessEffect` already supports a multi-pass module where each
|
|
10
|
+
* pass names its own function, so the whole pipeline is one effect object.
|
|
11
|
+
*
|
|
12
|
+
* Uniform layout is the one place to be careful. luma's contract is explicit:
|
|
13
|
+
* "Both order and types MUST match uniform block declarations in shader". So
|
|
14
|
+
* the block text and `uniformTypes` are emitted from the same ordered arrays,
|
|
15
|
+
* never written twice — and std140 padding is sidestepped by grouping all
|
|
16
|
+
* vec4s ahead of all floats rather than interleaving them.
|
|
17
|
+
*
|
|
18
|
+
* Knobs stay uniforms rather than being baked into the source, because a
|
|
19
|
+
* story can animate one per frame and recompiling a shader per frame is not a
|
|
20
|
+
* thing to ship.
|
|
21
|
+
*/
|
|
22
|
+
import type { ShaderPass } from "@luma.gl/shadertools";
|
|
23
|
+
import { type OpDef } from "./ops";
|
|
24
|
+
import { CSS_PX_PER_MM } from "./catalogue";
|
|
25
|
+
export { CSS_PX_PER_MM };
|
|
26
|
+
export interface ResolvedOp {
|
|
27
|
+
def: OpDef;
|
|
28
|
+
/** Knob name → value: a number, or `[r, g, b, a]` in 0..1 for a colour. */
|
|
29
|
+
values: Record<string, number | number[]>;
|
|
30
|
+
}
|
|
31
|
+
export interface CompiledEffect {
|
|
32
|
+
module: ShaderPass;
|
|
33
|
+
uniforms: Record<string, number | number[]>;
|
|
34
|
+
/** GPU passes this run costs — asserted by the tests, and worth reading in a profile. */
|
|
35
|
+
passCount: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function compileOps(ops: ResolvedOp[], moduleName: string): CompiledEffect | null;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<om-effect>` — deck's `effects` array, declared as markup.
|
|
3
|
+
*
|
|
4
|
+
* Three lanes, in the order an author reaches for them:
|
|
5
|
+
*
|
|
6
|
+
* 1. `preset="vintage"` — a named look. Tune it with `<op>-<param>`
|
|
7
|
+
* attributes, or eject it into its ops with `OmMap.expandPreset`.
|
|
8
|
+
* 2. `op="grain" size="0.12mm"` — one named operation with named knobs.
|
|
9
|
+
* Compose them in document order; consecutive pointwise ops cost one pass.
|
|
10
|
+
* 3. An inline `<script type="application/json">` luma ShaderModule — raw
|
|
11
|
+
* GLSL, passed through untouched, which is the 1:1 deck surface.
|
|
12
|
+
*
|
|
13
|
+
* DOM order is pipeline order, exactly as it is for `<om-layer>`. The inline
|
|
14
|
+
* module rides an `application/json` script because that is the one script
|
|
15
|
+
* type a cartograph's adoption sanitizer keeps, so an effect survives into a
|
|
16
|
+
* print sheet.
|
|
17
|
+
*/
|
|
18
|
+
import { type Effect } from "@deck.gl/core";
|
|
19
|
+
import type { OpParamDef } from "./catalogue";
|
|
20
|
+
export { EFFECT_PRESETS, EFFECT_PRESET_NAMES, expandPreset, isEffectPreset } from "./presets";
|
|
21
|
+
export { OP_NAMES, allOps, opDef } from "./ops";
|
|
22
|
+
export { OP_META, opMeta, type OpMeta, type OpParamDef } from "./catalogue";
|
|
23
|
+
export { CSS_PX_PER_MM } from "./compile";
|
|
24
|
+
/** One op with its knobs already coerced to shader values. */
|
|
25
|
+
export interface EffectOpIR {
|
|
26
|
+
op: string;
|
|
27
|
+
values: Record<string, number | number[]>;
|
|
28
|
+
}
|
|
29
|
+
/** One `<om-effect>` element. */
|
|
30
|
+
export interface EffectEntryIR {
|
|
31
|
+
/** The ops this element contributes — one for `op=`, several for `preset=`. */
|
|
32
|
+
ops?: EffectOpIR[];
|
|
33
|
+
/** Or a module supplied verbatim, with its uniform values. */
|
|
34
|
+
raw?: {
|
|
35
|
+
module: Record<string, unknown>;
|
|
36
|
+
uniforms: Record<string, unknown>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export type EffectsIR = EffectEntryIR[];
|
|
40
|
+
export interface BuiltEffects {
|
|
41
|
+
effects: Effect[];
|
|
42
|
+
/**
|
|
43
|
+
* Re-point every compiled pass at a new device scale.
|
|
44
|
+
*
|
|
45
|
+
* Called when a capture re-rasterises at print resolution: the knobs stay in
|
|
46
|
+
* millimetres and only this changes, so a 600 dpi plate keeps the same
|
|
47
|
+
* physical grain and ink width it had on screen. Raw modules are left alone —
|
|
48
|
+
* their uniforms mean whatever their author decided.
|
|
49
|
+
*/
|
|
50
|
+
setPixelsPerMm(value: number): void;
|
|
51
|
+
}
|
|
52
|
+
/** A knob's attribute value as the shader wants it, or undefined if unusable. */
|
|
53
|
+
export declare function coerceParam(param: OpParamDef, raw: string): number | number[] | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Read the `<om-effect>` children of a map.
|
|
56
|
+
*
|
|
57
|
+
* Bad input is SKIPPED with a console warning rather than thrown: one
|
|
58
|
+
* malformed effect must not cost the author their map, and `OmMap.validate`
|
|
59
|
+
* is where the same problem is reported as an error with a fix.
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseEffectEls(mapEl: Element): EffectsIR;
|
|
62
|
+
/** Test seam: make generated names deterministic for snapshot-style assertions. */
|
|
63
|
+
export declare function resetEffectBuildCounterForTests(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Turn the IR into deck effects.
|
|
66
|
+
*
|
|
67
|
+
* Consecutive op entries fuse into ONE compiled effect; a raw entry breaks the
|
|
68
|
+
* run, because author-supplied GLSL cannot be merged into generated code and
|
|
69
|
+
* its position in the chain is part of what the author asked for.
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildPostProcessEffects(ir: EffectsIR, pixelsPerMm?: number): BuiltEffects;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The op catalogue's GLSL — the half that only a map with effects downloads.
|
|
3
|
+
*
|
|
4
|
+
* Metadata lives in `catalogue.ts` (see its header for why). An op's body
|
|
5
|
+
* reads and writes `color`; `u(param)` returns the accessor for a knob's
|
|
6
|
+
* uniform, since the compiler owns slot assignment, and `px` is the accessor
|
|
7
|
+
* for pixels-per-millimetre, which is what keeps a spatial knob the same
|
|
8
|
+
* physical size at any export resolution.
|
|
9
|
+
*
|
|
10
|
+
* A POINTWISE body may use `coord` and `texSize`. A NEIGHBOURHOOD body gets
|
|
11
|
+
* those plus `src` (sampler2D), with `color` pre-seeded from the centre.
|
|
12
|
+
*/
|
|
13
|
+
import { type OpMeta } from "./catalogue";
|
|
14
|
+
export type { OpKind, OpMeta, OpParamDef, ParamKind } from "./catalogue";
|
|
15
|
+
export { OP_NAMES, opMeta } from "./catalogue";
|
|
16
|
+
export interface OpDef extends OpMeta {
|
|
17
|
+
glsl(u: (param: string) => string, px: string): string;
|
|
18
|
+
}
|
|
19
|
+
/** Shared helpers, emitted once per compiled module. */
|
|
20
|
+
export declare const OP_GLSL_PRELUDE = "\nfloat omfx_lum(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); }\nfloat omfx_hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }\n";
|
|
21
|
+
export declare function opDef(name: string): OpDef | undefined;
|
|
22
|
+
export declare function allOps(): OpDef[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presets — saved op lists, and nothing more.
|
|
3
|
+
*
|
|
4
|
+
* That is the whole design constraint: a preset must be expressible in the
|
|
5
|
+
* tier below it, the way `lighting="daylight"` is only a seeding of
|
|
6
|
+
* `lighting-ambient`/`lighting-sun`. If a preset ever needed something the op
|
|
7
|
+
* tier could not express, the op tier would be the thing to fix.
|
|
8
|
+
*
|
|
9
|
+
* Which is why `expandPreset` exists: "I like vintage but want less grain"
|
|
10
|
+
* should be paste-and-edit, not read-the-source. A preset can be ejected into
|
|
11
|
+
* the markup it stands for, and from then on it is ordinary authoring.
|
|
12
|
+
*/
|
|
13
|
+
export interface PresetOp {
|
|
14
|
+
op: string;
|
|
15
|
+
params: Record<string, number | string>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The shipped looks. Each is a finish for a PRINTED sheet — they assume the
|
|
19
|
+
* map beneath them is styled to suit (a night plate needs dark layers; no
|
|
20
|
+
* image pass can invert a light base into one), which is why the docs pair
|
|
21
|
+
* each with a base palette rather than promising a one-attribute transform.
|
|
22
|
+
*/
|
|
23
|
+
export declare const EFFECT_PRESETS: Record<string, PresetOp[]>;
|
|
24
|
+
export declare const EFFECT_PRESET_NAMES: readonly string[];
|
|
25
|
+
export declare function isEffectPreset(name: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* A preset as the markup it stands for — the eject button.
|
|
28
|
+
*
|
|
29
|
+
* Returns the `<om-effect op="…">` elements in order, ready to paste in place
|
|
30
|
+
* of the `preset` attribute. Lengths print with their `mm` unit, because a
|
|
31
|
+
* bare number in a spatial knob is the mistake this tier exists to prevent.
|
|
32
|
+
*/
|
|
33
|
+
export declare function expandPreset(name: string): string | null;
|
package/dist/programmatic.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Effect } from "@deck.gl/core";
|
|
1
2
|
import { type CameraOptions, type MandatedChromeHosts } from "./runtime-core";
|
|
2
3
|
import type { HoverPickMode } from "./hover-pick";
|
|
3
4
|
import { type LightingIR, type LightingOptions } from "./scene-lighting";
|
|
@@ -295,6 +296,16 @@ export declare class MapController {
|
|
|
295
296
|
setLighting(options: LightingOptions | null): void;
|
|
296
297
|
/** Resolved scene-lighting IR (test inspection) — null = deck default lights. */
|
|
297
298
|
getLighting(): LightingIR | null;
|
|
299
|
+
/**
|
|
300
|
+
* Post-process effects, supplied as deck's own `Effect` instances — the
|
|
301
|
+
* 1:1 surface, with no vocabulary of ours in the way.
|
|
302
|
+
*
|
|
303
|
+
* Build them however you like (`new PostProcessEffect(module, props)`, your
|
|
304
|
+
* own module, one of ours via `compileOps`); order is the chain order. While
|
|
305
|
+
* set, these outrank any `<om-effect>` the document declares; `null` hands
|
|
306
|
+
* the document its own chain back.
|
|
307
|
+
*/
|
|
308
|
+
setEffects(effects: Effect[] | null): void;
|
|
298
309
|
/**
|
|
299
310
|
* Terrain (spec: "Terrain") — a resolved TerrainIR, or null to turn the
|
|
300
311
|
* surface off. Note: terrain suppresses an active basemap while on
|