@nika-js/onlymap 0.10.10 → 0.11.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 (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +14 -2
  3. package/dist/{basemap-BH76eQA0.js → basemap-Bg73oXUb.js} +2 -2
  4. package/dist/cluster-index.d.ts +77 -0
  5. package/dist/cluster-options.d.ts +92 -0
  6. package/dist/ctx.d.ts +2 -0
  7. package/dist/elements/om-map.d.ts +6 -0
  8. package/dist/{geoparquet-DzKLe-0r.js → geoparquet-BASBa9tf.js} +1 -1
  9. package/dist/{globe-view-B-prUQFh.js → globe-view-CTkofOiM.js} +1 -1
  10. package/dist/{hillshade-CDng2Jsi.js → hillshade-DdVEO8lc.js} +1 -1
  11. package/dist/html-data.d.ts +1 -1
  12. package/dist/{index-laD2SEAB.js → index-BCDmJfeb.js} +3 -3
  13. package/dist/{index-DOfIeNux.js → index-BLfj5bIo.js} +1 -1
  14. package/dist/{index-D86S8KJ1.js → index-BOjo5N6i.js} +1 -1
  15. package/dist/{index-DvEcTZ4i.js → index-C-YAnesV.js} +17527 -16473
  16. package/dist/{index-CpLydTmE.js → index-C7CNrOGW.js} +1 -1
  17. package/dist/{index-Rvd-zFrS.js → index-CVAyXg52.js} +1 -1
  18. package/dist/{index-cwieLGSg.js → index-DbfTOgYl.js} +1 -1
  19. package/dist/{index-8Fj-yh7f.js → index-DsLNa_IB.js} +2 -2
  20. package/dist/{index-CIo8LgRZ.js → index-FtNZZGWv.js} +3 -3
  21. package/dist/ir-snapshot.d.ts +10 -0
  22. package/dist/ir.d.ts +9 -0
  23. package/dist/layer-registry.d.ts +8 -0
  24. package/dist/layers/cluster-layer.d.ts +111 -0
  25. package/dist/{lerc-BJB4-X6n.js → lerc-CoNq0xxX.js} +1 -1
  26. package/dist/onlymap.standalone.js +35944 -34890
  27. package/dist/onlymapjs.js +1 -1
  28. package/dist/{post-process-effect-Bd5plkno.js → post-process-effect-CrZoIEYa.js} +1 -1
  29. package/dist/programmatic.d.ts +6 -0
  30. package/dist/{raster-DJ6vvro6.js → raster-CZMdghdy.js} +3 -3
  31. package/dist/{raster-pipeline-BQhNhrPq.js → raster-pipeline-n2wrLc9r.js} +1 -1
  32. package/dist/runtime-core.d.ts +24 -0
  33. package/dist/{text-on-path-CrqchF3O.js → text-on-path-CHkHjky-.js} +1 -1
  34. package/dist/version.d.ts +1 -1
  35. package/dist/{zarr-oAkG7ZLM.js → zarr-DRBhsEZZ.js} +2 -2
  36. package/docs/cartograph.md +2 -2
  37. package/llms.txt +2 -1
  38. package/onlymapjs.attributes.json +33 -0
  39. package/onlymapjs.html-data.json +68 -0
  40. package/package.json +7 -3
  41. package/skills/onlymapjs/SKILL.md +3 -2
  42. package/skills/onlymapjs/references/react.md +1 -0
  43. package/skills/onlymapjs/references/syntax.md +47 -2
  44. package/docs/design/arrows.md +0 -182
  45. package/docs/design/carto-substrate.md +0 -1067
  46. package/docs/design/cog-v2.md +0 -223
  47. package/docs/design/extensions.md +0 -250
  48. package/docs/design/frame-sources.md +0 -229
  49. package/docs/design/hillshade.md +0 -290
  50. package/docs/design/paced-flyby.md +0 -42
  51. package/docs/design/trace-link-failure.md +0 -20
@@ -1,4 +1,4 @@
1
- import { bx as Be, by as le, bz as ce, bA as De, bB as Oe, bC as ke } from "./index-DvEcTZ4i.js";
1
+ import { bx as Be, by as le, bz as ce, bA as De, bB as Oe, bC as ke } from "./index-C-YAnesV.js";
2
2
  import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as xe, n as je, 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";
@@ -1,4 +1,4 @@
1
- import { aA as B } from "./index-DvEcTZ4i.js";
1
+ import { aA as B } from "./index-C-YAnesV.js";
2
2
  const V = /* @__PURE__ */ new Set([
3
3
  "GeoJsonLayer",
4
4
  "PolygonLayer",
@@ -1,4 +1,4 @@
1
- import { bv as _t, bw as Ct } from "./index-DvEcTZ4i.js";
1
+ import { bv as _t, bw as Ct } from "./index-C-YAnesV.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 { 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-C-YAnesV.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-C-YAnesV.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 };
@@ -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-C-YAnesV.js";
2
+ import { ah as H, ai as V, aj as X, ak as K } from "./index-C-YAnesV.js";
3
+ import { P as h } from "./post-process-effect-CrZoIEYa.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); }
@@ -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,111 @@
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 type { Shape } from "../expr";
31
+ import type { LayerData, ColumnarData } from "../ir";
32
+ type Bbox = [number, number, number, number];
33
+ export interface ClusterLayerProps {
34
+ data: LayerData;
35
+ shape: Shape;
36
+ /** The layer type the toggle sits on; draws the leaves. */
37
+ hostClass: new (props: Record<string, unknown>) => Layer;
38
+ /** The host's fully resolved props (accessors compiled, defaults applied) — never includes the cluster props. */
39
+ hostProps: Record<string, unknown>;
40
+ hostUpdateTriggers: Record<string, string>;
41
+ clusterRadius: number;
42
+ clusterMaxZoom: number;
43
+ clusterMinPoints: number;
44
+ aggregates: readonly ClusterAggregate[];
45
+ clusterLabel: boolean;
46
+ getClusterRadius?: unknown;
47
+ getClusterFillColor?: unknown;
48
+ getClusterLineColor?: unknown;
49
+ getClusterLabel?: unknown;
50
+ clusterUpdateTriggers: Record<string, string>;
51
+ /** Fired after each index build — the dev panel reports rows the index could not place. */
52
+ onClusterIndex?: (info: {
53
+ total: number;
54
+ skipped: number;
55
+ }) => void;
56
+ [prop: string]: unknown;
57
+ }
58
+ interface ClusterState {
59
+ /** deck's `SharedLayerState` index signature — the fields below are the ones this layer owns. */
60
+ [key: string]: unknown;
61
+ index?: ClusterIndex;
62
+ /** The integer zoom and padded bbox the current visible set was queried for. */
63
+ z?: number;
64
+ bbox?: Bbox;
65
+ clusters: ClusterRow[];
66
+ leaves: number[];
67
+ /** `clusters` re-shaped to the host's data shape, and the leaf rows/columns the host sublayer draws. */
68
+ clusterData: unknown[] | ColumnarData;
69
+ leafData: unknown[] | ColumnarData;
70
+ }
71
+ /** Position of row `i` — through the host's accessor when it has one, else the feature's own Point geometry. */
72
+ export declare function positionLookup(data: LayerData, shape: Shape, getPosition: unknown): (i: number) => readonly number[] | undefined;
73
+ /**
74
+ * Cluster rows in the host's data shape, so the host-shaped `get-cluster-*`
75
+ * accessors read them: GeoJSON hosts get Features (`$count` →
76
+ * `properties.count`), columnar hosts get columns, flat hosts the rows as-is.
77
+ */
78
+ export declare function toHostShape(clusters: readonly ClusterRow[], shape: Shape): unknown[] | ColumnarData;
79
+ /** The rows at `indices`, keeping the host's shape (a columnar host gets sliced columns). */
80
+ export declare function sliceRows(data: LayerData, indices: readonly number[]): unknown[] | ColumnarData;
81
+ /** The bubble fill when no `get-cluster-fill-color` is authored: the host's constant fill, else a flat blue. */
82
+ export declare function fallbackClusterFill(hostProps: Record<string, unknown>): number[];
83
+ export declare class ClusterLayer extends CompositeLayer<ClusterLayerProps> {
84
+ static layerName: string;
85
+ static defaultProps: {
86
+ clusterRadius: number;
87
+ clusterMaxZoom: number;
88
+ clusterMinPoints: number;
89
+ aggregates: never[];
90
+ clusterLabel: boolean;
91
+ hostProps: {};
92
+ hostUpdateTriggers: {};
93
+ clusterUpdateTriggers: {};
94
+ };
95
+ state: ClusterState;
96
+ initializeState(): void;
97
+ /** The default only reacts to props/data; the visible set depends on the viewport too. */
98
+ shouldUpdateState({ changeFlags }: UpdateParameters<this>): boolean;
99
+ updateState({ props, oldProps, changeFlags }: UpdateParameters<this>): void;
100
+ /** Re-query only when the integer zoom changed or the view left the last padded box. */
101
+ private refreshVisible;
102
+ /** The zoom a cluster splits at — read by click-to-expand. */
103
+ expansionZoom(clusterId: number): number | undefined;
104
+ /** Original row indices inside a cluster. */
105
+ clusterLeaves(clusterId: number, limit?: number, offset?: number): number[];
106
+ getPickingInfo({ info, sourceLayer }: GetPickingInfoParams): PickingInfo;
107
+ renderLayers(): Layer[];
108
+ /** The count text when no `get-cluster-label` compiled (any shape). */
109
+ private labelOf;
110
+ }
111
+ 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-CZMdghdy.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";