@nika-js/onlymap 0.11.1 → 0.11.2

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 (33) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +1 -1
  3. package/dist/{basemap-CHFwxaRT.js → basemap-BlMlSRTo.js} +2 -2
  4. package/dist/cluster-options.d.ts +11 -0
  5. package/dist/{geoparquet-DBzSJJz_.js → geoparquet-Bqhh_idk.js} +1 -1
  6. package/dist/{globe-view-D0eDmIGO.js → globe-view-DQ0GLKSn.js} +1 -1
  7. package/dist/{hillshade-DodGS9DL.js → hillshade-CxMG6ocE.js} +1 -1
  8. package/dist/{index-Ca5y3OLs.js → index-9W2ZrRyF.js} +1 -1
  9. package/dist/{index-D04CeeYu.js → index-CE3n5pQz.js} +11169 -11132
  10. package/dist/{index-wRR0a71N.js → index-CF7q_mKH.js} +2 -2
  11. package/dist/{index-C7Tpf_BA.js → index-CdAb2VR8.js} +1 -1
  12. package/dist/{index-DH1_IQmW.js → index-DBYIrdvb.js} +3 -3
  13. package/dist/{index-em-_HmNV.js → index-DO3-mfIk.js} +3 -3
  14. package/dist/{index-BGvTOkkE.js → index-DklXFu6D.js} +1 -1
  15. package/dist/{index-5iFHs_bW.js → index-aoMhS8VK.js} +1 -1
  16. package/dist/{index-CrnprTab.js → index-m-7enOKi.js} +1 -1
  17. package/dist/layers/cluster-layer.d.ts +7 -0
  18. package/dist/{lerc-KZgSVKKQ.js → lerc-vNjPdkTs.js} +1 -1
  19. package/dist/onlymap.standalone.js +19164 -19127
  20. package/dist/onlymapjs.js +1 -1
  21. package/dist/{post-process-effect-eJXo3MSl.js → post-process-effect-eVlcdR0m.js} +1 -1
  22. package/dist/{raster-CHuauCiR.js → raster-8iVEbDdp.js} +3 -3
  23. package/dist/{raster-pipeline-Coou2lF-.js → raster-pipeline-OqdVks6Y.js} +1 -1
  24. package/dist/{text-on-path-DUfdTGzX.js → text-on-path-C34MMnKY.js} +1 -1
  25. package/dist/version.d.ts +1 -1
  26. package/dist/{zarr-BYLzFMeQ.js → zarr-Dla-EY4o.js} +2 -2
  27. package/docs/cartograph.md +2 -2
  28. package/llms.txt +1 -1
  29. package/onlymapjs.attributes.json +12 -0
  30. package/onlymapjs.html-data.json +16 -0
  31. package/package.json +1 -1
  32. package/skills/onlymapjs/SKILL.md +1 -1
  33. package/skills/onlymapjs/references/syntax.md +7 -5
package/CHANGELOG.md CHANGED
@@ -8,6 +8,11 @@ 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.11.2 — 2026-10-01
12
+
13
+ ### Added
14
+ - **The count on a cluster bubble can be moved and given a backing.** `cluster-label-position="top-right"` (or any edge or corner) moves the number onto the bubble's rim, off a photo; `cluster-label-background="#111827"` draws a pill behind it; `cluster-label-color` and `cluster-label-size` set its text colour and size. `cluster-label="false"` still hides it. The default is unchanged — centred, white, with a thin dark halo.
15
+
11
16
  ## 0.11.1 — 2026-09-30
12
17
 
13
18
  ### Added
package/README.md CHANGED
@@ -147,7 +147,7 @@ Thousands of points that overlap on screen become count bubbles that split apart
147
147
  get-cluster-fill-color="$mode_fuel == 'Hydro' ? '#0ea5e9' : '#64748b'" pickable></om-layer>
148
148
  ```
149
149
 
150
- `cluster="true"` works on `ScatterplotLayer`, `GeoJsonLayer` (Point features) and `IconLayer`. The layer keeps its id, data, its own `get-*` symbology for the points that stand alone, its picks and its actions. `cluster-radius` (px, 50), `cluster-max-zoom` (16) and `cluster-min-points` (2) follow MapLibre's names. `cluster-properties="sum:f,min:f,max:f,mean:f,mode:f,first:f"` carries aggregates onto each bubble as `$sum_f`, `$mode_f`, `$first_f`…, beside `$count`; `get-cluster-icon="$first_photo"` puts an image on the bubble — a URL becomes a circular thumbnail ringed in the bubble's fill (images need CORS), a name a glyph from `cluster-icon-atlas`; `get-cluster-radius`, `get-cluster-fill-color`, `get-cluster-line-color` and `get-cluster-label` style the bubbles with the same expression language. Every bubble also carries `$count_max` and `$<aggregate>_max` — the largest value at the *current zoom* — so the default radius, `scale($count / $count_max, sqrt, [12, 36], domain=[0, 1])`, keeps the biggest bubble at 36 px whether the reader is looking at a continent or a county. A click on a bubble eases to where it splits (`cluster-click="none"` to opt out, or wire `expand-cluster` yourself); a bubble pick carries `cluster: true`, `count` and the aggregates into overlays and `ctx.selection`, and `pick="point"` / `pick="cluster"` on `<om-behavior>` gives points and bubbles their own cards; `map.clusterLeaves(layerId, clusterId)` returns the rows inside one.
150
+ `cluster="true"` works on `ScatterplotLayer`, `GeoJsonLayer` (Point features) and `IconLayer`. The layer keeps its id, data, its own `get-*` symbology for the points that stand alone, its picks and its actions. `cluster-radius` (px, 50), `cluster-max-zoom` (16) and `cluster-min-points` (2) follow MapLibre's names. `cluster-properties="sum:f,min:f,max:f,mean:f,mode:f,first:f"` carries aggregates onto each bubble as `$sum_f`, `$mode_f`, `$first_f`…, beside `$count`; `get-cluster-icon="$first_photo"` puts an image on the bubble — a URL becomes a circular thumbnail ringed in the bubble's fill (images need CORS), a name a glyph from `cluster-icon-atlas`; the count can sit on the rim as a badge (`cluster-label-position="top-right" cluster-label-background="#111827"`, plus `cluster-label-color`/`-size`) so it reads over the image; `get-cluster-radius`, `get-cluster-fill-color`, `get-cluster-line-color` and `get-cluster-label` style the bubbles with the same expression language. Every bubble also carries `$count_max` and `$<aggregate>_max` — the largest value at the *current zoom* — so the default radius, `scale($count / $count_max, sqrt, [12, 36], domain=[0, 1])`, keeps the biggest bubble at 36 px whether the reader is looking at a continent or a county. A click on a bubble eases to where it splits (`cluster-click="none"` to opt out, or wire `expand-cluster` yourself); a bubble pick carries `cluster: true`, `count` and the aggregates into overlays and `ctx.selection`, and `pick="point"` / `pick="cluster"` on `<om-behavior>` gives points and bubbles their own cards; `map.clusterLeaves(layerId, clusterId)` returns the rows inside one.
151
151
 
152
152
  ### Interaction
153
153
 
@@ -1,5 +1,5 @@
1
- import { aJ as Y_, N as Bu, H as Pd, k as K_, aK as J_, aL as Q_, D as Xf, Z as ey } from "./index-D04CeeYu.js";
2
- import { a as ty } from "./globe-view-D0eDmIGO.js";
1
+ import { aJ as Y_, N as Bu, H as Pd, k as K_, aK as J_, aL as Q_, D as Xf, Z as ey } from "./index-CE3n5pQz.js";
2
+ import { a as ty } from "./globe-view-DQ0GLKSn.js";
3
3
  var Ou = { exports: {} };
4
4
  /**
5
5
  * MapLibre GL JS
@@ -47,6 +47,9 @@ export declare const DEFAULT_CLUSTER_LABEL_EXPR = "$count_abbreviated";
47
47
  /** The accessor props a cluster row is styled through — `getCluster*`, never the host's own. */
48
48
  export declare const CLUSTER_ACCESSOR_PROPS: readonly ["getClusterRadius", "getClusterFillColor", "getClusterLineColor", "getClusterLabel", "getClusterIcon"];
49
49
  export type ClusterAccessorProp = (typeof CLUSTER_ACCESSOR_PROPS)[number];
50
+ /** Where the count sits on the bubble: centred, or pushed to an edge/corner — a badge over a photo. */
51
+ export declare const CLUSTER_LABEL_POSITIONS: readonly ["center", "top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"];
52
+ export type ClusterLabelPosition = (typeof CLUSTER_LABEL_POSITIONS)[number];
50
53
  /**
51
54
  * Registered onto every CLUSTER_CAPABLE type (layer-registry.ts). `deckProp`
52
55
  * is the prop-bag key extraction looks for; none of these ever reaches deck.
@@ -68,6 +71,14 @@ export interface ClusterOptions {
68
71
  aggregates: ClusterAggregate[];
69
72
  click: ClusterClick;
70
73
  label: boolean;
74
+ /** `cluster-label-position` — centred (default) or at an edge/corner of the bubble. */
75
+ labelPosition: ClusterLabelPosition;
76
+ /** `cluster-label-background` — a pill behind the count, as RGB(A); absent = none (a thin dark halo on the text instead). */
77
+ labelBackground?: number[];
78
+ /** `cluster-label-color` — the count's colour as RGB(A); absent = white. */
79
+ labelColor?: number[];
80
+ /** `cluster-label-size` — the count's font size in px (default 12). */
81
+ labelSize: number;
71
82
  /** `cluster-icon-atlas` / `cluster-icon-mapping` — the glyph sheet a NAME from `get-cluster-icon` resolves in. */
72
83
  iconAtlas?: string;
73
84
  iconMapping?: Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { a4 as p, a5 as d } from "./index-D04CeeYu.js";
1
+ import { a4 as p, a5 as d } from "./index-CE3n5pQz.js";
2
2
  function g(t) {
3
3
  if (t == null) return !0;
4
4
  const e = t, n = e.id?.code;
@@ -1,4 +1,4 @@
1
- import { d as L, j as x, a6 as A, a7 as E, a8 as d, a9 as h, aa as u, ab as z, p as V, W as Z, G as D } from "./index-D04CeeYu.js";
1
+ import { d as L, j as x, a6 as A, a7 as E, a8 as d, a9 as h, aa as u, ab as z, p as V, W as Z, G as D } from "./index-CE3n5pQz.js";
2
2
  const c = Math.PI / 180, G = 180 / Math.PI;
3
3
  function w(l, t = 0) {
4
4
  const a = Math.min(180, l) * c;
@@ -1,4 +1,4 @@
1
- import { al as P, am as T, an as N, ao as Z, c as B, ap as E, aq as C, ar as b, as as D, at as I, au as O } from "./index-D04CeeYu.js";
1
+ import { al as P, am as T, an as N, ao as Z, c as B, ap as E, aq as C, ar as b, as as D, at as I, au as O } from "./index-CE3n5pQz.js";
2
2
  import { N as _, c as H } from "./hillshade-apron-Bem3DWyJ.js";
3
3
  import { p as $, h as j, m as A, a as U } from "./hillshade-shader-DI2uLSNU.js";
4
4
  function R(t, e, o) {
@@ -1,4 +1,4 @@
1
- import { aB as tt, aC as et, aD as j, at as nt, au as ot, aE as B, aF as rt, aG as U, aq as st, ar as _, aH as C, aI as it } from "./index-D04CeeYu.js";
1
+ import { aB as tt, aC as et, aD as j, at as nt, au as ot, aE as B, aF as rt, aG as U, aq as st, ar as _, aH as C, aI as it } from "./index-CE3n5pQz.js";
2
2
  const J = Math.PI / 180, T = tt * J;
3
3
  function Q(t, r) {
4
4
  const n = Math.max(Math.cos(r * J), 1e-6);