@nika-js/onlymap 0.8.3 → 0.9.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/CHANGELOG.md +17 -0
- package/LICENSE.md +2 -0
- package/README.md +40 -2
- package/dist/{LercDecode.es-DW-G7u1_.js → LercDecode.es-BMcxSLhD.js} +1 -1
- package/dist/{basemap-C6mTd_uL.js → basemap-m98j2wxG.js} +780 -780
- package/dist/cartograph/elements/om-cartograph.d.ts +6 -0
- package/dist/cartograph.js +429 -416
- package/dist/cartograph.standalone.js +1235 -1222
- package/dist/elements/om-map.d.ts +21 -0
- package/dist/{geoparquet-CMESy27r.js → geoparquet-XOwOmChh.js} +1 -1
- package/dist/html-data.d.ts +1 -1
- package/dist/{index-CgpoaR-U.js → index-BMbpftvm.js} +1 -1
- package/dist/{index-DgHzTg2n.js → index-BSAY6CWm.js} +12159 -11695
- package/dist/index-CfPbQUqO.js +511 -0
- package/dist/{index-CrMM0kHK.js → index-DDNElBTs.js} +106 -106
- package/dist/{index-FEPpi86V.js → index-DzOvV-O7.js} +25 -25
- package/dist/{index-BfL5W1Ay.js → index-HZWdgtm4.js} +36 -36
- package/dist/index.d.ts +8 -3
- package/dist/{lerc-BQFrOj7h.js → lerc-qK-nhCaB.js} +2 -2
- package/dist/license.d.ts +46 -1
- package/dist/onlymap.standalone.js +26793 -25831
- package/dist/onlymapjs.js +97 -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-6vW4_NSI.js → raster-Dg5p_99H.js} +3 -3
- package/dist/{raster-pipeline-CYiGgsil.js → raster-pipeline-DhjkqDYd.js} +1 -1
- package/dist/runtime-core.d.ts +39 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-BNQZpB1t.js → zarr-D3CzK1Zm.js} +2 -2
- package/docs/cartograph.md +10 -2
- package/docs/effects.md +197 -0
- package/llms.txt +3 -2
- package/onlymapjs.html-data.json +171 -0
- package/package.json +3 -3
- package/skills/onlymapjs/SKILL.md +3 -2
- package/skills/onlymapjs/references/syntax.md +10 -3
package/dist/onlymapjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aQ as e, aR as r, aS as t, aT as o, aU as b, aV as i, aD as c, aW as n, aX as l, aY as S, aZ as E, b as g, a_ as L, a$ as T, b0 as d, b1 as _, b2 as A, b3 as p, b4 as m, b5 as I, b6 as D, b7 as M, b8 as u, b9 as y, ba as f, bb as O, bc as R, aC as P, bd as N, aK as F, be as h, bf as C, bg as B, W as v, bh as x, bi as G, bj as U, bk as W, bl as w, bm as Y, bn as X, bo as k, bp as H, bq as K, br as V, bs as z, bt as J, bu as j, bv as q, bw as Q, bx as Z, by as $, e as aa, bz as sa, bA as ea, bB as ra, bC as ta, bD as oa, bE as ba, bF as ia, bG as ca, bH as na, bI as la, bJ as Sa, bK as Ea, bL as ga, bM as La, bN as Ta, a as da, bO as _a, bP as Aa, bQ as pa, bR as ma, bS as Ia, bT as Da, bU as Ma, bV as ua, bW as ya, bX as fa, bY as Oa, bZ as Ra, b_ as Pa, b$ as Na, c0 as Fa, c1 as ha, c2 as Ca, c3 as Ba, c4 as va, c5 as xa, c6 as Ga, c7 as Ua, c8 as Wa, c9 as wa, ca as Ya, cb as Xa, cc as ka, cd as Ha, ce as Ka, cf as Va, cg as za, ch as Ja, ci as ja, cj as qa, ck as Qa, cl as Za, cm as $a, cn as as, co as ss, cp as es, cq as rs, cr as ts, cs as os, ct as bs } from "./index-BSAY6CWm.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ALL_POSITION_VALUES,
|
|
4
4
|
r as AUDIT_EXEMPTIONS,
|
|
@@ -6,106 +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
|
-
|
|
11
|
+
l as DEFAULT_FOLD_BREAKPOINT_PX,
|
|
12
|
+
S as DRONE_SENSOR_DATABASE,
|
|
13
13
|
E as EDGE_TOLERANCE_PX,
|
|
14
|
+
g as EFFECT_PRESET_NAMES,
|
|
14
15
|
L as FOLD_BOTTOM_CLEARANCE_PX,
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
T as FOLD_HYSTERESIS_PX,
|
|
17
|
+
d as FOLD_SIDES,
|
|
17
18
|
_ as FOLD_SINGLE_SIDED_RATIO,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
A as GeoJsonLayer,
|
|
20
|
+
p as IconLayer,
|
|
21
|
+
m as LEGACY_POSITION_ALIASES,
|
|
21
22
|
I as LIGHTING_PRESET_NAMES,
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
D as Layer,
|
|
24
|
+
M as LayerExtension,
|
|
24
25
|
u as MANAGED_SLOTS,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
y as MapController,
|
|
27
|
+
f as OmMap,
|
|
27
28
|
O as ScatterplotLayer,
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
R as ScenegraphLayer,
|
|
30
|
+
P as SimpleMeshLayer,
|
|
30
31
|
N as Tile3DLayer,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
H as
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
32
|
+
F as TileLayer,
|
|
33
|
+
h as UNIT_SYSTEMS,
|
|
34
|
+
C as WGS84_MEAN_RADIUS_M,
|
|
35
|
+
B as WIDGET_STYLE_KEY_NAMES,
|
|
36
|
+
v as WebMercatorViewport,
|
|
37
|
+
x as arrowTableToColumnar,
|
|
38
|
+
G as asRows,
|
|
39
|
+
U as auditLayout,
|
|
40
|
+
W as badgeMode,
|
|
41
|
+
w as bottomEndLiftPx,
|
|
42
|
+
Y as compileExpression,
|
|
43
|
+
X as compileFullJsAccessorBlockInSandbox,
|
|
44
|
+
k as computeTimeline,
|
|
45
|
+
H as configureBasemap,
|
|
46
|
+
K as configureData,
|
|
47
|
+
V as configureIfc,
|
|
48
|
+
z as configureLicense,
|
|
49
|
+
J as configureTelemetry,
|
|
50
|
+
j as descriptorToIR,
|
|
51
|
+
q as destroySandbox,
|
|
50
52
|
Q as distanceMeters,
|
|
51
53
|
Z as effectiveFoldBreakpointPx,
|
|
52
54
|
$ as evaluateInSandbox,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
la as
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Qa as
|
|
105
|
-
Za as
|
|
106
|
-
$a as
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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,
|
|
65
|
+
la as getLayerSchema,
|
|
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
|
+
Da as mountForTest,
|
|
78
|
+
Ma as niceNumber,
|
|
79
|
+
ua as normalizeData,
|
|
80
|
+
ya as parseDurationMs,
|
|
81
|
+
fa as parseTerrainAttrs,
|
|
82
|
+
Oa as parseUnitSystem,
|
|
83
|
+
Ra as parseWidgetStyle,
|
|
84
|
+
Pa as pathLengthMeters,
|
|
85
|
+
Na as registerAction,
|
|
86
|
+
Fa as registerBasemap,
|
|
87
|
+
ha as registerFormat,
|
|
88
|
+
Ca as registerLayer,
|
|
89
|
+
Ba as registerRoutingProvider,
|
|
90
|
+
va as registerSource,
|
|
91
|
+
xa as registerTerrain,
|
|
92
|
+
Ga as registerWidget,
|
|
93
|
+
Ua as releaseDataOwner,
|
|
94
|
+
Wa as resolveFoldBreakpointPx,
|
|
95
|
+
wa as resolveImageOverlay,
|
|
96
|
+
Ya as resolveLighting,
|
|
97
|
+
Xa as resolveSlot,
|
|
98
|
+
ka as ringAreaMeters2,
|
|
99
|
+
Ha as ringEnclosesPole,
|
|
100
|
+
Ka as ringPerimeterMeters,
|
|
101
|
+
Va as rowAt,
|
|
102
|
+
za as sandboxHtml,
|
|
103
|
+
Ja as scaleBarStep,
|
|
104
|
+
ja as setKeepBadge,
|
|
105
|
+
qa as setMeasureRadiusMeters,
|
|
106
|
+
Qa as settleLayout,
|
|
107
|
+
Za as shouldFoldAtWidth,
|
|
108
|
+
$a 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
|
|
111
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as se, t as ze, i as wt, a as Be, s as St, C as Pt, b as bt, F as Ct, A as Lt, d as It, R as fe, e as Gt, p as vt, m as Et, f as Ft, g as At, r as _e, h as jt, j as Rt, k as Ut, l as Mt, n as Ot } from "./raster-pipeline-
|
|
2
|
-
import {
|
|
1
|
+
import { c as se, t as ze, i as wt, a as Be, s as St, C as Pt, b as bt, F as Ct, A as Lt, d as It, R as fe, e as Gt, p as vt, m as Et, f as Ft, g as At, r as _e, h as jt, j as Rt, k as Ut, l as Mt, n as Ot } from "./raster-pipeline-DhjkqDYd.js";
|
|
2
|
+
import { aL as Kt, aM as xt } from "./index-BSAY6CWm.js";
|
|
3
3
|
import ye from "./index-CW1n5LdO.js";
|
|
4
4
|
function Dt(e, t) {
|
|
5
5
|
const n = e.length / 3, r = new Uint8ClampedArray(n * 4), o = 0, i = n, a = n * 2;
|
|
@@ -1070,7 +1070,7 @@ j.set(f.Zstd, () => import("./zstd-jXobGRcq.js").then((e) => e.decode));
|
|
|
1070
1070
|
j.set(f.Jpeg, () => Promise.resolve(le));
|
|
1071
1071
|
j.set(f.Jpeg6, () => Promise.resolve(le));
|
|
1072
1072
|
j.set(f.Webp, () => Promise.resolve(le));
|
|
1073
|
-
j.set(f.Lerc, () => import("./lerc-
|
|
1073
|
+
j.set(f.Lerc, () => import("./lerc-qK-nhCaB.js").then((e) => e.l).then((e) => e.decode));
|
|
1074
1074
|
async function ce(e, t, n) {
|
|
1075
1075
|
const r = j.get(t);
|
|
1076
1076
|
if (!r)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { w as de } from "./mgrs-BY9bIvp4.js";
|
|
2
|
-
import {
|
|
2
|
+
import { aA as he, aB as fe, aC as se, aD as oe, aE as me, l as pe, aF as ge, v as Z, aG as ve, q as be, aH as xe, aI as Pe, aJ as ye, aK as ie } from "./index-BSAY6CWm.js";
|
|
3
3
|
function Te(r, e, t) {
|
|
4
4
|
const { projectedCorners: n } = e, { topLeft: s, topRight: o, bottomRight: i, bottomLeft: a } = n, c = t(s[0], s[1]), u = t(o[0], o[1]), l = t(i[0], i[1]), h = t(a[0], a[1]), f = [
|
|
5
5
|
c,
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type HoverPickMode } from "./hover-pick";
|
|
2
|
-
import type { PickingInfo } from "@deck.gl/core";
|
|
2
|
+
import type { Effect, PickingInfo } from "@deck.gl/core";
|
|
3
3
|
import { type LightingIR } from "./scene-lighting";
|
|
4
|
+
import type { EffectsIR } from "./post-process";
|
|
4
5
|
import { type TerrainIR } from "./terrain";
|
|
5
6
|
import { type ClipBoxIR } from "./clip-box";
|
|
6
7
|
import { type SnapAgent, type SnapConfig } from "./snapping";
|
|
@@ -286,6 +287,13 @@ export declare class RuntimeCore {
|
|
|
286
287
|
/** setMaxPitch's last value — the controller's tilt ceiling, or null for the default. */
|
|
287
288
|
private maxPitch;
|
|
288
289
|
private minZoom;
|
|
290
|
+
/** The authored `<om-effect>` chain, and the deck effects compiled from it. */
|
|
291
|
+
private effectsIR;
|
|
292
|
+
private postProcess;
|
|
293
|
+
/** Set by the programmatic lane; outranks the document's own chain. */
|
|
294
|
+
private rawEffects;
|
|
295
|
+
/** The capture override in force, or null at display resolution. */
|
|
296
|
+
private capturePixelRatio;
|
|
289
297
|
/** Retained descriptors — what the per-frame channel re-applies against. */
|
|
290
298
|
private lastIRs;
|
|
291
299
|
/** layerId → effect-driven plain-prop patches (the per-frame channel). */
|
|
@@ -471,6 +479,36 @@ export declare class RuntimeCore {
|
|
|
471
479
|
private pickCallbacks;
|
|
472
480
|
/** The current lighting as a deck `effects` array — [] restores deck's default lights. */
|
|
473
481
|
private buildEffects;
|
|
482
|
+
/** Push the current effect list at whichever renderer is live. */
|
|
483
|
+
private applyEffects;
|
|
484
|
+
/**
|
|
485
|
+
* Device pixels per millimetre right now — CSS's 96 dpi, times whatever
|
|
486
|
+
* rasterisation scale is in force. A capture at 300 dpi makes this ~3x the
|
|
487
|
+
* display value, which is exactly how a millimetre-valued knob keeps its
|
|
488
|
+
* physical size in print.
|
|
489
|
+
*/
|
|
490
|
+
private pixelsPerMm;
|
|
491
|
+
/**
|
|
492
|
+
* Replace the post-process chain.
|
|
493
|
+
*
|
|
494
|
+
* The op catalogue and its GLSL are a LAZY chunk — a map with no
|
|
495
|
+
* `<om-effect>` never loads a line of it, which is the same bundle
|
|
496
|
+
* discipline the basemap adapter and the cartograph entry follow. The
|
|
497
|
+
* identity guard on `this.effectsIR` is what keeps a late-arriving chunk
|
|
498
|
+
* from applying a chain the document has already moved past.
|
|
499
|
+
*/
|
|
500
|
+
setEffects(ir: EffectsIR): void;
|
|
501
|
+
/** The authored chain, for tests and the headless lane. */
|
|
502
|
+
getEffectsInternal(): EffectsIR;
|
|
503
|
+
/**
|
|
504
|
+
* Deck effects supplied directly — the programmatic lane's 1:1 surface.
|
|
505
|
+
*
|
|
506
|
+
* Takes precedence over the authored `<om-effect>` chain while set, because
|
|
507
|
+
* an app that reaches for this is driving the renderer itself. `null` hands
|
|
508
|
+
* the document its chain back; `[]` is the different request "render no
|
|
509
|
+
* effects at all", and keeps the document's chain suppressed.
|
|
510
|
+
*/
|
|
511
|
+
setRawEffects(effects: Effect[] | null): void;
|
|
474
512
|
/**
|
|
475
513
|
* Scene lighting (spec: "Scene Lighting") — swap the LightingEffect on
|
|
476
514
|
* the live renderer. null restores deck's default lights. Headless stores
|
package/dist/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, j as pr, k as mr } from "./raster-pipeline-
|
|
2
|
-
import {
|
|
1
|
+
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, j as pr, k as mr } from "./raster-pipeline-DhjkqDYd.js";
|
|
2
|
+
import { aD as gr } from "./index-BSAY6CWm.js";
|
|
3
3
|
import $t from "./index-CW1n5LdO.js";
|
|
4
4
|
var Et;
|
|
5
5
|
function h(e, t, n) {
|
package/docs/cartograph.md
CHANGED
|
@@ -22,8 +22,8 @@ to PDF at true page size via CSS `@page` and exports PNG/JPEG at print DPI throu
|
|
|
22
22
|
<html>
|
|
23
23
|
<head>
|
|
24
24
|
<meta charset="utf-8">
|
|
25
|
-
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.
|
|
26
|
-
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.
|
|
25
|
+
<script type="module" src="https://unpkg.com/@nika-js/onlymap@0.9.0/dist/cartograph.standalone.js"></script>
|
|
26
|
+
<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.9.0/dist/cartograph.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
29
29
|
<om-cartograph cartograph-id="cg-lot-12" format="cartograph/2" size="A4" theme="minimal"
|
|
@@ -386,6 +386,14 @@ included in print and PNG export. Two ways it lifts:
|
|
|
386
386
|
credit is removed (a static-only page loads no runtime, so the credit
|
|
387
387
|
stays; the map inside a live frame is what carries `license-key`).
|
|
388
388
|
|
|
389
|
+
Removal is a permission, not a requirement. `<om-cartograph keep-badge>`
|
|
390
|
+
keeps the credit on a paid sheet, rendering it as "Built with OnlyMap by
|
|
391
|
+
NIKA" — without the free-tier sentence, which would not describe that
|
|
392
|
+
deployment. The attribute is read from the page element itself, so a
|
|
393
|
+
static-only sheet honours it with no runtime loaded, and the canvas
|
|
394
|
+
exporter prints whatever the element says, so a PNG can never disagree
|
|
395
|
+
with the screen.
|
|
396
|
+
|
|
389
397
|
Telemetry: a live frame's map beacon includes `cartograph` in its feature
|
|
390
398
|
census — same endpoint, nothing new sent. Static-only pages load no runtime
|
|
391
399
|
and send nothing.
|