@nika-js/onlymap 0.8.4 → 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.
Files changed (36) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +32 -2
  3. package/dist/{LercDecode.es-BKustV-1.js → LercDecode.es-BMcxSLhD.js} +1 -1
  4. package/dist/{basemap-B0SwrOqQ.js → basemap-m98j2wxG.js} +780 -780
  5. package/dist/elements/om-map.d.ts +10 -0
  6. package/dist/{geoparquet-C5E6N6G0.js → geoparquet-XOwOmChh.js} +1 -1
  7. package/dist/html-data.d.ts +1 -1
  8. package/dist/{index-CaM1C93G.js → index-BMbpftvm.js} +1 -1
  9. package/dist/{index-D5Fqn_eZ.js → index-BSAY6CWm.js} +12139 -11698
  10. package/dist/index-CfPbQUqO.js +511 -0
  11. package/dist/{index-BnQDfKfE.js → index-DDNElBTs.js} +106 -106
  12. package/dist/{index-xUVMTGZG.js → index-DzOvV-O7.js} +25 -25
  13. package/dist/{index-BLIjrGOE.js → index-HZWdgtm4.js} +36 -36
  14. package/dist/index.d.ts +3 -0
  15. package/dist/{lerc-TxsFLMlC.js → lerc-qK-nhCaB.js} +2 -2
  16. package/dist/onlymap.standalone.js +26772 -25833
  17. package/dist/onlymapjs.js +101 -98
  18. package/dist/post-process/catalogue.d.ts +61 -0
  19. package/dist/post-process/compile.d.ts +37 -0
  20. package/dist/post-process/index.d.ts +71 -0
  21. package/dist/post-process/ops.d.ts +22 -0
  22. package/dist/post-process/presets.d.ts +33 -0
  23. package/dist/post-process/validate.d.ts +8 -0
  24. package/dist/programmatic.d.ts +11 -0
  25. package/dist/{raster-B_wekCHv.js → raster-Dg5p_99H.js} +3 -3
  26. package/dist/{raster-pipeline-Dn2fkLYx.js → raster-pipeline-DhjkqDYd.js} +1 -1
  27. package/dist/runtime-core.d.ts +39 -1
  28. package/dist/version.d.ts +1 -1
  29. package/dist/{zarr-Dan2ab-l.js → zarr-D3CzK1Zm.js} +2 -2
  30. package/docs/cartograph.md +2 -2
  31. package/docs/effects.md +197 -0
  32. package/llms.txt +2 -1
  33. package/onlymapjs.html-data.json +163 -0
  34. package/package.json +3 -3
  35. package/skills/onlymapjs/SKILL.md +3 -2
  36. package/skills/onlymapjs/references/syntax.md +9 -2
@@ -0,0 +1,197 @@
1
+ # Post-process effects — `<om-effect>`
2
+
3
+ > **Available in 0.9.0.** `<om-effect>` children of `<om-map>` **are** deck.gl's
4
+ > `effects` array. Document order is pipeline order, exactly as it is for
5
+ > `<om-layer>`.
6
+
7
+ A post-process pass runs over the *finished* frame: deck draws the map, then each
8
+ effect treats the resulting picture. That makes it the right tool for a **look** —
9
+ a printed finish, a duotone plate, a night treatment — and the wrong tool for
10
+ anything that needs to know about features, which belongs in a layer's accessors.
11
+
12
+ ```html
13
+ <om-map center="[-98.5, 39.5]" zoom="4" basemap="none">
14
+ <om-layer id="land" type="GeoJsonLayer" data="./countries.geojson" color="#2a3142"></om-layer>
15
+ <om-effect preset="vintage"></om-effect>
16
+ </om-map>
17
+ ```
18
+
19
+ Runnable: [`dev/examples/features/styling/apply-a-print-finish.html`](../dev/examples/features/styling/apply-a-print-finish.html).
20
+
21
+ ## Three lanes, one per element
22
+
23
+ Each `<om-effect>` picks exactly one:
24
+
25
+ | Lane | Looks like | Use it when |
26
+ |---|---|---|
27
+ | Preset | `<om-effect preset="vintage">` | You want a finish and not a shader |
28
+ | Op + knobs | `<om-effect op="grain" amount="0.1" size="0.2mm">` | You want to compose or tune |
29
+ | Inline module | `<om-effect><script type="application/json">{…}</script></om-effect>` | You want raw GLSL |
30
+
31
+ The inline lane is the **1:1 deck surface** — deck gives you
32
+ `PostProcessEffect(module, props)` over an ordered array, and that is exactly what
33
+ is passed through, untouched. The other two lanes are convenience over it.
34
+
35
+ The module rides an `application/json` script on purpose: that is the one script
36
+ type a cartograph's adoption sanitiser keeps, so an effect survives into a print
37
+ sheet.
38
+
39
+ ## Presets
40
+
41
+ `vintage`, `engraved`, `night`, `blueprint`, `riso`, `newsprint`, `muted`.
42
+
43
+ A preset is **a saved op list and nothing more**. Override a single knob with
44
+ `<op>-<param>`, the same shape `lighting-sun-azimuth` has:
45
+
46
+ ```html
47
+ <om-effect preset="vintage" grain-amount="0.02"></om-effect>
48
+ ```
49
+
50
+ To stop using the preset as a black box, eject it:
51
+
52
+ ```js
53
+ OmMap.expandPreset("vintage")
54
+ // → '<om-effect op="tint" paper="#efe4c8" ink="#2b1b10" …></om-effect>…'
55
+ ```
56
+
57
+ That string is the markup the preset stands for — paste it in place of the
58
+ `preset` attribute and tune the ops directly. (The validator's own fix strings
59
+ point you here when you misspell an override.)
60
+
61
+ ## Ops
62
+
63
+ `kind` decides cost, not quality — see [Passes](#passes-and-cost).
64
+
65
+ ### Pointwise (fuse together, one pass for any number of them)
66
+
67
+ | Op | Knobs (default) |
68
+ |---|---|
69
+ | `tint` | `paper` (#f3eee2), `ink` (#1a1612), `amount` (1), `keep-color` (1) |
70
+ | `levels` | `brightness` (0), `contrast` (1), `gamma` (1) |
71
+ | `saturation` | `amount` (1 — 0 greyscale, >1 boosted) |
72
+ | `posterize` | `levels` (6 — steps per channel) |
73
+ | `vignette` | `amount` (0.4), `radius` (0.65), `softness` (0.45) |
74
+ | `grain` | `amount` (0.06), `size` (0.12mm), `seed` (1), `mono` (1) |
75
+
76
+ ### Neighbourhood (each costs its own pass — they sample their surroundings)
77
+
78
+ | Op | Knobs (default) |
79
+ |---|---|
80
+ | `edges` | `amount` (0.5), `width` (0.08mm), `color` (#1a1612) |
81
+ | `blur` | `radius` (0.2mm) |
82
+ | `sharpen` | `amount` (0.5), `radius` (0.1mm) |
83
+ | `halftone` | `cell` (0.6mm), `angle` (15deg), `amount` (1), `paper` (#ffffff) |
84
+
85
+ ## Millimetres, not pixels
86
+
87
+ Every knob that describes a **size** is in millimetres, and a bare `px` value is a
88
+ validation error rather than a silent trap.
89
+
90
+ The reason is print. A grain keyed to device pixels is one device pixel at every
91
+ resolution — so on a 4× plate it renders four times finer than on screen, and the
92
+ look you approved quietly disappears exactly where it matters most. Millimetres
93
+ resolve against the live pixel density through a `pxPerMm` uniform, so a capture at
94
+ 600 dpi re-points one number and keeps the same physical grain.
95
+
96
+ ```html
97
+ <om-effect op="grain" size="0.12mm"></om-effect> <!-- 0.12mm on screen AND on paper -->
98
+ ```
99
+
100
+ Angles take `deg`. Unitless numbers are accepted for lengths and read as mm.
101
+
102
+ > **Resolution floor.** A cell smaller than one device pixel cannot be drawn, so
103
+ > very fine values clamp. At 1× (~3.8 px/mm) anything under ~0.26mm is at the
104
+ > floor; at 2× it is ~0.13mm. If a look must hold its exact physical size across
105
+ > display scales, keep spatial knobs above those values.
106
+
107
+ ## Passes and cost
108
+
109
+ Consecutive **pointwise** ops compile into one fragment function and therefore one
110
+ GPU pass. A ten-knob colour chain costs a single pass. Only a **neighbourhood** op
111
+ starts a new one.
112
+
113
+ ```html
114
+ <!-- ONE pass -->
115
+ <om-effect op="tint" ink="#102030"></om-effect>
116
+ <om-effect op="levels" contrast="1.2"></om-effect>
117
+ <om-effect op="grain" amount="0.08"></om-effect>
118
+
119
+ <!-- THREE passes: the halftone breaks the run -->
120
+ <om-effect op="tint" ink="#102030"></om-effect>
121
+ <om-effect op="halftone" cell="0.5mm"></om-effect>
122
+ <om-effect op="grain" amount="0.08"></om-effect>
123
+ ```
124
+
125
+ Knobs stay uniforms rather than being baked into the shader, so a widget or a
126
+ story step can move one without recompiling anything.
127
+
128
+ ## Inline shader modules
129
+
130
+ ```html
131
+ <om-effect uniforms='{"strength": 0.4}'>
132
+ <script type="application/json">
133
+ {
134
+ "name": "myEffect",
135
+ "fs": "vec4 myEffect_filter(vec4 color, vec2 texSize, vec2 texCoord) { … }",
136
+ "passes": [{ "filter": "myEffect_filter" }]
137
+ }
138
+ </script>
139
+ </om-effect>
140
+ ```
141
+
142
+ Requirements: `name` (string), `fs` (string), and a non-empty `passes` array. Each
143
+ pass names a function that `fs` **must actually declare** — deck compiles a missing
144
+ one to an empty shader that draws nothing while reporting success, so the validator
145
+ checks it for you.
146
+
147
+ A module's `name` is its identity. If you edit the shader, change the name too, or
148
+ the renderer may keep the previous program.
149
+
150
+ ## Changing effects at runtime
151
+
152
+ ```html
153
+ <om-behavior on="click" action="set-effect" preset="night"></om-behavior>
154
+ ```
155
+
156
+ `set-effect {preset}` writes one `<om-effect preset>` child — a plain document
157
+ mutation, so **undo/redo** see it like any other edit. Knob overrides ride as
158
+ `<op>-<param>` keys: `{ preset: "vintage", "grain-amount": 0.02 }`.
159
+ `{ preset: "none" }` removes it. A hand-composed op chain is left alone.
160
+
161
+ > **Not story-rewindable yet.** A story step can apply a finish, but seeking back
162
+ > will not remove it: story rewind restores `<om-map>` attributes, and this action
163
+ > adds a child element. Element-level capture is a follow-up.
164
+
165
+ Programmatically, `MapController.setEffects(effects | null)` takes deck `Effect`
166
+ instances directly and outranks the document's chain while set; `null` hands the
167
+ chain back, and `[]` renders no effects at all.
168
+
169
+ ## What the validator catches
170
+
171
+ `OmMap.validate` (and `<om-map validate>`) reports, each with a fix:
172
+
173
+ - an unknown `preset` or `op`;
174
+ - a knob that op does not have, and an override aimed at an op the preset lacks;
175
+ - a **pixel** value in a spatial knob;
176
+ - an inline module whose `passes` name a function its `fs` never declares;
177
+ - an `<om-effect>` that is not a direct child of `<om-map>` — nested deeper it is
178
+ never applied;
179
+ - more than one lane on one element.
180
+
181
+ It also **warns** when the map has a MapLibre basemap: a pass runs over deck's own
182
+ framebuffer, so the basemap composites underneath and stays untreated. Use
183
+ `basemap="none"` and draw the base as layers when the finish should cover
184
+ everything.
185
+
186
+ ## Bundle cost
187
+
188
+ None, unless you use it. Op metadata (for validation, IntelliSense and preset
189
+ expansion) lives in the core bundle; the GLSL is a separate chunk fetched only when
190
+ a map actually has an effect. A map with no `<om-effect>` never downloads the
191
+ shader library — pinned by a browser test.
192
+
193
+ ## Not in 0.9.0
194
+
195
+ `lut` — a colour lookup image, the highest-leverage op and the most data-first. It
196
+ needs texture bindings, async asset loading and device lifecycle, so it gets its own
197
+ release rather than being crammed into this one.
package/llms.txt CHANGED
@@ -40,10 +40,11 @@ Programmatic/native bridge rule: `MapController.setLayers()` accepts normal func
40
40
  - `<om-widget type="legend|layer-switcher|basemap-switcher|lighting|clip-box|zoom-controls|undo-redo|scale-bar|attribution|filter|vega-lite|dynamic-chart|measure" position="bottom-end">` — static UI panels. `position` takes one of 8 managed slots (logical, RTL-aware: `top-start|top-center|top-end|center-start|center-end|bottom-start|bottom-center|bottom-end`; legacy corners `top-left` etc. alias) — same-slot widgets stack with flush edges and a shared gap (never overlap); provider attribution joins `bottom-end` and the license badge joins `bottom-start` as in-flow members, so required chrome never covers a widget; `order="1"` orders within a slot; adjacent compact button widgets (zoom-controls, undo-redo, widgets-toggle) auto-merge into ONE control group with dividers (`cluster="false"` opts a widget out); `position="manual"` renders a plain block you place with your own CSS (even outside the map). At narrow map widths managed widgets auto-fold into one accessible drawer per map side — at ≤640px when some row (top/center/bottom) has widgets on more than one of its slots, and only at ≤416px when every occupied row is one-sided (a lone legend at center-start keeps the row to itself and survives narrower maps); `fold="never"` exempts an essential widget, `widgets-fold="off"` opts the map out, `--om-widget-fold-breakpoint` changes the threshold. Layout tokens on `<om-map>`: `widget-style="gap:10 opacity:0.9 inset:16"` (keys inset/gap/inset-x/-y/gap-x/-y/opacity/radius/size, px except opacity) or the `--om-widget-inset-x/-y/-gap-x/-gap-y/-opacity/-radius/-fold-breakpoint` custom properties. Built-ins are themeable from page CSS via custom properties (they inherit through the shadow root): `om-map { --om-widget-bg: #111827; --om-widget-fg: #f9fafb; }` — full set: `--om-widget-bg/-fg/-muted/-border/-hover-bg/-accent`; scope to a single widget with an `om-widget[type=legend]` selector instead. `measure` is a geodesic ruler: `modes="distance area volume"` (default `distance area`), `units="metric|imperial|nautical"` — click the map to place points, live per-segment + total labels render on the map, and it dispatches an `om-measure` event; it reuses the draw capture stack (measure/draw mutually exclusive) and its geometry is ephemeral (never saved, not an undo step) — see the dedicated `measure`/`volume` bullet above for the full event shape and the `profile`/`density`/`swell`/`shrink`/`deadband` volume-mode attributes. `scale-bar` now takes the same `units`. `dynamic-chart` is the same Vega-Lite rendering as `vega-lite` but fed by a live DOM event instead of a layer: `on="<event-name>"` (required) + `series-field="<name>"` (default `series`) reads `event.detail[seriesField]` as `data.values` and re-embeds on every event where it's a present array, at a fixed `width`; omitting the field on a later event freezes the chart with no separate pause API — built for a feature (a drawn line's elevation profile) that computes its own series live and has no layer to bind to. No `type` + HTML + `<script type="om/widget">` = custom widget with `ctx` (`ctx.layers`, `ctx.data(id)`, `ctx.dataInViewport(id)`, `ctx.stats(id, field)`, `ctx.viewport`, `ctx.selection`, `ctx.emit(action, payload)`), `this.watch = ['data:<layerId>', 'viewport', 'selection', 'layers', 'history', 'basemap']` (`layers` also fires on visibility/filter changes; `basemap` on basemap switches; `history` on undo/redo availability), `this.$(sel)`, `vegaEmbed`/`d3` as globals.
41
41
  - Custom-widget event emission (the #1 custom-widget bug — a widget that renders but does nothing): a widget DRIVES the map ONLY by EMITTING a registered action; it never mutates the map or dispatches its own `CustomEvent`. Two ways: (1) declarative `data-emit="<action>"` + `data-*` payload keys on an element (fires on click, or change for form controls whose `.value` is auto-added; `data-*` values are STRINGS — use `ctx.emit` for numeric/array payloads like a slider's range); (2) `ctx.emit(action, payload)` for typed payloads, wired INSIDE `render` (so `ctx` is in scope) by assigning `.oninput`/`.onclick` — e.g. a day slider: `this.render = (ctx) => { this.$("#day").oninput = e => ctx.emit("filter-layer", { layer: "quakes", field: "day", range: [+e.target.value, +e.target.value] }); }`. Actions + payloads: `filter-layer {layer, field?, range:[min,max]}`, `toggle-layer {layer, visible?}`, `fly-to {center:[lng,lat], zoom?, duration?}`, `zoom-to-feature {layer, featureId}`, `set-basemap {basemap}`, `highlight-feature {layer, featureId}`, `show-overlay`/`hide-overlay {target}`, `story-play`/`story-pause`/`story-seek {story, t?}`, `undo`/`redo`, `zoom-in`/`zoom-out`, `set-widgets-visible {visible}`; register more with `OmMap.registerAction(name, handler)`. NEVER inline `onclick=`/`oninput=` — `ctx` isn't a global and CSP blocks them, so it silently fires nothing (validation errors on it). For a plain value/time slider prefer the built-in `<om-widget type="filter" layer=… field=…>` — it wires `filter-layer` for you; hand-author only for bespoke UI.
42
42
  - `<om-overlay id="..." anchor-from="selection">` — rich geo-anchored HTML (≤ ~20 per map). Anchors: `anchor="[lng, lat]"` (static), `anchor-from="selection"` (follows picks), or `anchor-layer="regions" anchor-feature-id="mission"` (anchored to a feature's own geometry — bbox center — no coordinates in markup; `{{field}}` interpolates that feature's attributes). Selection-anchored overlays scope with `layer="…"` (one layer's picks only) and `selection-type="click"|"hover"` (one pick type only) — a click-opened popup should ALWAYS set `selection-type="click"`, else merely hovering any pickable feature drags it there and re-templates it against the hovered object; with it, hover is inert and a click on empty space still dismisses. `{{field}}` interpolates the picked feature HTML-escaped; `{{{field}}}` is raw (avoid); `{{z}}` is the pick's ELEVATION in meters, present only when a `pickable="3d"` layer ran deck's depth pass for that pick (absent — not `0` — otherwise, so "no elevation" is distinguishable from sea level). `clip-to-map` (opt-in) hides the overlay when its own BOX would spill past the map viewport rather than only when its anchor leaves — for small transient tips that track the cursor; an overhanging absolutely-positioned box inflates the page's scrollable overflow and the scrollbar -> map resize -> reprojection loop shows as view jitter. For labels on many features use `PopupLayer`, not overlays. STYLING: overlay content renders inside a shadow root (style isolation, like widgets) — page stylesheets/classes do NOT reach it; use inline `style="…"` on the content or a `<style>` element INSIDE the overlay (children move into the shadow root wholesale, so it applies there); inheritable props + CSS custom properties pierce.
43
- - `<om-behavior on="click|hover|drag|load|data-loaded" layer="..." action="...">` — declarative interaction. Built-in actions: `show-overlay`, `hide-overlay`, `show-tooltip`, `hide-tooltip`, `toggle-layer`, `set-pickable` (`{layer, pickable: true|false|"3d"}` — runtime picking/popup toggle, story-capturable; the per-layer popup on/off switch a viewer-facing export needs), `filter-layer`, `highlight-feature`, `zoom-to-feature`, `set-basemap`, `undo`, `redo`; scene/tool actions `set-lighting`, `set-terrain`, `set-clip-box` (`{min,max,invert?,highlight?}` / `{clear:true}`), `clip-box-edit` (`{editing}`), `export-region-3d` (`{target?, format?:"glb"|"b3dm"}` — what the draw widget's `export-3d` button emits), the draw actions `draw-mode` (`{target?:"sketch", mode:"point"|"line"|"polygon"|null}` — null exits drawing), `draw-commit`, `draw-cancel`, `draw-delete` (removes the last shape), `draw-clear`, `draw-config` (`{target?, autosave?, fillColor?, lineColor?}`) and `draw-save` (`{target?, format?:"download"|"file-system"|"both"}`) — every one of these drives the same store a `data="draw:<target>"` layer reads, so a custom toolbar can replace `<om-widget type="draw">` entirely; and the measure actions `measure-mode` (`{mode:"distance"|"area"|"volume"|null}`), `measure-units`, `measure-clear`, `measure-config` (`{profile?, baseSurface?, density?, swell?, shrink?, deadband?}`), `measure-flat-target-plane` (`{flat}`). One payload contract everywhere: `{ layer, target, feature, featureId, coordinate }`.
43
+ - `<om-behavior on="click|hover|drag|load|data-loaded" layer="..." action="...">` — declarative interaction. Built-in actions: `show-overlay`, `hide-overlay`, `show-tooltip`, `hide-tooltip`, `toggle-layer`, `set-pickable` (`{layer, pickable: true|false|"3d"}` — runtime picking/popup toggle, story-capturable; the per-layer popup on/off switch a viewer-facing export needs), `filter-layer`, `highlight-feature`, `zoom-to-feature`, `set-basemap`, `undo`, `redo`; scene/tool actions `set-lighting`, `set-effect` (`{preset}` — swap a post-process finish; see the effects bullet), `set-terrain`, `set-clip-box` (`{min,max,invert?,highlight?}` / `{clear:true}`), `clip-box-edit` (`{editing}`), `export-region-3d` (`{target?, format?:"glb"|"b3dm"}` — what the draw widget's `export-3d` button emits), the draw actions `draw-mode` (`{target?:"sketch", mode:"point"|"line"|"polygon"|null}` — null exits drawing), `draw-commit`, `draw-cancel`, `draw-delete` (removes the last shape), `draw-clear`, `draw-config` (`{target?, autosave?, fillColor?, lineColor?}`) and `draw-save` (`{target?, format?:"download"|"file-system"|"both"}`) — every one of these drives the same store a `data="draw:<target>"` layer reads, so a custom toolbar can replace `<om-widget type="draw">` entirely; and the measure actions `measure-mode` (`{mode:"distance"|"area"|"volume"|null}`), `measure-units`, `measure-clear`, `measure-config` (`{profile?, baseSurface?, density?, swell?, shrink?, deadband?}`), `measure-flat-target-plane` (`{flat}`). One payload contract everywhere: `{ layer, target, feature, featureId, coordinate }`.
44
44
  - Undo/redo is built in: user-facing manifest changes (layer toggles, filter changes, basemap switches, element add/remove, drawn sketches) are recorded automatically — the manifest is the state. `<om-widget type="undo-redo">` renders the buttons; Cmd/Ctrl-Z, Shift-Cmd/Ctrl-Z, and Ctrl-Y work on any map (text inputs keep their native undo). Camera moves, hover effects, and story playback are deliberately NOT undo steps. Widget scripts: `ctx.history.canUndo/canRedo` with watch token `history`; `ctx.emit("undo")`/`ctx.emit("redo")`.
45
45
  - `<om-fallback>` — static no-JS fallback, direct child of `<om-map>` (one per map, no attributes, plain HTML content — links allowed). Shown ONLY where scripts never run (chat-app/email file previews — iOS QuickLook renders HTML attachments with JS off — file managers, sandboxed webviews); hidden automatically once the map boots. GOOD PRACTICE: include one on every complete page, especially pages that may be shared as a file. To PRODUCE a shareable single file, `npx @nika-js/onlymap export map.html` embeds every relative data/src/scenegraph URL as a data: URL (format detection preserved — the original extension rides a #name.ext fragment), pins relative library refs to the CDN, adds a generic om-fallback when missing, and warns when embedded data is heavy (>1 MB per file / >5 MB total) or when a source cannot be embedded (shapefile sidecars, COG Range streams, Zarr directories, {z}/{x}/{y} templates — those need hosting) ("This interactive map requires JavaScript — open this file in a web browser", plus a hosted-version link when one exists). Without one, the stylesheet shows a generic text-only banner. The gate is pure CSS (`om-map:not(:defined)` in onlymapjs.css) refined by the `scripting` media feature on 2023+ engines: with scripting DISABLED the fallback shows instantly; with scripting ENABLED it never flashes during a slow load and only surfaces after a ~4s grace with load-failure wording (blocked/unreachable bundle). The CSS must load without JS — a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages; a bundler-emitted stylesheet is fine in npm projects.
46
46
  - PRINT LAYOUTS (`@nika-js/onlymap/cartograph`, separate lazy entry — the core bundle does not grow): `<om-cartograph size="A3" orientation="landscape">` is a standalone page measured in MILLIMETRES carrying `<om-frame>`s (live `<om-map>` with the frame's own camera, or `mode="static"` georeferenced rasters placed by `crs`+`corners`) plus cartographic furniture: `<om-legend for="...">` (rows DERIVED from the live map's own symbology incl. classified breaks; author literal `<om-legend-row>`s with `derived="false"`), `<om-scalebar>` (metric|imperial|nautical), `<om-north>`, `<om-graticule>` (4326/3857/UTM), `<om-shape>`, `<om-image>`, `<om-text>` with `{{title}}`/`{{date}}`/`{{frame.<id>.scale}}`/`{{atlas.<field>}}` tokens. `overview-of="<frame-id>"` draws a locator inset's footprint. A live frame georeferences whatever its map shows: zoomed out past the whole world, the map wraps inside the frame like any web map (the graticule labels each copy, the scale bar measures its own row) — the frame never limits or changes the camera, and once the map inside it settles after a pan/rotate/tilt the frame's georeference follows the map's own view, so north arrow, scale bar, graticule, locator and `{{frame.<id>.scale}}` describe what is on screen (and a freeze captures that view). `max-pitch` and `min-zoom` on `<om-map>` exist as author-set controls for kiosk-style maps and are never applied automatically. `<om-atlas for="<frame-id>" layer="<layer-id>">` renders one page per feature (sequentially through ONE live map — WebGL context limits make cloned pages fail at scale) and exports a ZIP. Print via `page.print()` or `?print=1` (true page size via @page; live frames swap to print-DPI captures first), PNG via `renderCartograph(page, {dpi})` or `?export=png&dpi=300`. `bleed`/`crop-marks`/`safe-zone` (screen-only guide)/`flatten` are press-shop attributes; `cvd="deuteranopia|protanopia|tritanopia|achromatopsia"` simulates colour-vision deficiencies page-wide and `lintLegendColours()` flags collapsing palettes. Free plan: a small foot credit is injected — suppressed by any authored `om-text` crediting OnlyMap, or by a paid key on a live frame's map. Deep reference: docs/cartograph.md.
47
+ - POST-PROCESS EFFECTS: `<om-effect>` children of `<om-map>` ARE deck's `effects` array — document order is pipeline order. Three lanes, exactly one per element: `preset="vintage|engraved|night|blueprint|riso|newsprint|muted"` (a named finish; override one knob with `<op>-<param>`, e.g. `grain-amount="0.02"`, or get the preset as markup from `OmMap.expandPreset(name)`); `op="tint|levels|saturation|posterize|vignette|grain|edges|blur|sharpen|halftone"` with that op's knobs as attributes; or an inline `<script type="application/json">` luma ShaderModule passed to deck untouched (raw GLSL, multi-pass). Spatial knobs are MILLIMETRES (`size="0.12mm"`) and resolve against the live pixel density, so a look keeps its physical size at print DPI — a pixel value is a validation error. Consecutive pointwise ops compile into ONE pass; only neighbourhood ops (edges/blur/sharpen/halftone) cost a pass each. A preset is literally a saved op list. `set-effect {preset}` swaps it live by writing the document (undoable; NOT story-rewindable yet — a step can apply it, but `seek()` back will not remove it, because rewind restores `<om-map>` attributes and this adds a child element). Programmatic twin: `MapController.setEffects(effects | null)` hands deck `Effect` instances directly and outranks the document's chain while set. Deep reference: docs/effects.md. CAVEAT: a pass runs over deck's framebuffer, so with a MapLibre basemap the basemap underneath is untouched — the validator warns and suggests `basemap="none"` with the base drawn as layers.
47
48
  - Animation: `transition="get-fill-color 800ms, get-radius 400ms"` on a layer GPU-animates prop changes (also smooths streaming updates via `get-position`). Camera: the `fly-to` action takes `center`/`zoom`/`pitch`/`bearing`/`duration` (e.g. `duration="2s"`) — use it in behaviors or `data-emit` buttons; `zoom-to-feature` also accepts `duration`.
48
49
  - Pull-model frame rendering (external video frameworks such as Remotion): mark the map `data-om-recording` (the determinism switch — instant camera, no transitions/gesture interrupts, byte-stable `snapshot()`), then per frame `story.seek(t, {interpolateCamera: true})` + `await mapEl.whenSettled()` + capture; the same frame is byte-identical across processes and orderings. Story effect verbs (fade/pulse/trace/populate) evaluate as pure functions of story time under the switch — a seek landing mid-trace renders the half-drawn outline; only effects dispatched OUTSIDE a story (behaviors, ctx.emit) snap to their end state. `onlymapjs record` remains the built-in push-model path; `@nika-js/onlymap-remotion` packages the pull-model path for Remotion.
49
50
  - Travel-map animation: a `trace` story step takes `follow` (camera rides the drawing tip along the path) and `easing="linear|ease-in|ease-out|ease-in-out"`; combine with a TripsLayer route + pins toggled by later steps, and export with `npx onlymapjs record`.
@@ -301,6 +301,163 @@
301
301
  }
302
302
  ]
303
303
  },
304
+ {
305
+ "name": "om-effect",
306
+ "description": "One entry in deck's effects array, as markup — a post-process pass over the rendered frame. Document order is pipeline order. Declare exactly one of: preset (a named look), op (one named operation), or an inline <script type=\"application/json\"> luma ShaderModule for raw GLSL.",
307
+ "attributes": [
308
+ {
309
+ "name": "preset",
310
+ "description": "A named look, expanded to its ops. Tune one knob with <op>-<param> (e.g. grain-amount), or eject it into markup with OmMap.expandPreset(name).",
311
+ "values": [
312
+ {
313
+ "name": "vintage"
314
+ },
315
+ {
316
+ "name": "engraved"
317
+ },
318
+ {
319
+ "name": "night"
320
+ },
321
+ {
322
+ "name": "blueprint"
323
+ },
324
+ {
325
+ "name": "riso"
326
+ },
327
+ {
328
+ "name": "newsprint"
329
+ },
330
+ {
331
+ "name": "muted"
332
+ }
333
+ ]
334
+ },
335
+ {
336
+ "name": "op",
337
+ "description": "One named operation; its knobs are this element's other attributes.",
338
+ "values": [
339
+ {
340
+ "name": "tint",
341
+ "description": "Duotone: pull the image toward ink-on-paper. `keep-color` lets saturated marks (the data) resist, so the base goes monochrome while the symbology stays readable."
342
+ },
343
+ {
344
+ "name": "levels",
345
+ "description": "Brightness, contrast and gamma, in that order — the usual tonal trim."
346
+ },
347
+ {
348
+ "name": "saturation",
349
+ "description": "0 is greyscale, 1 unchanged, above 1 boosts. Useful on its own to check a sheet survives photocopying."
350
+ },
351
+ {
352
+ "name": "posterize",
353
+ "description": "Quantise each channel to N steps — a screen-print/riso flatness."
354
+ },
355
+ {
356
+ "name": "vignette",
357
+ "description": "Darken toward the corners. Keyed to the FRAME, not the map, so it is a property of the plate rather than of the ground it shows."
358
+ },
359
+ {
360
+ "name": "grain",
361
+ "description": "Paper grain. `size` is the grain cell in millimetres, so it stays the same physical texture at any export resolution."
362
+ },
363
+ {
364
+ "name": "edges",
365
+ "description": "Ink the edges Sobel finds, in millimetres of line width — an engraved or pen-drawn register."
366
+ },
367
+ {
368
+ "name": "blur",
369
+ "description": "Gaussian-ish softening, radius in millimetres. Pair with `sharpen` for a printed-then-scanned register."
370
+ },
371
+ {
372
+ "name": "sharpen",
373
+ "description": "Unsharp mask — puts a crisp edge back on a plate that has been softened or downsampled."
374
+ },
375
+ {
376
+ "name": "halftone",
377
+ "description": "Screen the image into dots on a rotated grid, cell size in millimetres. Keeps each cell's own hue rather than going mono, so a thematic map stays readable."
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ "name": "uniforms",
383
+ "description": "JSON uniform values for an inline shader module. Ignored by the preset and op lanes."
384
+ },
385
+ {
386
+ "name": "paper",
387
+ "description": "The light end of the duotone. Valid on: tint, halftone. On a preset, spell it <op>-paper."
388
+ },
389
+ {
390
+ "name": "ink",
391
+ "description": "The dark end of the duotone. Valid on: tint. On a preset, spell it <op>-ink."
392
+ },
393
+ {
394
+ "name": "amount",
395
+ "description": "0 leaves the image alone, 1 is full duotone. Valid on: tint, saturation, vignette, grain, edges, sharpen, halftone. On a preset, spell it <op>-amount."
396
+ },
397
+ {
398
+ "name": "keep-color",
399
+ "description": "How strongly saturated pixels resist the duotone. 0 tints everything; 1 keeps vivid marks. Valid on: tint. On a preset, spell it <op>-keep-color."
400
+ },
401
+ {
402
+ "name": "brightness",
403
+ "description": "Added after contrast; -1 to 1. Valid on: levels. On a preset, spell it <op>-brightness."
404
+ },
405
+ {
406
+ "name": "contrast",
407
+ "description": "1 leaves the image alone. Valid on: levels. On a preset, spell it <op>-contrast."
408
+ },
409
+ {
410
+ "name": "gamma",
411
+ "description": "Above 1 lifts midtones, below 1 deepens them. Valid on: levels. On a preset, spell it <op>-gamma."
412
+ },
413
+ {
414
+ "name": "levels",
415
+ "description": "Steps per channel; 2 or more. Valid on: posterize. On a preset, spell it <op>-levels."
416
+ },
417
+ {
418
+ "name": "radius",
419
+ "description": "Where the falloff starts; 0 centre, 1 corner. Valid on: vignette, blur, sharpen. On a preset, spell it <op>-radius."
420
+ },
421
+ {
422
+ "name": "softness",
423
+ "description": "How gradually it arrives. Valid on: vignette. On a preset, spell it <op>-softness."
424
+ },
425
+ {
426
+ "name": "size",
427
+ "description": "Grain cell size in mm. In MILLIMETRES (e.g. 0.12mm), so it keeps its physical size at any export resolution. Valid on: grain. On a preset, spell it <op>-size."
428
+ },
429
+ {
430
+ "name": "seed",
431
+ "description": "Any number; the same seed gives the same grain. Valid on: grain. On a preset, spell it <op>-seed."
432
+ },
433
+ {
434
+ "name": "mono",
435
+ "description": "1 is luminance noise, 0 is per-channel colour noise. Valid on: grain. On a preset, spell it <op>-mono."
436
+ },
437
+ {
438
+ "name": "width",
439
+ "description": "Sampling radius in mm — the ink's weight. In MILLIMETRES (e.g. 0.12mm), so it keeps its physical size at any export resolution. Valid on: edges. On a preset, spell it <op>-width."
440
+ },
441
+ {
442
+ "name": "color",
443
+ "description": "Ink colour. Valid on: edges. On a preset, spell it <op>-color."
444
+ },
445
+ {
446
+ "name": "cell",
447
+ "description": "Screen cell size in mm. In MILLIMETRES (e.g. 0.12mm), so it keeps its physical size at any export resolution. Valid on: halftone. On a preset, spell it <op>-cell."
448
+ },
449
+ {
450
+ "name": "angle",
451
+ "description": "Screen angle in degrees. Valid on: halftone. On a preset, spell it <op>-angle."
452
+ }
453
+ ],
454
+ "references": [
455
+ {
456
+ "name": "README",
457
+ "url": "https://github.com/NikaGeospatial/onlymapjs/blob/main/README.md"
458
+ }
459
+ ]
460
+ },
304
461
  {
305
462
  "name": "om-layer",
306
463
  "description": "A deck.gl layer declared as markup — attributes map to props (kebab-case), get-* attributes compile as accessors.",
@@ -1975,6 +2132,9 @@
1975
2132
  {
1976
2133
  "name": "set-basemap"
1977
2134
  },
2135
+ {
2136
+ "name": "set-effect"
2137
+ },
1978
2138
  {
1979
2139
  "name": "set-lighting"
1980
2140
  },
@@ -2580,6 +2740,9 @@
2580
2740
  {
2581
2741
  "name": "set-basemap"
2582
2742
  },
2743
+ {
2744
+ "name": "set-effect"
2745
+ },
2583
2746
  {
2584
2747
  "name": "set-lighting"
2585
2748
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.8.4",
3
+ "version": "0.9.0",
4
4
  "description": "Declarative deck.gl maps for HTML and React \u2014 interactive WebGL mapping with GeoJSON/CSV/Arrow data, MapLibre basemaps, widgets, popups, and live streams from a custom-element manifest or typed React components. TypeScript, no build step.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "publishConfig": {
@@ -123,8 +123,8 @@
123
123
  "build:types": "tsc -p tsconfig.build.json --emitDeclarationOnly",
124
124
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.e2e.json --noEmit && tsc -p cloud/workers/telemetry/tsconfig.json && tsc -p cloud/workers/examples/tsconfig.json",
125
125
  "test": "vitest run",
126
- "comment:e2e-smoke": "Release gate for rendered-pixel guarantees the unit suite can't see: the license-condition badge chrome (a red badge e2e shipped across 0.6.24 AND 0.6.25 because only vitest gated publish) frame determinism, and a cartograph frame's camera limits on the REAL renderers (0.8.1 and 0.8.2 both shipped a tilt cap that unit tests passed and MapLibre never received). Deliberately tiny \u2014 the full e2e suite stays a manual/CI concern.",
127
- "test:e2e:smoke": "playwright test e2e/deterministic-frames.spec.ts && playwright test e2e/examples.spec.ts -g \"attribution badge\" && playwright test e2e/cartograph-limits.spec.ts",
126
+ "comment:e2e-smoke": "Release gate for rendered-pixel guarantees the unit suite can't see: the license-condition badge chrome (a red badge e2e shipped across 0.6.24 AND 0.6.25 because only vitest gated publish) frame determinism, a cartograph frame's camera limits on the REAL renderers, and that a generated post-process shader actually compiles and keeps its millimetre knobs at print resolution (0.8.1 and 0.8.2 both shipped a tilt cap that unit tests passed and MapLibre never received). Deliberately tiny \u2014 the full e2e suite stays a manual/CI concern.",
127
+ "test:e2e:smoke": "playwright test e2e/deterministic-frames.spec.ts && playwright test e2e/examples.spec.ts -g \"attribution badge\" && playwright test e2e/cartograph-limits.spec.ts && playwright test e2e/effects.spec.ts",
128
128
  "prepublishOnly": "node dev/tools/announce-release.mjs --check && npm run build && npm run test:e2e:smoke",
129
129
  "postpublish": "node dev/tools/announce-release.mjs",
130
130
  "try": "vite-node dev/expr-repl.mjs",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: onlymapjs
3
- description: Build, edit, debug, or review OnlyMapJS declarative HTML maps and dashboards, or React maps via the @nika-js/onlymap/react adapter. Use when a user asks for an interactive map, deck.gl-style visualization, geospatial dashboard, live fleet/telemetry map, choropleth, popup/tooltip map, map story/tour, manual drawing/sketch map, 3D map assets, a React map component, a map page shared as a single HTML file (incl. no-JS fallbacks for chat/email previews), a print-ready map sheet / PDF map / atlas (the cartograph entry: mm-based pages, frames, derived legends, scale bars, graticules), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a Remotion map video or programmatic map flyover with overlays (route to the separate @nika-js/onlymap-remotion package), a React Native or Expo mobile map (route to the separate @nika-js/onlymap-native package), or help with OnlyMapJS syntax, validation, widgets, data formats, testing, or publishing examples.
3
+ description: Build, edit, debug, or review OnlyMapJS declarative HTML maps and dashboards, or React maps via the @nika-js/onlymap/react adapter. Use when a user asks for an interactive map, deck.gl-style visualization, geospatial dashboard, live fleet/telemetry map, choropleth, popup/tooltip map, map story/tour, manual drawing/sketch map, 3D map assets, a React map component, a map page shared as a single HTML file (incl. no-JS fallbacks for chat/email previews), a print-ready map sheet / PDF map / atlas (the cartograph entry: mm-based pages, frames, derived legends, scale bars, graticules), a styled/post-processed map look (film grain, halftone, duotone, vintage or printed finish, bloom-style passes — the <om-effect> pipeline), a responsive/mobile map whose controls auto-fold on narrow screens, auditing a map's widget layout with the check-layout tool, syncing OnlyMapJS map/camera state into an app state store (Redux, MobX, Zustand, Jotai — the getStore contract), BIM/IFC models (loading .ifc files in the browser, 3D Tiles per-element picking, isolate/hide/ghost, clash detection, model federation), routes and directions (a styled A-to-B route line, OSRM or another routing engine, click-to-route), live vehicle/rider/delivery tracking (a moving marker gliding between GPS fixes with a follow camera), a Remotion map video or programmatic map flyover with overlays (route to the separate @nika-js/onlymap-remotion package), a React Native or Expo mobile map (route to the separate @nika-js/onlymap-native package), or help with OnlyMapJS syntax, validation, widgets, data formats, testing, or publishing examples.
4
4
  ---
5
5
 
6
6
  # OnlyMapJS
@@ -23,7 +23,7 @@ Use OnlyMapJS as a declarative HTML map library. Write custom elements such as `
23
23
  </script>
24
24
  ```
25
25
 
26
- For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.8.4` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.8.4/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
26
+ For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.9.0` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.9.0/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
27
27
 
28
28
  ## React Projects
29
29
 
@@ -71,6 +71,7 @@ Load the smallest reference needed for the task:
71
71
  - UI panel, control, chart, legend, stats, filter, or draw toolbar -> `<om-widget>`.
72
72
  - Sparse rich HTML at one geographic location -> `<om-overlay>`.
73
73
  - Many labels/badges -> `<om-layer type="PopupLayer">`.
74
+ - A styled look for the whole map (vintage / printed / risograph / newsprint / night plate, film grain, halftone, duotone) -> `<om-effect>` children of `<om-map>`: `preset="vintage|engraved|night|blueprint|riso|newsprint|muted"`, or `op=` with knobs, in document order. Spatial knobs are MILLIMETRES, never px. See references/syntax.md.
74
75
  - Guided tour or narrative sequence -> `<om-story>` with `<om-step>` siblings that reference existing layers/overlays by id.
75
76
  - Basemap choice or user-switchable basemaps -> `basemap` presets (`positron`, `liberty`, `dark-matter`, `osm`, ...) + `<om-widget type="basemap-switcher">`; MapTiler custom styles via a style URL or `basemap-key`.
76
77
  - Undoable UI (step back after layer toggles, filter changes, basemap switches, sketch edits) -> `<om-widget type="undo-redo">`; Cmd/Ctrl-Z works even without the widget. Camera moves and story playback are not undo steps.
@@ -16,8 +16,8 @@ Vite/npm project:
16
16
  Static CDN page (raw-file CDNs only — unpkg/jsDelivr; never esm.sh or another rebundling CDN, which duplicates the WebGL runtime and breaks layer shaders):
17
17
 
18
18
  ```html
19
- <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.8.4/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.8.4"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.9.0/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.9.0"></script>
21
21
  ```
22
22
 
23
23
  Always include `onlymapjs.css` — it carries the MapLibre basemap styles and the no-JS fallback rules (`<om-fallback>` / default banner). For the fallback to work in script-disabled previews it must load without JavaScript: a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages (a bundler-emitted stylesheet is fine in npm projects).
@@ -44,6 +44,11 @@ Common attributes:
44
44
  - `license-key="om_live_…"` — lifts the free-plan limits (5 layers, 25k rows per layer — a layer past the layer cap doesn't render, a layer past the row cap renders its first 25k rows plus a dismissible on-map notice; caps apply only on HOSTED http(s) pages — localhost/file:// and other dev contexts run uncapped, badge stays) and removes the corner badge; publishable origin-restricted token, safe in page source (or `OmMap.configureLicense(key)` once). Free-plan violations don't break the map: the offending layer isn't rendered and validation names the limit. Badge removal is a permission, not a requirement — `keep-badge` on `<om-map>` (or `OmMap.setKeepBadge(true)`) keeps it on a paid plan, rendering the credit without the free-tier license sentence; on the free plan it changes nothing. The preference is page-level and live (editable after boot), and a sheet's foot credit follows it; `<om-cartograph keep-badge>` opts one in on its own, for a static sheet with no map runtime.
45
45
  - `terrain="terrarium|<preset>|<{z}/{x}/{y} DEM URL>|off"` — 3D elevation surface. `terrarium` is keyless (AWS); `mapterhorn` is also keyless and carries a CARTO Positron drape by default; `maptiler-terrain` needs `basemap-key`/`configureBasemap`; raw DEM URLs need `terrain-decoder` (`terrarium`, `mapbox-rgb`, or `{rScaler,gScaler,bScaler,offset}` JSON). `terrain-exaggeration` scales relief (1 = true); `terrain-max-zoom` = the provider's REAL tileset cap; `terrain-texture` drapes a `{z}/{x}/{y}` imagery template. Geographic layers drape automatically; per-layer `terrain="drape|offset|off"` overrides (3D-model layers default to `offset`). Terrain REPLACES an active basemap while on (restored when off) — validation warns. Register presets with `OmMap.registerTerrain(name, {...})`; `set-terrain` action + `terrain` watch token; attribute-backed (undoable). **BIM requires explicit terrain**: a model that resolves real elevation on a map with no `terrain` attribute raises an ERROR through the validation channel at load time — the library never writes `terrain` for you; author a preset (`mapterhorn` pairs a keyless DEM with a CARTO drape) or an explicit `terrain="off"` for flat-ground siting.
46
46
  - `lighting="daylight|studio|flat|custom"` — scene lighting for 3D content (extruded polygons, models); absent = deck defaults. Preset seeds values; `lighting-ambient`, `lighting-sun` (intensity; 0 removes the sun), `lighting-sun-azimuth` (° CW from north), `lighting-sun-elevation` (° above horizon), `lighting-camera` (model-inspection fill) override individual fields; `lighting-sun-date` (ISO 8601 or epoch ms) computes the sun from solar position at the map center and wins over azimuth/elevation. Attribute-backed: changes are undoable, and the `set-lighting {lighting, sunAzimuth, …}` action makes lighting story-steppable (`lighting="default"` removes the whole attribute set; a bare preset is a clean reset). `<om-widget type="lighting">` is the native UI. Widget scripts can `watch = ["lighting"]`.
47
+ - POST-PROCESS FINISHES (core `<om-map>`, no extra entry point needed) are `<om-effect>` children of `<om-map>`, which ARE deck's `effects` array (document order = pipeline order). Exactly one lane per element:
48
+ - `preset="vintage|engraved|night|blueprint|riso|newsprint|muted"` — a named look. Override one knob with `<op>-<param>` (`grain-amount="0.02"`); get the preset as editable markup with `OmMap.expandPreset(name)`.
49
+ - `op="tint|levels|saturation|posterize|vignette|grain|edges|blur|sharpen|halftone"` — one operation, its knobs as attributes.
50
+ - an inline `<script type="application/json">` luma ShaderModule — raw GLSL, multi-pass, passed to deck untouched.
51
+ Spatial knobs are MILLIMETRES (`size="0.12mm"`): they resolve against the live pixel density so a look keeps its physical size at print DPI, and a pixel value is a validation error. A preset is literally a saved op list. `set-effect {preset}` swaps it live and writes the document. With a MapLibre basemap the basemap is composited underneath and stays untreated — the validator warns.
47
52
  - `clip-box-min="[lng, lat, elevation]"` + `clip-box-max="[lng, lat, elevation]"` (issue #34) — a real axis-aligned 3D box clipping the whole scene: geometry outside it is discarded (order of the two corners doesn't matter). Every layer is clipped once a box is configured; opt a specific layer out with `clip="off"` on its `<om-layer>`. `clip-box-invert` shows what's OUTSIDE the box instead; `clip-box-highlight` dims clipped-out geometry instead of discarding it (non-destructive preview — nothing disappears). Works on ANY layer type, including georeferenced `Tile3DLayer`/`BIMLayer` content, so a dense BIM scene can be cut open to see what's inside — not just flat `GeoJsonLayer` extrusions. Attribute-backed (undoable, story-steppable) via `set-clip-box {min, max, invert?, highlight?}` (`{clear: true}` removes the box) and `<om-widget type="clip-box">` (six number inputs + invert/highlight checkboxes + clear button). v1 is axis-aligned only — rotated boxes are a documented follow-up.
48
53
  - `snap="vertex edge midpoint"` + `snap-tolerance="12"` (issue #34 Part A) — XY snapping for draw/measure vertex capture: refines whatever deck already picked under the cursor to the nearest vertex, edge, or edge midpoint of THAT feature's own geometry, within `snap-tolerance` pixels (default 12) — not a spatial index, only the already-picked feature is searched. Applies to every layer by default; `snap="off"` on any `<om-layer>` opts it out, mirroring `clip="off"`. Also snaps to a `BIMLayer`'s own edge/crease overlay (its real wall corners/edges, converted from local mesh coordinates automatically) — the raw triangle mesh itself is not a snap target. Vertex beats midpoint beats edge on range conflicts. Hold Space to place a point nearby without snapping. No action/attribute-backed toggle beyond the attribute itself; live-reactive like `terrain`/`clip-box-*`.
49
54
  - `widgets-dim="off"` disables collision-dim — by default a widget slot dims (`--om-widget-opacity-dimmed`, 0.35) while an open `<om-overlay>` popup covers it, rather than the popup dodging (attribution/toggle slots never dim).
@@ -640,6 +645,7 @@ A separate lazy entry (`import "@nika-js/onlymap/cartograph"`; CDN: `https://unp
640
645
  ```
641
646
 
642
647
  - Frames: live (`<om-map>` child, the FRAME's camera attributes win) or `mode="static"` with `crs` + `corners` for a georeferenced raster. `overview-of="<frame-id>"` draws a locator footprint.
648
+
643
649
  - A live frame georeferences whatever its map shows. Zoomed out past the whole world, the map wraps inside the frame like any web map — the graticule labels each copy by where it is on the globe, and the scale bar measures its own row — and the frame never limits or rewrites the camera. Once the map inside a frame settles after a pan, rotate or tilt, the frame's georeference follows the map's own view: north arrow, scale bar, graticule, locator inset and `{{frame.<id>.scale}}` describe what is on screen, and freezing captures that view. `max-pitch` and `min-zoom` on `<om-map>` are author-set controls (a kiosk map that should stay upright or within an area); nothing sets them for you.
644
650
  - `<om-legend for>` derives rows from the live map's own symbology (classified breaks included); literal rows via `derived="false"` + `<om-legend-row>` children.
645
651
  - `<om-atlas for="<frame-id>" layer="<layer-id>">` renders one page per feature sequentially and exports a ZIP.
@@ -682,6 +688,7 @@ Common built-in actions:
682
688
  - `show-overlay`, `hide-overlay`
683
689
  - `show-tooltip`, `hide-tooltip`
684
690
  - `toggle-layer`
691
+ - `set-effect` — payload `{ preset }` (a preset name, or `"none"` to remove it); optional `<op>-<param>` knob overrides, e.g. `{ preset: "vintage", "grain-amount": 0.02 }`. Writes one `<om-effect preset>` child, so it is undoable; NOT story-rewindable yet (rewind restores `<om-map>` attributes, this adds an element). A hand-composed op chain is left alone.
685
692
  - `set-pickable` — payload `{ layer, pickable: true|false|"3d" }`; writes/removes the layer's `pickable` attribute at runtime (turns popups/tooltips/hover behaviors on or off per layer — the viewer-facing popup toggle), story-capturable and undoable
686
693
  - `highlight-feature` — sets the layer's `highlighted-id`; style the selection with `highlight-color="[220, 38, 38, 255]"` (or hex) on the `<om-layer>` — a constant color, not a `get-*` accessor
687
694
  - `zoom-to-feature`