@nika-js/onlymap 0.7.2 → 0.7.3

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/dist/onlymapjs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aC as e, aD as r, aE as t, aF as o, aG as b, aH as i, ap as l, aI as n, aJ as S, aK as c, aL as g, aM as E, aN as L, aO as T, aP as A, aQ as _, aR as d, aS as m, aT as p, aU as I, aV as M, aW as u, aX as D, aY as y, aZ as O, ao as R, a_ as f, aw as N, a$ as P, b0 as h, b1 as C, W as F, b2 as B, b3 as v, b4 as x, b5 as G, b6 as U, b7 as W, b8 as w, b9 as Y, ba as X, bb as H, bc as k, bd as J, be as K, bf as V, bg as z, bh as Q, bi as Z, bj as $, bk as j, bl as q, bm as aa, bn as sa, bo as ea, bp as ra, bq as ta, br as oa, bs as ba, bt as ia, bu as la, bv as na, bw as Sa, bx as ca, by as ga, bz as Ea, bA as La, bB as Ta, bC as Aa, bD as _a, bE as da, bF as ma, bG as pa, bH as Ia, bI as Ma, bJ as ua, bK as Da, bL as ya, bM as Oa, bN as Ra, bO as fa, bP as Na, bQ as Pa, bR as ha, bS as Ca, bT as Fa, bU as Ba, bV as va, bW as xa, bX as Ga, bY as Ua, bZ as Wa, b_ as wa, b$ as Ya, c0 as Xa, c1 as Ha, c2 as ka, c3 as Ja, c4 as Ka, c5 as Va, c6 as za, c7 as Qa, c8 as Za, c9 as $a, ca as ja } from "./index-C40QUjew.js";
1
+ import { aC as e, aD as r, aE as t, aF as o, aG as b, aH as i, ap as l, aI as n, aJ as S, aK as c, aL as g, aM as E, aN as L, aO as T, aP as A, aQ as _, aR as d, aS as m, aT as p, aU as I, aV as M, aW as u, aX as D, aY as y, aZ as O, ao as R, a_ as f, aw as N, a$ as P, b0 as h, b1 as C, W as F, b2 as B, b3 as v, b4 as x, b5 as G, b6 as U, b7 as W, b8 as w, b9 as Y, ba as X, bb as H, bc as k, bd as J, be as K, bf as V, bg as z, bh as Q, bi as Z, bj as $, bk as j, bl as q, bm as aa, bn as sa, bo as ea, bp as ra, bq as ta, br as oa, bs as ba, bt as ia, bu as la, bv as na, bw as Sa, bx as ca, by as ga, bz as Ea, bA as La, bB as Ta, bC as Aa, bD as _a, bE as da, bF as ma, bG as pa, bH as Ia, bI as Ma, bJ as ua, bK as Da, bL as ya, bM as Oa, bN as Ra, bO as fa, bP as Na, bQ as Pa, bR as ha, bS as Ca, bT as Fa, bU as Ba, bV as va, bW as xa, bX as Ga, bY as Ua, bZ as Wa, b_ as wa, b$ as Ya, c0 as Xa, c1 as Ha, c2 as ka, c3 as Ja, c4 as Ka, c5 as Va, c6 as za, c7 as Qa, c8 as Za, c9 as $a, ca as ja } from "./index-BRdaiH3a.js";
2
2
  export {
3
3
  e as ALL_POSITION_VALUES,
4
4
  r as AUDIT_EXEMPTIONS,
@@ -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-BUuur0I8.js";
2
- import { ax as Kt, ay as xt } from "./index-C40QUjew.js";
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-B4N48UQX.js";
2
+ import { ax as Kt, ay as xt } from "./index-BRdaiH3a.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-Dpc86Tzf.js").then((e) => e.l).then((e) => e.decode));
1073
+ j.set(f.Lerc, () => import("./lerc-BPTGJlrt.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 { am as he, an as fe, ao as se, ap as oe, aq as me, b as pe, ar as ge, l as Z, as as ve, d as be, at as xe, au as Pe, av as ye, aw as ie } from "./index-C40QUjew.js";
2
+ import { am as he, an as fe, ao as se, ap as oe, aq as me, b as pe, ar as ge, l as Z, as as ve, d as be, at as xe, au as Pe, av as ye, aw as ie } from "./index-BRdaiH3a.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/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * the build rootDir, and a `define` would need repeating across vite/vitest/
6
6
  * vite-node configs.
7
7
  */
8
- export declare const LIBRARY_VERSION = "0.7.2";
8
+ export declare const LIBRARY_VERSION = "0.7.3";
@@ -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-BUuur0I8.js";
2
- import { ap as gr } from "./index-C40QUjew.js";
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-B4N48UQX.js";
2
+ import { ap as gr } from "./index-BRdaiH3a.js";
3
3
  import $t from "./index-CW1n5LdO.js";
4
4
  var Et;
5
5
  function h(e, t, n) {
package/llms.txt CHANGED
@@ -20,7 +20,7 @@ Programmatic/native bridge rule: `MapController.setLayers()` accepts normal func
20
20
  - ScatterplotLayer points need an explicit size: `radius="6" radius-units="pixels"` (constant), `get-radius="..."` (data-driven), or `radius-min-pixels="..."` (floor). Deck's default is getRadius 1 METER — sub-pixel at city zooms, the layer renders nothing visible — and validation warns when no radius source is present.
21
21
  - A literal color inside a `get-*` accessor is a string IN the expression — quote it: `get-line-color="'#ffffff'"` or an RGBA array `get-line-color="[255,255,255,200]"`. Bare `get-line-color="#ffffff"` is an expression parse error (plain attributes like `color="#dc2626"` take bare hex, accessors do not).
22
22
  - Inline event handlers (`onclick="..."`) are rejected. Use `data-emit` attributes (`<span data-emit="hide-overlay" data-target="popup1">`) or `addEventListener` inside a `<script type="om/widget">` block where `ctx` is in scope.
23
- - `scale()` requires an explicit `domain=`: `get-fill-color="scale($depth, sequential, ['#ffffcc','#800026'], domain=[0,700])"`. A missing domain is a validation error.
23
+ - `scale()` requires an explicit `domain=`: `get-fill-color="scale($depth, sequential, ['#ffffcc','#800026'], domain=[0,700])"`. A missing domain is a validation error. The KIND must match the range: `sequential`/`diverging` interpolate COLORS (range = 2+ color stops); `linear`/`sqrt`/`log`/`pow` interpolate NUMBERS (sizes, radii, widths, opacities — e.g. `get-point-radius="scale($mag, linear, [4, 18], domain=[4.5, 7.8])"`); `threshold` maps either. `pow` REQUIRES `exponent=` as the last argument (`scale($v, pow, [0,30], domain=[0,100], exponent=2)`) — without a real exponent it is just a straight line, and `linear` is the honest spelling for that. A mismatched pairing (e.g. `sequential` with `[4,18]`) is a compile/validation ERROR — it used to silently paint black/zero.
24
24
  - Readable date/time labels use the safe built-in `formatDate($time, 'datetime', 'UTC')`. Input may be epoch milliseconds (NEVER seconds; multiply seconds by 1000 first) or an ISO string. Styles: `date|datetime|time|iso`; default style `datetime`, default zone `UTC`; zone may be `local` or an IANA name such as `Asia/Singapore`. Do NOT use `new Date()`, `Intl`, or instance methods in restricted expressions.
25
25
  - `scale()`/`clamp()`/`lerp()`/`$field` expressions go ONLY in `get-*` accessors — NEVER in a scalar attribute (`radius-min-pixels`, `point-radius-min-pixels`, `opacity`, `line-width-min-pixels`, `color`, …). A data-driven expression in a scalar doesn't coerce, so the layer silently renders defaults (invisible / black points); validation errors on it. Data-driven size/width/opacity/color → the matching `get-*` accessor (`get-radius`, `get-fill-color`, …); scalars take a constant floor/value.
26
26
  - `id` is required on every `<om-layer>`. `label` and `color` feed the legend; an explicit `get-fill-color` overrides `color` for rendering (both together is valid and common). The legend widget also reads `get-fill-color` itself: a `sequential`/`diverging` scale renders as a gradient ramp with domain labels, a `threshold` scale as discrete class ranges, and an equality ternary chain (`$f == 'a' ? '#c1' : '#c2'`) as a category palette — write those canonical shapes and the legend describes the symbology automatically.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Declarative deck.gl maps for HTML and React — 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": {
@@ -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.7.2` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.7.2/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.7.3` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.7.3/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
 
@@ -55,7 +55,7 @@ Load the smallest reference needed for the task:
55
55
  - Every `<om-layer>` needs a stable `id`.
56
56
  - Attribute names are kebab-case: `get-fill-color`, `radius-units`, `line-width-min-pixels`.
57
57
  - Accessor values are expressions: `get-position="[$lon, $lat]"`.
58
- - `scale()` always needs an explicit `domain=`.
58
+ - `scale()` always needs an explicit `domain=`. Match the kind to the range: `sequential`/`diverging` take COLOR stops, `linear`/`sqrt`/`log`/`pow` take NUMBERS (a mismatch is a compile error). `pow` also requires a trailing `exponent=` (e.g. `exponent=2`) — for a straight line use `linear`.
59
59
  - Format epoch-millisecond or ISO fields with the safe `formatDate()` built-in, e.g. `get-text="formatDate($time, 'datetime', 'UTC')"`. Do not use `new Date()`, `Intl`, or method calls in restricted expressions.
60
60
  - For a built-in filter over epoch milliseconds, add `format="date"` with optional `date-style="date|datetime|time|iso"` and `time-zone="UTC|local|<IANA zone>"`; do not hand-roll a time slider only to format its labels. For temporal PLAYBACK (play/pause/scrub over a time field, cumulative or a sliding `window`), use `<om-widget type="time-slider" layer="…" field="…" duration="20s" loop>` — never hand-roll the playback loop.
61
61
  - ScatterplotLayer points need an explicit size — `radius="6" radius-units="pixels"`, `get-radius="..."`, or `radius-min-pixels="..."`: deck's default is 1 METER, sub-pixel at city zooms, and validation warns on layers with no radius source.
@@ -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.7.2/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.7.2"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.7.3/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.7.3"></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).
@@ -88,6 +88,8 @@ get-text="formatDate($time, 'datetime', 'UTC')"
88
88
 
89
89
  `$field` works on flat rows, GeoJSON properties, columnar JSON, CSV/TSV columns, and Arrow point columns.
90
90
 
91
+ `scale()` kinds: `sequential`/`diverging` interpolate COLOR stops; `linear`/`sqrt`/`log`/`pow` interpolate NUMBERS (sizes, radii, widths); `threshold` maps either. A kind/range mismatch (e.g. `sequential` with `[4,18]`) is a compile error. `pow` requires a trailing `exponent=` (`scale($v, pow, [0,30], domain=[0,100], exponent=2)`); for a straight line use `linear`.
92
+
91
93
  Date formatting is a safe built-in rather than an opt-in to arbitrary JavaScript:
92
94
 
93
95
  ```html