@nika-js/onlymap 0.10.10 → 0.11.1

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 (52) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +14 -2
  3. package/dist/{basemap-BH76eQA0.js → basemap-CHFwxaRT.js} +2 -2
  4. package/dist/cluster-index.d.ts +77 -0
  5. package/dist/cluster-options.d.ts +95 -0
  6. package/dist/cluster-thumbs.d.ts +68 -0
  7. package/dist/ctx.d.ts +2 -0
  8. package/dist/elements/om-map.d.ts +6 -0
  9. package/dist/{geoparquet-DzKLe-0r.js → geoparquet-DBzSJJz_.js} +1 -1
  10. package/dist/{globe-view-B-prUQFh.js → globe-view-D0eDmIGO.js} +1 -1
  11. package/dist/{hillshade-CDng2Jsi.js → hillshade-DodGS9DL.js} +1 -1
  12. package/dist/html-data.d.ts +1 -1
  13. package/dist/{index-D86S8KJ1.js → index-5iFHs_bW.js} +1 -1
  14. package/dist/{index-Rvd-zFrS.js → index-BGvTOkkE.js} +1 -1
  15. package/dist/{index-CpLydTmE.js → index-C7Tpf_BA.js} +1 -1
  16. package/dist/{index-DOfIeNux.js → index-Ca5y3OLs.js} +1 -1
  17. package/dist/{index-cwieLGSg.js → index-CrnprTab.js} +1 -1
  18. package/dist/{index-DvEcTZ4i.js → index-D04CeeYu.js} +17702 -16467
  19. package/dist/{index-CIo8LgRZ.js → index-DH1_IQmW.js} +3 -3
  20. package/dist/{index-laD2SEAB.js → index-em-_HmNV.js} +3 -3
  21. package/dist/{index-8Fj-yh7f.js → index-wRR0a71N.js} +2 -2
  22. package/dist/ir-snapshot.d.ts +10 -0
  23. package/dist/ir.d.ts +9 -0
  24. package/dist/layer-registry.d.ts +8 -0
  25. package/dist/layers/cluster-layer.d.ts +136 -0
  26. package/dist/{lerc-BJB4-X6n.js → lerc-KZgSVKKQ.js} +1 -1
  27. package/dist/onlymap.standalone.js +36288 -35053
  28. package/dist/onlymapjs.js +1 -1
  29. package/dist/{post-process-effect-Bd5plkno.js → post-process-effect-eJXo3MSl.js} +1 -1
  30. package/dist/programmatic.d.ts +6 -0
  31. package/dist/{raster-DJ6vvro6.js → raster-CHuauCiR.js} +3 -3
  32. package/dist/{raster-pipeline-BQhNhrPq.js → raster-pipeline-Coou2lF-.js} +1 -1
  33. package/dist/runtime-core.d.ts +24 -0
  34. package/dist/{text-on-path-CrqchF3O.js → text-on-path-DUfdTGzX.js} +1 -1
  35. package/dist/version.d.ts +1 -1
  36. package/dist/{zarr-oAkG7ZLM.js → zarr-BYLzFMeQ.js} +2 -2
  37. package/docs/cartograph.md +2 -2
  38. package/llms.txt +3 -2
  39. package/onlymapjs.attributes.json +42 -0
  40. package/onlymapjs.html-data.json +80 -0
  41. package/package.json +7 -3
  42. package/skills/onlymapjs/SKILL.md +3 -2
  43. package/skills/onlymapjs/references/react.md +1 -0
  44. package/skills/onlymapjs/references/syntax.md +50 -2
  45. package/docs/design/arrows.md +0 -182
  46. package/docs/design/carto-substrate.md +0 -1067
  47. package/docs/design/cog-v2.md +0 -223
  48. package/docs/design/extensions.md +0 -250
  49. package/docs/design/frame-sources.md +0 -229
  50. package/docs/design/hillshade.md +0 -290
  51. package/docs/design/paced-flyby.md +0 -42
  52. package/docs/design/trace-link-failure.md +0 -20
@@ -1,6 +1,6 @@
1
- import { ac as j, ad as S, ae as A, af as M, ag as L } from "./index-DvEcTZ4i.js";
2
- import { ah as H, ai as V, aj as X, ak as K } from "./index-DvEcTZ4i.js";
3
- import { P as h } from "./post-process-effect-Bd5plkno.js";
1
+ import { ac as j, ad as S, ae as A, af as M, ag as L } from "./index-D04CeeYu.js";
2
+ import { ah as H, ai as V, aj as X, ak as K } from "./index-D04CeeYu.js";
3
+ import { P as h } from "./post-process-effect-eJXo3MSl.js";
4
4
  const O = `
5
5
  float omfx_lum(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); }
6
6
  float omfx_hash(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
@@ -1,6 +1,6 @@
1
- import { A as t, a as o, b as i, C as l, c as p, d as n, D as _, e as c, f as g, F as h, L as m, g as L, h as y, i as f, j as w, M as S, k as V, O as b, l as C, m as E, P as I, T as P, n as T, o as M, U as d, V as A, p as O, q as u, W as N, r as k, s as x, t as D, u as G, G as R, v as j, w as W, x as q, y as v, z, B as F, E as U, H as Y, I as B, J as H, K as J, N as K, Q, R as X, S as Z, X as $, Y as aa, Z as sa, _ as ea, $ as ra, a0 as ta, a1 as oa, a2 as ia } from "./index-DvEcTZ4i.js";
2
- import { P as s } from "./post-process-effect-Bd5plkno.js";
3
- import { G as pa, a as na } from "./globe-view-B-prUQFh.js";
1
+ import { A as t, a as o, b as i, C as l, c as p, d as n, D as _, e as c, f as g, F as h, L as m, g as L, h as y, i as f, j as w, M as S, k as V, O as b, l as C, m as E, P as I, T as P, n as T, o as M, U as d, V as A, p as O, q as u, W as N, r as k, s as x, t as D, u as G, G as R, v as j, w as W, x as q, y as v, z, B as F, E as U, H as Y, I as B, J as H, K as J, N as K, Q, R as X, S as Z, X as $, Y as aa, Z as sa, _ as ea, $ as ra, a0 as ta, a1 as oa, a2 as ia } from "./index-D04CeeYu.js";
2
+ import { P as s } from "./post-process-effect-eJXo3MSl.js";
3
+ import { G as pa, a as na } from "./globe-view-D0eDmIGO.js";
4
4
  export {
5
5
  t as AmbientLight,
6
6
  o as Attribute,
@@ -1,5 +1,5 @@
1
- import { aM as R, aN as S, aO as E, aP as N, aQ as h, aR as w, aS as W, aT as O, aU as x, aV as I, aW as B, aX as _, aY as P, aZ as k, a_ as $, a$ as z, b0 as C, b1 as F, b2 as v, b3 as M, b4 as p, b5 as U } from "./index-DvEcTZ4i.js";
2
- import { b6 as $e, b7 as ze, b8 as Ce, b9 as ve, ba as Me, bb as Ue, bc as je, bd as De, be as qe, bf as Je, bg as Ve, bh as Ge, bi as He, bj as Qe, bk as Xe, bl as Ye, bm as Ze, bn as Ke, bo as et, bp as tt, bq as nt, br as rt, bs as at, bt as st, bu as ot } from "./index-DvEcTZ4i.js";
1
+ import { aM as R, aN as S, aO as E, aP as N, aQ as h, aR as w, aS as W, aT as O, aU as x, aV as I, aW as B, aX as _, aY as P, aZ as k, a_ as $, a$ as z, b0 as C, b1 as F, b2 as v, b3 as M, b4 as p, b5 as U } from "./index-D04CeeYu.js";
2
+ import { b6 as $e, b7 as ze, b8 as Ce, b9 as ve, ba as Me, bb as Ue, bc as je, bd as De, be as qe, bf as Je, bg as Ve, bh as Ge, bi as He, bj as Qe, bk as Xe, bl as Ye, bm as Ze, bn as Ke, bo as et, bp as tt, bq as nt, br as rt, bs as at, bt as st, bu as ot } from "./index-D04CeeYu.js";
3
3
  import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
4
4
  async function q(t, e, n = {}, r = {}) {
5
5
  const a = R(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
@@ -43,6 +43,16 @@ export interface LayerIRSnapshot {
43
43
  terrain?: "drape" | "offset" | "off";
44
44
  /** Per-layer zoom visibility (`visible-zoom-range`) when authored — hidden outside min ≤ zoom < max. */
45
45
  visibleZoomRange?: [number, number];
46
+ /** The `cluster` toggle's options when on (docs/design/clustering.md) — the JSON-safe part; its accessors appear under `clusterAccessors` as fingerprints. */
47
+ cluster?: {
48
+ radius: number;
49
+ maxZoom: number;
50
+ minPoints: number;
51
+ properties?: string;
52
+ click: string;
53
+ label: boolean;
54
+ };
55
+ clusterAccessors?: Record<string, string>;
46
56
  /**
47
57
  * Resolved deck.gl props, made JSON-safe: compiled accessors appear as
48
58
  * their updateTrigger fingerprint (`[accessor <shape>|<source>]`), other
package/dist/ir.d.ts CHANGED
@@ -15,6 +15,7 @@ export interface LayerMeta {
15
15
  export type { Shape } from "./expr";
16
16
  import type { Shape } from "./expr";
17
17
  import type { LegendSpec } from "./legend-spec";
18
+ import type { ClusterOptions } from "./cluster-options";
18
19
  /**
19
20
  * Columnar (GeoArrow-style) data: one array per field instead of one object
20
21
  * per row (spec: "Columnar / GeoArrow Ingestion"). Produced by the Data
@@ -144,4 +145,12 @@ export interface LayerIR {
144
145
  * fall back to deck.gl's default (no-recompute-on-identity-change) behaviour.
145
146
  */
146
147
  updateTriggers: Record<string, string>;
148
+ /**
149
+ * The `cluster` toggle's resolved options (docs/design/clustering.md) —
150
+ * present only when `cluster="true"` on a point-capable type. `props` and
151
+ * `updateTriggers` never contain the `cluster-*` props: both front-ends
152
+ * route them here, and the renderer swaps in `ClusterLayer` around the
153
+ * host class when this is set.
154
+ */
155
+ cluster?: ClusterOptions;
147
156
  }
@@ -93,6 +93,14 @@ export interface LayerSchema {
93
93
  * a type-name check in the renderer.
94
94
  */
95
95
  warpsInPlane?: boolean;
96
+ /**
97
+ * Point-capable type that accepts the `cluster` toggle
98
+ * (docs/design/clustering.md): its schema carries the `cluster-*`
99
+ * descriptors and the runtime swaps in `ClusterLayer` when
100
+ * `LayerIR.cluster` is set — a flag here for the same reason
101
+ * `carriesTileset` is one, so "which types cluster" has a single home.
102
+ */
103
+ clusters?: boolean;
96
104
  }
97
105
  /**
98
106
  * Layer types whose geometry comes from a WEB MERCATOR TILE PYRAMID.
@@ -0,0 +1,136 @@
1
+ /**
2
+ * ClusterLayer — what a point layer becomes when `cluster="true"` is set
3
+ * (docs/design/clustering.md). A `CompositeLayer` in the RouteLayer /
4
+ * TrackingLayer mould: it wraps REAL deck layers rather than adding a
5
+ * rendering path.
6
+ *
7
+ * leaves the host class (Scatterplot/GeoJson/Icon) drawing the points that
8
+ * stand alone at this zoom, with the host's own props verbatim —
9
+ * so `get-fill-color`, `radius`, `filter-*`, transitions all apply
10
+ * to unclustered points exactly as they would without the toggle;
11
+ * bubbles a ScatterplotLayer per cluster, styled by `get-cluster-*`;
12
+ * labels a TextLayer with the count.
13
+ *
14
+ * The index (src/cluster-index.ts) is rebuilt only when the data, the
15
+ * position accessor or a clustering option changes; the visible set is
16
+ * re-queried when the integer zoom changes or the viewport leaves the last
17
+ * padded query box. Cluster rows are re-shaped to the host's data shape
18
+ * (flat object, GeoJSON Feature, or columnar) so the SAME expression
19
+ * compiler serves `$count` on a bubble and `$mag` on a point.
20
+ *
21
+ * Picking: a leaf pick is remapped to the ORIGINAL row and index (the host's
22
+ * index space, so `highlighted-id`, columnar materialisation and
23
+ * `zoom-to-feature` keep working); a bubble pick returns the cluster row with
24
+ * `cluster: true`, `cluster_id`, `count` and the aggregates. The runtime's
25
+ * default click-to-expand and `expand-cluster` read `expansionZoom()` here.
26
+ */
27
+ import { CompositeLayer } from "@deck.gl/core";
28
+ import type { Layer, UpdateParameters, GetPickingInfoParams, PickingInfo } from "@deck.gl/core";
29
+ import { ClusterIndex, type ClusterRow, type ClusterAggregate } from "../cluster-index";
30
+ import { ThumbnailCache } from "../cluster-thumbs";
31
+ import type { Shape } from "../expr";
32
+ import type { LayerData, ColumnarData } from "../ir";
33
+ type Bbox = [number, number, number, number];
34
+ export interface ClusterLayerProps {
35
+ data: LayerData;
36
+ shape: Shape;
37
+ /** The layer type the toggle sits on; draws the leaves. */
38
+ hostClass: new (props: Record<string, unknown>) => Layer;
39
+ /** The host's fully resolved props (accessors compiled, defaults applied) — never includes the cluster props. */
40
+ hostProps: Record<string, unknown>;
41
+ hostUpdateTriggers: Record<string, string>;
42
+ clusterRadius: number;
43
+ clusterMaxZoom: number;
44
+ clusterMinPoints: number;
45
+ aggregates: readonly ClusterAggregate[];
46
+ clusterLabel: boolean;
47
+ getClusterRadius?: unknown;
48
+ getClusterFillColor?: unknown;
49
+ getClusterLineColor?: unknown;
50
+ getClusterLabel?: unknown;
51
+ /**
52
+ * An image on the bubble (0.11.1): a URL → a circular thumbnail ringed in
53
+ * the bubble's fill (cluster-thumbs.ts); a name → a glyph from
54
+ * `clusterIconAtlas`/`clusterIconMapping`, or the host's own atlas on an
55
+ * IconLayer; an `{url, width, height}` object → handed to deck as is.
56
+ * A bubble whose image is still loading, or failed, draws as the circle.
57
+ */
58
+ getClusterIcon?: unknown;
59
+ clusterIconAtlas?: string;
60
+ clusterIconMapping?: Record<string, unknown>;
61
+ clusterUpdateTriggers: Record<string, string>;
62
+ /** Fired after each index build — the dev panel reports rows the index could not place. */
63
+ onClusterIndex?: (info: {
64
+ total: number;
65
+ skipped: number;
66
+ }) => void;
67
+ [prop: string]: unknown;
68
+ }
69
+ interface ClusterState {
70
+ /** deck's `SharedLayerState` index signature — the fields below are the ones this layer owns. */
71
+ [key: string]: unknown;
72
+ index?: ClusterIndex;
73
+ /** The integer zoom and padded bbox the current visible set was queried for. */
74
+ z?: number;
75
+ bbox?: Bbox;
76
+ clusters: ClusterRow[];
77
+ leaves: number[];
78
+ /** `clusters` re-shaped to the host's data shape, and the leaf rows/columns the host sublayer draws. */
79
+ clusterData: unknown[] | ColumnarData;
80
+ leafData: unknown[] | ColumnarData;
81
+ /** Thumbnail renders for `getClusterIcon` URLs; bumped `thumbsVersion` is the icon sublayer's update trigger. */
82
+ thumbs?: ThumbnailCache;
83
+ thumbsVersion?: number;
84
+ /** For a bubble pick: the circle sublayer draws a SUBSET once some bubbles carry images, so its index maps back here. */
85
+ circleClusterIndex?: number[];
86
+ }
87
+ /** Position of row `i` — through the host's accessor when it has one, else the feature's own Point geometry. */
88
+ export declare function positionLookup(data: LayerData, shape: Shape, getPosition: unknown): (i: number) => readonly number[] | undefined;
89
+ /**
90
+ * Cluster rows in the host's data shape, so the host-shaped `get-cluster-*`
91
+ * accessors read them: GeoJSON hosts get Features (`$count` →
92
+ * `properties.count`), columnar hosts get columns, flat hosts the rows as-is.
93
+ */
94
+ export declare function toHostShape(clusters: readonly ClusterRow[], shape: Shape): unknown[] | ColumnarData;
95
+ /** The rows at `indices`, keeping the host's shape (a columnar host gets sliced columns). */
96
+ export declare function sliceRows(data: LayerData, indices: readonly number[]): unknown[] | ColumnarData;
97
+ /** The bubble fill when no `get-cluster-fill-color` is authored: the host's constant fill, else a flat blue. */
98
+ export declare function fallbackClusterFill(hostProps: Record<string, unknown>): number[];
99
+ export declare class ClusterLayer extends CompositeLayer<ClusterLayerProps> {
100
+ static layerName: string;
101
+ static defaultProps: {
102
+ clusterRadius: number;
103
+ clusterMaxZoom: number;
104
+ clusterMinPoints: number;
105
+ aggregates: never[];
106
+ clusterLabel: boolean;
107
+ hostProps: {};
108
+ hostUpdateTriggers: {};
109
+ clusterUpdateTriggers: {};
110
+ };
111
+ state: ClusterState;
112
+ initializeState(): void;
113
+ /** The per-cluster value of a `get-cluster-*` accessor (or its constant), read in the host's data shape. */
114
+ private clusterValue;
115
+ /**
116
+ * What `get-cluster-icon` gives cluster `i`, resolved: a ready thumbnail
117
+ * for a URL, an atlas glyph name, a raw icon object — or undefined when the
118
+ * bubble should draw as a circle (no accessor, no value, image not ready).
119
+ */
120
+ private iconFor;
121
+ private hasGlyphAtlas;
122
+ /** The default only reacts to props/data; the visible set depends on the viewport too. */
123
+ shouldUpdateState({ changeFlags }: UpdateParameters<this>): boolean;
124
+ updateState({ props, oldProps, changeFlags }: UpdateParameters<this>): void;
125
+ /** Re-query only when the integer zoom changed or the view left the last padded box. */
126
+ private refreshVisible;
127
+ /** The zoom a cluster splits at — read by click-to-expand. */
128
+ expansionZoom(clusterId: number): number | undefined;
129
+ /** Original row indices inside a cluster. */
130
+ clusterLeaves(clusterId: number, limit?: number, offset?: number): number[];
131
+ getPickingInfo({ info, sourceLayer }: GetPickingInfoParams): PickingInfo;
132
+ renderLayers(): Layer[];
133
+ /** The count text when no `get-cluster-label` compiled (any shape). */
134
+ private labelOf;
135
+ }
136
+ export {};
@@ -1,4 +1,4 @@
1
- import { C as o, D as s } from "./raster-DJ6vvro6.js";
1
+ import { C as o, D as s } from "./raster-CHuauCiR.js";
2
2
  var t;
3
3
  (function(e) {
4
4
  e[e.None = 0] = "None", e[e.Deflate = 1] = "Deflate", e[e.Zstd = 2] = "Zstd";