@nika-js/onlymap 0.3.4 → 0.3.5

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.
@@ -28,6 +28,7 @@
28
28
  " data=\"${4:../data/bikes.json}\"",
29
29
  " label=\"${5:Points}\" color=\"${6:#e63946}\"",
30
30
  " get-position=\"[\\$lon, \\$lat]\"",
31
+ " radius=\"${7:6}\" radius-units=\"pixels\"",
31
32
  " pickable></om-layer>",
32
33
  "",
33
34
  " <!-- Rich HTML popup — follows the last click via anchor-from=\"selection\" -->",
@@ -110,6 +111,7 @@
110
111
  " data=\"${2:../data/bikes.json}\"",
111
112
  " label=\"${3:Points}\" color=\"${4:#e63946}\"",
112
113
  " get-position=\"[\\$lon, \\$lat]\"",
114
+ " radius=\"${5:6}\" radius-units=\"pixels\"",
113
115
  " pickable></om-layer>$0"
114
116
  ]
115
117
  },
@@ -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-vBCRLD5s.js"
22
+ "./lerc-DWGhMWvo.js"
23
23
  ).then((g) => g._);
24
24
  var O = I(import.meta.url);
25
25
  }
@@ -1,4 +1,4 @@
1
- import { C as ny, L as sy, M as oy, m as ay, c as ka, z as oc, a as Sd, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-BR1HjJoE.js";
1
+ import { C as ny, L as sy, M as oy, m as ay, c as ka, z as oc, a as Sd, G as sm, V as ly, W as cy, b as uy, g as hy, d as Vu, f as Ed, e as dy, l as py, u as fy, D as Qf, h as my } from "./index-i_KAvtQZ.js";
2
2
  const Cd = Math.PI / 180, gy = 180 / Math.PI;
3
3
  function em(Pe, Q = 0) {
4
4
  const ge = Math.min(180, Pe) * Cd;
@@ -1,4 +1,4 @@
1
- import { ac as _t, ad as Ct } from "./index-BR1HjJoE.js";
1
+ import { ac as _t, ad as Ct } from "./index-i_KAvtQZ.js";
2
2
  function Yt(e, r, t = 2, i, o = "xy") {
3
3
  const s = r && r.length, l = s ? r[0] * t : e.length;
4
4
  let c = Ut(e, 0, l, t, !0, i && i[0], o);
@@ -1,5 +1,5 @@
1
- import { i as E, j as S, k as R, n as N, o as h, p as w, q as O, s as W, r as x, t as I, v as B, w as _, x as P, y as k, A as $, B as z, E as v, F, H as C, I as U, J as p, K as M } from "./index-BR1HjJoE.js";
2
- import { N as $e, R as ze, _ as ve, O as Ce, P as Ue, Q as Me, S as je, T as De, U as Je, X as qe, Y as He, Z as Ve, $ as Ge, a0 as Ke, a1 as Qe, a2 as Xe, a3 as Ye, a4 as Ze, a5 as et, a6 as tt, a7 as nt, a8 as rt, a9 as at, aa as st, ab as ot } from "./index-BR1HjJoE.js";
1
+ import { i as E, j as S, k as R, n as N, o as h, p as w, q as O, s as W, r as x, t as I, v as B, w as _, x as P, y as k, A as $, B as z, E as v, F, H as C, I as U, J as p, K as M } from "./index-i_KAvtQZ.js";
2
+ import { N as $e, R as ze, _ as ve, O as Ce, P as Ue, Q as Me, S as je, T as De, U as Je, X as qe, Y as He, Z as Ve, $ as Ge, a0 as Ke, a1 as Qe, a2 as Xe, a3 as Ye, a4 as Ze, a5 as et, a6 as tt, a7 as nt, a8 as rt, a9 as at, aa as st, ab as ot } from "./index-i_KAvtQZ.js";
3
3
  import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
4
4
  async function J(t, e, n = {}, r = {}) {
5
5
  const a = E(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
@@ -1,4 +1,4 @@
1
- import { ai as Bt, ak as Xt, al as Yt, am as Us } from "./index-BR1HjJoE.js";
1
+ import { ai as Bt, ak as Xt, al as Yt, am as Us } from "./index-i_KAvtQZ.js";
2
2
  import { w as gs, t as Hs, f as Ws, m as Qs } from "./mgrs-BY9bIvp4.js";
3
3
  import { c as Xs } from "./convert-arrow-schema-DrAihRf9.js";
4
4
  import { y as Ys, A as bt, a as Ks, z as Vs, R as Zs } from "./recordbatch-Bpc0uxFn.js";
@@ -1,4 +1,4 @@
1
- import { ae as Be, af as le, ag as ce, ah as De, ai as Oe, aj as ke } from "./index-BR1HjJoE.js";
1
+ import { ae as Be, af as le, ag as ce, ah as De, ai as Oe, aj as ke } from "./index-i_KAvtQZ.js";
2
2
  import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as je, n as xe, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
3
3
  import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
4
4
  import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";
@@ -66287,7 +66287,7 @@ Ho({
66287
66287
  });
66288
66288
  Ho({
66289
66289
  type: "COGLayer",
66290
- loadClass: () => import("./raster-BwULn87I.js").then((t) => t.r).then((t) => t.OmCOGLayer),
66290
+ loadClass: () => import("./raster-Da1auFQH.js").then((t) => t.r).then((t) => t.OmCOGLayer),
66291
66291
  props: [
66292
66292
  { attr: "src", kind: "scalar", deckProp: "geotiff", type: "string", required: !0 },
66293
66293
  { attr: "min", kind: "scalar", deckProp: "rescaleMin", type: "number" },
@@ -66466,7 +66466,7 @@ class iN {
66466
66466
  `[onlymapjs] basemap="${e}" (Mapbox GL) is not implemented yet in this version — falling back to standalone (no basemap). Use a maplibre-* basemap instead (no token required).`
66467
66467
  );
66468
66468
  else {
66469
- this.mode = "basemap", this.basemapAttr = e, import("./basemap-BRh_zvzt.js").then(({ MapLibreBasemapAdapter: s }) => {
66469
+ this.mode = "basemap", this.basemapAttr = e, import("./basemap-BkoYlZXu.js").then(({ MapLibreBasemapAdapter: s }) => {
66470
66470
  this.destroyed || i !== this.rendererGeneration || (this.basemap = new s(
66471
66471
  this.parent,
66472
66472
  // this.basemapAttr, not the captured param: a style switch that
@@ -66954,7 +66954,7 @@ const X0e = {
66954
66954
  }, Y0e = {
66955
66955
  match: (t, e) => ["csv", "tsv"].includes(yu(t) ?? "") || /text\/(csv|tab-separated-values)/i.test(e ?? ""),
66956
66956
  parse: async (t) => {
66957
- const [e, i, r] = await Promise.all([t.text(), import("./index-9_RmnPoW.js"), import("./index-B3NQy6CS.js")]), n = await r.parse(e, i.CSVLoader, { csv: { shape: "object-row-table" } });
66957
+ const [e, i, r] = await Promise.all([t.text(), import("./index-DAx8ax6u.js"), import("./index-CY7o8j7i.js")]), n = await r.parse(e, i.CSVLoader, { csv: { shape: "object-row-table" } });
66958
66958
  return Z0e(n.data) ?? n.data;
66959
66959
  }
66960
66960
  };
@@ -66976,7 +66976,7 @@ const K0e = {
66976
66976
  parse: async (t, e) => {
66977
66977
  t.body?.cancel().catch(() => {
66978
66978
  });
66979
- const [i, r] = await Promise.all([import("./index-B3NQy6CS.js"), import("./index-Y_CL37KN.js")]), n = t.url || e, s = /* @__PURE__ */ new Map(), o = (b) => {
66979
+ const [i, r] = await Promise.all([import("./index-CY7o8j7i.js"), import("./index-Ck0N90Ri.js")]), n = t.url || e, s = /* @__PURE__ */ new Map(), o = (b) => {
66980
66980
  const v = String(b);
66981
66981
  let C = s.get(v);
66982
66982
  return C || (C = oN(v), s.set(v, C)), C.then((T) => T.clone());
@@ -66989,7 +66989,7 @@ const K0e = {
66989
66989
  }, Q0e = {
66990
66990
  match: (t, e) => yu(t) === "kml" || /application\/vnd\.google-earth\.kml/i.test(e ?? ""),
66991
66991
  parse: async (t) => {
66992
- const [e, i, r] = await Promise.all([t.text(), import("./index-B3NQy6CS.js"), import("./index-xaNTkA9k.js")]);
66992
+ const [e, i, r] = await Promise.all([t.text(), import("./index-CY7o8j7i.js"), import("./index-BJvRiLIi.js")]);
66993
66993
  return D1(await i.parse(e, r.KMLLoader));
66994
66994
  }
66995
66995
  }, rN = [], q0e = [X0e, Y0e, K0e, Q0e];
@@ -74847,7 +74847,7 @@ function Sl(t, e) {
74847
74847
  }
74848
74848
  Rt("undo", (t, e) => Rh(e)?.undo());
74849
74849
  Rt("redo", (t, e) => Rh(e)?.redo());
74850
- const _4 = "0.3.4", _1e = "https://om-api.nika.eco/v1/t", tu = { endpoint: _1e };
74850
+ const _4 = "0.3.5", _1e = "https://om-api.nika.eco/v1/t", tu = { endpoint: _1e };
74851
74851
  function v1e(t) {
74852
74852
  for (const e of Object.keys(t))
74853
74853
  tu[e] = t[e];
@@ -75397,6 +75397,12 @@ function $1e(t) {
75397
75397
  attribute: "filter-range",
75398
75398
  message: `filter-field="${t.getAttribute("filter-field")}" has no filter-range — every row will be filtered out.`,
75399
75399
  fix: 'Add filter-range="[min, max]".'
75400
+ }), n === "ScatterplotLayer" && !t.hasAttribute("radius") && !t.hasAttribute("get-radius") && !t.hasAttribute("radius-min-pixels") && !a.has("getRadius") && e.push({
75401
+ severity: "warning",
75402
+ element: i,
75403
+ attribute: "radius",
75404
+ message: "No radius source — points render at deck's default 1-meter radius, which is invisible at city zooms.",
75405
+ fix: 'Add radius="6" radius-units="pixels" (constant size), get-radius="..." (data-driven), or radius-min-pixels="...".'
75400
75406
  });
75401
75407
  for (const b of Array.from(t.attributes)) {
75402
75408
  const v = s4.get(b.name);
@@ -77169,7 +77175,7 @@ function j_e() {
77169
77175
  }), Ao = null, xy = void 0, Mh.clear());
77170
77176
  }
77171
77177
  async function W_e() {
77172
- return import("./raster-BwULn87I.js").then((t) => t.r);
77178
+ return import("./raster-Da1auFQH.js").then((t) => t.r);
77173
77179
  }
77174
77180
  const b2e = {
77175
77181
  registerLayer: Ho,
@@ -1,4 +1,4 @@
1
- import { C as a, D as s } from "./raster-BwULn87I.js";
1
+ import { C as a, D as s } from "./raster-Da1auFQH.js";
2
2
  const D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
3
  __proto__: null
4
4
  }, Symbol.toStringTag, { value: "Module" }));
@@ -8,7 +8,7 @@ var t;
8
8
  })(t || (t = {}));
9
9
  let l = !1;
10
10
  async function d() {
11
- const e = await import("./LercDecode.es-D6eXA5jP.js");
11
+ const e = await import("./LercDecode.es-C1xVetIa.js");
12
12
  return l || (await e.load(), l = !0), e;
13
13
  }
14
14
  async function i(e, r) {
@@ -87227,7 +87227,7 @@ function vb(t, e) {
87227
87227
  }
87228
87228
  yn("undo", (t, e) => KB(e)?.undo());
87229
87229
  yn("redo", (t, e) => KB(e)?.redo());
87230
- const Yne = "0.3.4", i$e = "https://om-api.nika.eco/v1/t", vC = { endpoint: i$e };
87230
+ const Yne = "0.3.5", i$e = "https://om-api.nika.eco/v1/t", vC = { endpoint: i$e };
87231
87231
  function r$e(t) {
87232
87232
  for (const e of Object.keys(t))
87233
87233
  vC[e] = t[e];
@@ -87777,6 +87777,12 @@ function S$e(t) {
87777
87777
  attribute: "filter-range",
87778
87778
  message: `filter-field="${t.getAttribute("filter-field")}" has no filter-range — every row will be filtered out.`,
87779
87779
  fix: 'Add filter-range="[min, max]".'
87780
+ }), n === "ScatterplotLayer" && !t.hasAttribute("radius") && !t.hasAttribute("get-radius") && !t.hasAttribute("radius-min-pixels") && !o.has("getRadius") && e.push({
87781
+ severity: "warning",
87782
+ element: i,
87783
+ attribute: "radius",
87784
+ message: "No radius source — points render at deck's default 1-meter radius, which is invisible at city zooms.",
87785
+ fix: 'Add radius="6" radius-units="pixels" (constant size), get-radius="..." (data-driven), or radius-min-pixels="...".'
87780
87786
  });
87781
87787
  for (const I of Array.from(t.attributes)) {
87782
87788
  const M = Qne.get(I.name);
package/dist/onlymapjs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ay as e, az as r, aA as o, aB as t, aq as i, aC as n, aD as b, aE as l, aF as c, aG as g, aH as m, aI as p, aJ as L, aK as y, ap as T, aL as S, ax as u, W as d, aM as E, aN as M, aO as A, aP as I, aQ as f, aR as x, aS as C, aT as h, aU as B, aV as D, aW as R, aX as w, aY as v, aZ as F, a_ as G, a$ as N, b0 as O, b1 as W, b2 as _, b3 as z, b4 as H, b5 as J, b6 as k, b7 as P, b8 as V, b9 as Y, ba as j, bb as q, bc as K, bd as Q, be as U, bf as X, bg as Z, bh as $, bi as aa, bj as sa, bk as ea } from "./index-BR1HjJoE.js";
1
+ import { ay as e, az as r, aA as o, aB as t, aq as i, aC as n, aD as b, aE as l, aF as c, aG as g, aH as m, aI as p, aJ as L, aK as y, ap as T, aL as S, ax as u, W as d, aM as E, aN as M, aO as A, aP as I, aQ as f, aR as x, aS as C, aT as h, aU as B, aV as D, aW as R, aX as w, aY as v, aZ as F, a_ as G, a$ as N, b0 as O, b1 as W, b2 as _, b3 as z, b4 as H, b5 as J, b6 as k, b7 as P, b8 as V, b9 as Y, ba as j, bb as q, bc as K, bd as Q, be as U, bf as X, bg as Z, bh as $, bi as aa, bj as sa, bk as ea } from "./index-i_KAvtQZ.js";
2
2
  export {
3
3
  e as AccessorCache,
4
4
  r as BitmapLayer,
@@ -1,5 +1,5 @@
1
1
  import { w as kt, t as Ni, f as Oi, m as Ri } from "./mgrs-BY9bIvp4.js";
2
- import { an as Fi, ao as zi, ap as Ks, aq as Ws, ar as Di, b as Bi, as as Ui, l as es, at as ki, d as qi, au as Ki, av as Wi, aw as Xi, ax as Xs } from "./index-BR1HjJoE.js";
2
+ import { an as Fi, ao as zi, ap as Ks, aq as Ws, ar as Di, b as Bi, as as Ui, l as es, at as ki, d as qi, au as Ki, av as Wi, aw as Xi, ax as Xs } from "./index-i_KAvtQZ.js";
3
3
  function Hi(t, e, s) {
4
4
  const { projectedCorners: i } = e, { topLeft: a, topRight: r, bottomRight: o, bottomLeft: n } = i, h = s(a[0], a[1]), l = s(r[0], r[1]), c = s(o[0], o[1]), u = s(n[0], n[1]), d = [
5
5
  h,
@@ -2377,7 +2377,7 @@ it.set(G.Zstd, () => import("./zstd-jXobGRcq.js").then((t) => t.decode));
2377
2377
  it.set(G.Jpeg, () => Promise.resolve(ke));
2378
2378
  it.set(G.Jpeg6, () => Promise.resolve(ke));
2379
2379
  it.set(G.Webp, () => Promise.resolve(ke));
2380
- it.set(G.Lerc, () => import("./lerc-vBCRLD5s.js").then((t) => t.l).then((t) => t.decode));
2380
+ it.set(G.Lerc, () => import("./lerc-DWGhMWvo.js").then((t) => t.l).then((t) => t.decode));
2381
2381
  async function qe(t, e, s) {
2382
2382
  const i = it.get(e);
2383
2383
  if (!i)
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.3.4";
8
+ export declare const LIBRARY_VERSION = "0.3.5";
package/llms.txt CHANGED
@@ -15,6 +15,7 @@ OnlyMapJS is NOT raw deck.gl and NOT generic HTML/JSX. The rules below are the d
15
15
  - Always write explicit closing tags: `<om-layer ...></om-layer>`. NEVER self-close (`<om-layer ... />`) — HTML5 ignores the slash on custom elements and every following sibling silently becomes a child.
16
16
  - Attributes are kebab-case, not camelCase: `get-fill-color`, `radius-units`, `line-width-min-pixels`. Every hyphenated attribute maps to the camelCase deck.gl prop.
17
17
  - Accessors are expressions in attributes, not JS functions: `get-position="[$lon, $lat]"`, `get-radius="$population * 0.001"`. `$field` reads a datum field; the library resolves flat vs. GeoJSON shape for you — never write `d.properties.x`.
18
+ - 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.
18
19
  - 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).
19
20
  - 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.
20
21
  - `scale()` requires an explicit `domain=`: `get-fill-color="scale($depth, sequential, ['#ffffcc','#800026'], domain=[0,700])"`. A missing domain is a validation error.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
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": {
@@ -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.3.4` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.3.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.3.5` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.3.5/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
 
@@ -51,6 +51,7 @@ Load the smallest reference needed for the task:
51
51
  - Attribute names are kebab-case: `get-fill-color`, `radius-units`, `line-width-min-pixels`.
52
52
  - Accessor values are expressions: `get-position="[$lon, $lat]"`.
53
53
  - `scale()` always needs an explicit `domain=`.
54
+ - 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.
54
55
  - Prefer canonical color expressions — a `sequential`/`diverging`/`threshold` `scale()` or an equality ternary chain — over hand-rolled arithmetic: the legend widget parses these shapes and renders a matching gradient ramp / class ranges / category palette automatically.
55
56
  - Inline handlers such as `onclick` are wrong. Use `data-emit`, `<om-behavior>`, or widget scripts.
56
57
  - Full JavaScript accessor blocks require the `js` attribute on `<om-layer>`.
@@ -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.3.4/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.3.4"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.3.5/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.3.5"></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).