@nika-js/onlymap 0.7.5 → 0.8.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 (70) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +4 -2
  3. package/dist/{LercDecode.es-DYwn8YTS.js → LercDecode.es--DH6_OFE.js} +1 -1
  4. package/dist/{basemap-CtEc5BCi.js → basemap-2ZZ_9gFn.js} +528 -502
  5. package/dist/basemap.d.ts +15 -0
  6. package/dist/cartograph/api.d.ts +45 -0
  7. package/dist/cartograph/atlas.d.ts +50 -0
  8. package/dist/cartograph/core-loader.d.ts +35 -0
  9. package/dist/cartograph/cvd.d.ts +106 -0
  10. package/dist/cartograph/element-base.d.ts +26 -0
  11. package/dist/cartograph/elements/om-atlas.d.ts +47 -0
  12. package/dist/cartograph/elements/om-cartograph.d.ts +76 -0
  13. package/dist/cartograph/elements/om-frame.d.ts +111 -0
  14. package/dist/cartograph/elements/om-graticule.d.ts +24 -0
  15. package/dist/cartograph/elements/om-image.d.ts +12 -0
  16. package/dist/cartograph/elements/om-legend.d.ts +16 -0
  17. package/dist/cartograph/elements/om-north.d.ts +11 -0
  18. package/dist/cartograph/elements/om-scalebar.d.ts +13 -0
  19. package/dist/cartograph/elements/om-shape.d.ts +16 -0
  20. package/dist/cartograph/elements/om-text.d.ts +9 -0
  21. package/dist/cartograph/georef.d.ts +126 -0
  22. package/dist/cartograph/graticule.d.ts +70 -0
  23. package/dist/cartograph/html-data.d.ts +27 -0
  24. package/dist/cartograph/index.d.ts +1 -0
  25. package/dist/cartograph/layout.d.ts +23 -0
  26. package/dist/cartograph/legend.d.ts +75 -0
  27. package/dist/cartograph/live-frame.d.ts +69 -0
  28. package/dist/cartograph/paint.d.ts +54 -0
  29. package/dist/cartograph/refs.d.ts +33 -0
  30. package/dist/cartograph/render.d.ts +64 -0
  31. package/dist/cartograph/scalebar.d.ts +91 -0
  32. package/dist/cartograph/schema.d.ts +38 -0
  33. package/dist/cartograph/standalone.d.ts +1 -0
  34. package/dist/cartograph/textlayout.d.ts +45 -0
  35. package/dist/cartograph/tokens.d.ts +45 -0
  36. package/dist/cartograph/url-actions.d.ts +26 -0
  37. package/dist/cartograph/validate.d.ts +38 -0
  38. package/dist/cartograph/zip.d.ts +22 -0
  39. package/dist/cartograph.css +1 -0
  40. package/dist/cartograph.js +2768 -0
  41. package/dist/cartograph.standalone.js +7640 -0
  42. package/dist/crs-DsDQ4Q4i.js +71 -0
  43. package/dist/download.d.ts +6 -0
  44. package/dist/feature-access.d.ts +14 -0
  45. package/dist/field-access.d.ts +1 -10
  46. package/dist/{geoparquet-RBC0ZJNm.js → geoparquet-DDZzee5Z.js} +1 -1
  47. package/dist/{index-DkimKgOm.js → index-BGOblzWN.js} +5141 -5070
  48. package/dist/index-CcLC9jE5.js +4798 -0
  49. package/dist/{index-CiGUw6GD.js → index-CeoVzd6t.js} +1 -1
  50. package/dist/{index-CJ0pib8I.js → index-Cz1VsWzO.js} +2 -2
  51. package/dist/{index-Bwu1DFHP.js → index-DkxFFflv.js} +1 -1
  52. package/dist/{index-HrEJtZoQ.js → index-DphcuoPv.js} +1 -1
  53. package/dist/index.d.ts +1 -1
  54. package/dist/{lerc-BIQMg0FV.js → lerc-D7TfTy6l.js} +2 -2
  55. package/dist/onlymap.standalone.js +8827 -8730
  56. package/dist/onlymapjs.js +12 -11
  57. package/dist/{raster-Dsugvobw.js → raster-D_3YKFZz.js} +3 -3
  58. package/dist/{raster-pipeline-rqJJRCEo.js → raster-pipeline-D1yeoJo2.js} +1 -1
  59. package/dist/runtime-core.d.ts +30 -0
  60. package/dist/snapshot.d.ts +17 -0
  61. package/dist/units.d.ts +9 -0
  62. package/dist/version.d.ts +1 -1
  63. package/dist/{zarr-CRysSFhD.js → zarr-DH5Ntt5U.js} +2 -2
  64. package/docs/cartograph.md +396 -0
  65. package/llms.txt +2 -1
  66. package/onlymapjs.attributes.json +1 -0
  67. package/onlymapjs.html-data.json +974 -0
  68. package/package.json +13 -2
  69. package/skills/onlymapjs/SKILL.md +2 -2
  70. package/skills/onlymapjs/references/syntax.md +28 -2
package/CHANGELOG.md CHANGED
@@ -8,6 +8,24 @@ Note: npm collapsed a few closely-spaced releases — the GPX/FlatGeobuf (0.5.4)
8
8
  and GeoParquet (0.5.5) work shipped to npm together as **0.5.6**, so npm's
9
9
  version list jumps 0.5.3 → 0.5.6. Each logical version is listed here regardless.
10
10
 
11
+ ## 0.8.0 — 2026-09-11
12
+
13
+ ### Added
14
+ - **Cartograph: print-quality map layouts as HTML.** The new `@nika-js/onlymap/cartograph` entry renders standalone pages measured in millimetres — `<om-cartograph>` holding live or georeferenced-image `<om-frame>`s plus cartographic furniture: `<om-legend>` (derived from the live map's own symbology, including data-computed class breaks), `<om-graticule>`, `<om-scalebar>`, `<om-north>`, `<om-shape>`, `<om-text>`, `<om-image>`. Frames carry their own cameras, exports capture at true print resolution (300 dpi PNG or PDF at exact page size), and print-shop attributes (bleed, crop marks, safe zone, flatten) make the output press-ready. It is a separate lazy entry: the core bundle does not grow, and a static-only sheet never loads the map runtime. Guide: `docs/cartograph.md`. (#41)
15
+ - **Atlas: one page per feature.** `<om-atlas>` steps a cartograph through a layer's features — one sheet each, rendered sequentially through a single live map (so a hundred-page atlas can't exhaust the browser's WebGL contexts) — and exports the run as one ZIP. (#41)
16
+ - **Colour-vision checking.** `cvd="deuteranopia"` (and three more) simulates colour-vision deficiency across the whole page before it is printed, and the validator flags legend palettes that collapse under them. (#41)
17
+
18
+ ### Changed
19
+ - **Free-plan cartographs carry a small foot credit** ("Built with OnlyMap by NIKA · free for non-commercial use") in print and export — the page counterpart of the map badge. Author your own OnlyMap credit in any text block and the injected one stays away; a paid key on a live frame's map removes it entirely. (#41)
20
+
21
+ ## 0.7.6 — 2026-09-11
22
+
23
+ ### Added
24
+ - **Recolour a 3D model from your data.** `ScenegraphLayer` takes `color="#22c55e"` for a flat tint, and `get-color="$status_color"` to tint each instance from a field — so one GLB can serve a whole fleet in red/amber/green instead of a separate tinted model file per state. The tint multiplies over the model's own texture and material rather than replacing them, so shading and detail survive. (`get-color` already worked but was undocumented; the `color` shorthand is new.)
25
+
26
+ ### Changed
27
+ - **`color` on a `ScenegraphLayer` now tints the model, not just the legend.** It used to set the legend swatch alone. Remove it if you want the model's own colours left untouched; when both are set, `get-color` still wins.
28
+
11
29
  ## 0.7.5 — 2026-09-11
12
30
 
13
31
  ### Added
package/README.md CHANGED
@@ -72,7 +72,7 @@ Or with no build step at all, straight from a CDN:
72
72
 
73
73
  The bare package URL serves `dist/onlymap.standalone.js`, a single-file bundle built for exactly this (jsDelivr too). Use a CDN that serves the package's raw files — **not** a rebundling CDN like esm.sh, which re-splits the bundle into duplicate copies of the deck.gl/luma.gl runtime and breaks every layer's shader compilation.
74
74
 
75
- Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with 1,380 unit/behavioral tests and 70 Playwright GPU tests.
75
+ Then `npx @nika-js/onlymap init` wires up VS Code IntelliSense and `!`-prefixed manifest snippets for your project. The library ships with 1,622 unit/behavioral tests and 70 Playwright GPU tests.
76
76
 
77
77
  The [examples](https://github.com/NikaGeospatial/onlymapjs/tree/main/examples) are the best tour: widgets, behaviors & overlays, basemaps, columnar/Arrow data, manual drawing, 3D models, scene lighting (with the native lighting widget), DEM terrain, a live WebSocket ship feed, and a polled driver fleet.
78
78
 
@@ -149,6 +149,8 @@ Hovering a pickable feature shows a pointer cursor automatically, so recipients
149
149
 
150
150
  **Animation:** camera moves accept a duration — `map.flyTo(coords, zoom, { duration: 1200, curve: true })`, or the `fly-to` action (`center`/`zoom`/`pitch`/`bearing`/`duration`) from any behavior or button; `prefers-reduced-motion` is honored (moves become instant, final state identical). Per-prop GPU transitions via the `transition` attribute: `transition="get-fill-color 800ms"` fades color changes; on a streaming layer, `transition="get-position 300ms"` makes entities glide between updates.
151
151
 
152
+ **Print layouts (cartographs):** the `@nika-js/onlymap/cartograph` entry renders standalone pages measured in millimetres — `<om-cartograph>` holds live or static-georeferenced `<om-frame>`s plus derived legends, graticules, scale bars, north roses, shapes, images and token-driven text; `<om-atlas>` renders one page per feature and exports a ZIP. Sheets print at true page size (`@page` + print-DPI frame captures) or export as 300 dpi PNG, with bleed/crop-marks/safe-zone press attributes and page-wide colour-vision simulation. It is a separate lazy build entry: the core bundle does not grow, and a static-only sheet never loads the map runtime. Guide: [docs/cartograph.md](docs/cartograph.md).
153
+
152
154
  **Map stories:** a guided tour as markup — `<om-story>` holds `<om-step>` children that fire the same actions behaviors use, on a timeline (`duration`, `delay`, `parallel`); the built-in `type="player"` widget gives play/pause/scrub, seeking restores the scene's captured initial state, one story is active per map, and grabbing the map pauses playback. Effect verbs — `fade`, `pulse`, `trace` (progressive TripsLayer draw-on; with `feature-id`, a single polygon draws itself on inside its own layer), and `populate` (rows drop in one by one via a GPU filter sweep) — work as step shorthands or plain actions. The story is a sibling that references layers by id — delete it and the map is unchanged. For flybys over 3D tilesets, `warm-tiles` pre-loads the route's tiles in the background before playback, and `paced` goes further: the story steps its own clock and never advances a frame while a tileset is still refining, so no frame ever shows unrefined tiles — wall-clock stretches instead (built for recorded takes; emits `om-paced-tick {t, waitedMs}` per frame, and the two compose — warm first, wait less). `npx @nika-js/onlymap record map.html --out flyby.mp4` turns that guarantee into an actual video: one screenshot per paced frame in headless Chromium (widgets and attribution included), assembled with ffmpeg — and effect verbs animate on the story clock, so recorded traces draw on frame by frame exactly as authored. Guide: [docs/stories.md](docs/stories.md).
153
155
 
154
156
  **Classified symbology:** `classify-by="magnitude" classify-scale="jenks" classify-classes="5" classify-ramp="viridis"` computes class breaks *from the data* (quantile, equal-interval, or Jenks natural breaks), styles the layer with a named ramp, and auto-generates the classes legend — no domains or colors to hand-author; an explicit `get-fill-color`/`color` always wins. **Temporal playback:** `<om-widget type="time-slider" layer="…" field="time" duration="20s" window="86400000" format="date">` is a play/pause/scrub control over a layer's time field, driving the same `filter-layer` mechanics as the filter widget (stats stay coherent; `loop` restarts the sweep).
@@ -291,7 +293,7 @@ Plus `OmMap.snapshotIR(html)` to lock down what a manifest *means* in a snapshot
291
293
 
292
294
  ## 3D
293
295
 
294
- `ScenegraphLayer` instances glTF/GLB models at coordinates (no three.js, no loader wiring), `Tile3DLayer` consumes OGC 3D Tiles, `GeoJsonLayer` extrudes polygons (`extruded get-elevation="$height"`), and the camera tilts via `pitch`/`bearing` attributes. Terrain is one attribute: `<om-map terrain="terrarium">` raises a real DEM surface (keyless AWS tiles; `mapterhorn` keyless too, paired with a CARTO Positron drape by default; `maptiler-terrain` keyed; or a bring-your-own `{z}/{x}/{y}` DEM URL + `terrain-decoder`), geographic layers drape onto it automatically (per-layer `terrain="drape|offset|off"` overrides; 3D models sit ON the surface), `terrain-exaggeration` scales the relief, and `terrain-texture` drapes imagery. Terrain replaces an active basemap while on (flat canvas vs raised surface) and restores it when off. **BIM models require explicit terrain**: a georeferenced model's absolute elevation only means anything against a DEM surface, and the library never writes attributes for you — a model that resolves real elevation on a map without a `terrain` attribute raises an error through the validation channel at load time (any authored value satisfies it, including an explicit `terrain="off"` for flat-ground siting). When terrain IS active, `BIMLayer` automatically re-plants itself at its file's own `IfcMapConversion.OrthogonalHeight` (its real absolute elevation) instead of the local Z≈0 a flat basemap expects — no attribute to author, it just lands on the surface. Scene lighting is declarative: `<om-map lighting="daylight">` (presets `daylight`/`studio`/`flat`/`custom`, tuned via `lighting-ambient`, `lighting-sun`, `lighting-sun-azimuth`/`-elevation`, or `lighting-sun-date` for a solar-position sun) — attribute-backed, so lighting changes are undoable and story-steppable via the `set-lighting` action. `<om-widget type="lighting">` gives users native preset radios + tuning sliders over the same attributes. Converting IFC/CAD upstream: [docs/3d-assets.md](docs/3d-assets.md).
296
+ `ScenegraphLayer` instances glTF/GLB models at coordinates (no three.js, no loader wiring) — `color`/`get-color` tint the model (a shader multiply over its own baked texture/material, so per-row `get-color="$status_color"` recolors a fleet by data without swapping model files), `Tile3DLayer` consumes OGC 3D Tiles, `GeoJsonLayer` extrudes polygons (`extruded get-elevation="$height"`), and the camera tilts via `pitch`/`bearing` attributes. Terrain is one attribute: `<om-map terrain="terrarium">` raises a real DEM surface (keyless AWS tiles; `mapterhorn` keyless too, paired with a CARTO Positron drape by default; `maptiler-terrain` keyed; or a bring-your-own `{z}/{x}/{y}` DEM URL + `terrain-decoder`), geographic layers drape onto it automatically (per-layer `terrain="drape|offset|off"` overrides; 3D models sit ON the surface), `terrain-exaggeration` scales the relief, and `terrain-texture` drapes imagery. Terrain replaces an active basemap while on (flat canvas vs raised surface) and restores it when off. **BIM models require explicit terrain**: a georeferenced model's absolute elevation only means anything against a DEM surface, and the library never writes attributes for you — a model that resolves real elevation on a map without a `terrain` attribute raises an error through the validation channel at load time (any authored value satisfies it, including an explicit `terrain="off"` for flat-ground siting). When terrain IS active, `BIMLayer` automatically re-plants itself at its file's own `IfcMapConversion.OrthogonalHeight` (its real absolute elevation) instead of the local Z≈0 a flat basemap expects — no attribute to author, it just lands on the surface. Scene lighting is declarative: `<om-map lighting="daylight">` (presets `daylight`/`studio`/`flat`/`custom`, tuned via `lighting-ambient`, `lighting-sun`, `lighting-sun-azimuth`/`-elevation`, or `lighting-sun-date` for a solar-position sun) — attribute-backed, so lighting changes are undoable and story-steppable via the `set-lighting` action. `<om-widget type="lighting">` gives users native preset radios + tuning sliders over the same attributes. Converting IFC/CAD upstream: [docs/3d-assets.md](docs/3d-assets.md).
295
297
 
296
298
  **Clip box.** `<om-map clip-box-min="[lng,lat,elev]" clip-box-max="[lng,lat,elev]">` cuts a real axis-aligned 3D box through the whole scene — every layer is clipped by default (`clip="off"` opts a layer out), `clip-box-invert` shows outside the box instead of inside, and `clip-box-highlight` dims clipped-out geometry instead of discarding it (a non-destructive preview). Works on any layer type, including georeferenced `Tile3DLayer`/`BIMLayer` content, so a dense BIM scene can be cut open to see what's inside. Attribute-backed (undoable, story-steppable) via the `set-clip-box` action; `<om-widget type="clip-box">` gives users the same six numeric fields plus invert/highlight toggles. v1 is axis-aligned only — rotated boxes are a documented follow-up.
297
299
 
@@ -19,7 +19,7 @@ async function v(N = {}) {
19
19
  if (n) {
20
20
  const { createRequire: I } = await import(
21
21
  /*webpackIgnore:true*/
22
- "./lerc-BIQMg0FV.js"
22
+ "./lerc-D7TfTy6l.js"
23
23
  ).then((g) => g._);
24
24
  var O = I(import.meta.url);
25
25
  }