@nika-js/onlymap 0.10.9 → 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.
- package/CHANGELOG.md +18 -0
- package/README.md +15 -3
- package/dist/{basemap-B2VvspL4.js → basemap-Bg73oXUb.js} +2 -2
- package/dist/cartograph/element-base.d.ts +9 -0
- package/dist/cartograph/elements/om-legend.d.ts +4 -0
- package/dist/cartograph.js +517 -495
- package/dist/cartograph.standalone.js +1307 -1285
- package/dist/cluster-index.d.ts +77 -0
- package/dist/cluster-options.d.ts +92 -0
- package/dist/ctx.d.ts +2 -0
- package/dist/elements/om-map.d.ts +6 -0
- package/dist/{geoparquet-BJQC6zwS.js → geoparquet-BASBa9tf.js} +1 -1
- package/dist/{globe-view-C3Gaf--d.js → globe-view-CTkofOiM.js} +1 -1
- package/dist/{hillshade-CNtzlYlz.js → hillshade-DdVEO8lc.js} +1 -1
- package/dist/html-data.d.ts +1 -1
- package/dist/{index-CQdTYZ08.js → index-BCDmJfeb.js} +3 -3
- package/dist/{index-j_Ojvo4x.js → index-BLfj5bIo.js} +1 -1
- package/dist/{index-Cp2kquh5.js → index-BOjo5N6i.js} +1 -1
- package/dist/{index-DPEWcZeV.js → index-C-YAnesV.js} +17527 -16473
- package/dist/{index-CI0vdi2E.js → index-C7CNrOGW.js} +1 -1
- package/dist/{index-a-wOE5hE.js → index-CVAyXg52.js} +1 -1
- package/dist/{index-D2RzlXff.js → index-DbfTOgYl.js} +1 -1
- package/dist/{index-m3UsmxCq.js → index-DsLNa_IB.js} +2 -2
- package/dist/{index-C3S0FWlc.js → index-FtNZZGWv.js} +3 -3
- package/dist/ir-snapshot.d.ts +10 -0
- package/dist/ir.d.ts +9 -0
- package/dist/layer-registry.d.ts +8 -0
- package/dist/layers/cluster-layer.d.ts +111 -0
- package/dist/{lerc-Bv4RLXha.js → lerc-CoNq0xxX.js} +1 -1
- package/dist/onlymap.standalone.js +35944 -34890
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-Cpbyy4I3.js → post-process-effect-CrZoIEYa.js} +1 -1
- package/dist/programmatic.d.ts +6 -0
- package/dist/{raster-D_HU2WuR.js → raster-CZMdghdy.js} +3 -3
- package/dist/{raster-pipeline-BmcWLImS.js → raster-pipeline-n2wrLc9r.js} +1 -1
- package/dist/runtime-core.d.ts +24 -0
- package/dist/{text-on-path-ClLwT2eS.js → text-on-path-CHkHjky-.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-CCCIYwWt.js → zarr-DRBhsEZZ.js} +2 -2
- package/docs/cartograph.md +13 -7
- package/llms.txt +3 -2
- package/onlymapjs.attributes.json +33 -0
- package/onlymapjs.html-data.json +113 -1
- package/package.json +7 -3
- package/skills/onlymapjs/SKILL.md +3 -2
- package/skills/onlymapjs/references/react.md +1 -0
- package/skills/onlymapjs/references/syntax.md +48 -2
- package/docs/design/arrows.md +0 -182
- package/docs/design/carto-substrate.md +0 -1067
- package/docs/design/cog-v2.md +0 -223
- package/docs/design/extensions.md +0 -250
- package/docs/design/frame-sources.md +0 -229
- package/docs/design/hillshade.md +0 -290
- package/docs/design/paced-flyby.md +0 -42
- package/docs/design/trace-link-failure.md +0 -20
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { LayerData } from "./ir";
|
|
2
|
+
import type { Shape } from "./expr";
|
|
3
|
+
export declare const CLUSTER_AGGREGATE_OPS: readonly ["sum", "min", "max", "mean", "mode"];
|
|
4
|
+
export type ClusterAggregateOp = (typeof CLUSTER_AGGREGATE_OPS)[number];
|
|
5
|
+
export interface ClusterAggregate {
|
|
6
|
+
op: ClusterAggregateOp;
|
|
7
|
+
field: string;
|
|
8
|
+
/** `${op}_${field}` — the name the cluster row carries. */
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* `"sum:mag, max:mag"` → aggregates. Malformed entries are reported through
|
|
13
|
+
* `warn` and skipped, never thrown: a bad aggregate must not take the map
|
|
14
|
+
* down with it (the validator repeats the same diagnosis structurally).
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseClusterProperties(raw: string | undefined | null, warn?: (message: string) => void): ClusterAggregate[];
|
|
17
|
+
export interface ClusterIndexOptions {
|
|
18
|
+
/** Cluster radius in screen pixels (MapLibre's `clusterRadius`; default 50). */
|
|
19
|
+
radius: number;
|
|
20
|
+
/** Highest zoom at which clusters still form (default 16). */
|
|
21
|
+
maxZoom: number;
|
|
22
|
+
/** Fewest points that make a cluster (default 2). */
|
|
23
|
+
minPoints: number;
|
|
24
|
+
aggregates: readonly ClusterAggregate[];
|
|
25
|
+
shape: Shape;
|
|
26
|
+
}
|
|
27
|
+
/** One cluster as a flat row — the layer re-shapes it to the host's data shape. */
|
|
28
|
+
export interface ClusterRow {
|
|
29
|
+
cluster: true;
|
|
30
|
+
cluster_id: number;
|
|
31
|
+
count: number;
|
|
32
|
+
/** `12`, `1.2k` — always a string, because a TextLayer drops numbers. */
|
|
33
|
+
count_abbreviated: string;
|
|
34
|
+
count_total: number;
|
|
35
|
+
count_max: number;
|
|
36
|
+
zoom: number;
|
|
37
|
+
position: [number, number];
|
|
38
|
+
/** `${op}_${field}` values plus `${op}_${field}_max` / `_min` at this zoom. */
|
|
39
|
+
[aggregate: string]: unknown;
|
|
40
|
+
}
|
|
41
|
+
export interface ClusterQuery {
|
|
42
|
+
clusters: ClusterRow[];
|
|
43
|
+
/** Original row indices of the points that stand alone at this zoom. */
|
|
44
|
+
leaves: number[];
|
|
45
|
+
}
|
|
46
|
+
/** Dataset-wide extremes at one zoom: `count_max` plus `<agg>_max`/`<agg>_min`. */
|
|
47
|
+
export type ClusterMaxima = Record<string, number>;
|
|
48
|
+
export declare class ClusterIndex {
|
|
49
|
+
private readonly data;
|
|
50
|
+
private readonly options;
|
|
51
|
+
private readonly index;
|
|
52
|
+
private readonly maximaByZoom;
|
|
53
|
+
/** Rows the position lookup could not place (non-finite or missing) — surfaced, never thrown. */
|
|
54
|
+
readonly skipped: number;
|
|
55
|
+
/** Points actually indexed. */
|
|
56
|
+
readonly total: number;
|
|
57
|
+
constructor(data: LayerData, positionOf: (index: number) => readonly number[] | undefined, options: ClusterIndexOptions);
|
|
58
|
+
/** The accumulator a single point contributes. */
|
|
59
|
+
private seed;
|
|
60
|
+
/** Fold `props` into `acc` (supercluster mutates the accumulator in place). */
|
|
61
|
+
private merge;
|
|
62
|
+
/** Aggregates in their final form: means divided, modes resolved to the winning value. */
|
|
63
|
+
private finalize;
|
|
64
|
+
private clampZoom;
|
|
65
|
+
/**
|
|
66
|
+
* Dataset-wide extremes at `zoom`, cached: `count_max` (1 when nothing
|
|
67
|
+
* clusters at this zoom, so a division by it is always defined) and, per
|
|
68
|
+
* aggregate, `<name>_max`/`<name>_min` over the clusters that exist.
|
|
69
|
+
*/
|
|
70
|
+
maxima(zoom: number): ClusterMaxima;
|
|
71
|
+
/** Clusters and standalone points inside `bbox` ([west, south, east, north]) at `zoom`. */
|
|
72
|
+
query(bbox: readonly [number, number, number, number], zoom: number): ClusterQuery;
|
|
73
|
+
/** Original row indices inside a cluster (paged like supercluster's own `getLeaves`). */
|
|
74
|
+
leaves(clusterId: number, limit?: number, offset?: number): number[];
|
|
75
|
+
/** The zoom at which this cluster splits — what click-to-expand flies to. */
|
|
76
|
+
expansionZoom(clusterId: number): number;
|
|
77
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `cluster` toggle's authoring surface (docs/design/clustering.md).
|
|
3
|
+
*
|
|
4
|
+
* Clustering is a toggle on the three point-capable layer types, not a layer
|
|
5
|
+
* type of its own: `cluster="true"` on a ScatterplotLayer keeps the layer's
|
|
6
|
+
* id, data, symbology, picking and actions, and only changes which symbols
|
|
7
|
+
* exist per zoom. The attributes below are therefore REGISTERED on those
|
|
8
|
+
* schemas (so attribute resolution, validation, IntelliSense and the
|
|
9
|
+
* programmatic lane all see them through the ordinary PropDescriptor path)
|
|
10
|
+
* and then ROUTED OUT of the deck prop bag into `LayerIR.cluster` by
|
|
11
|
+
* `extractClusterOptions`, so the host class never receives them. The
|
|
12
|
+
* reconciler swaps in `ClusterLayer` (src/layers/cluster-layer.ts) when the
|
|
13
|
+
* IR carries them.
|
|
14
|
+
*
|
|
15
|
+
* Names follow MapLibre's GeoJSON-source options (`cluster`, `clusterRadius`,
|
|
16
|
+
* `clusterMaxZoom`, `clusterMinPoints`, `clusterProperties`) — the names a
|
|
17
|
+
* translated manifest already carries.
|
|
18
|
+
*/
|
|
19
|
+
import type { PropDescriptor } from "./layer-registry";
|
|
20
|
+
import type { Shape } from "./expr";
|
|
21
|
+
import type { LayerData } from "./ir";
|
|
22
|
+
import { type ClusterAggregate } from "./cluster-index";
|
|
23
|
+
/** Layer types the toggle is registered on. Point-only by construction (D7). */
|
|
24
|
+
export declare const CLUSTER_CAPABLE_TYPES: readonly string[];
|
|
25
|
+
export declare const CLUSTER_ATTR = "cluster";
|
|
26
|
+
export declare const CLUSTER_CLICK_VALUES: readonly ["expand", "none"];
|
|
27
|
+
export type ClusterClick = (typeof CLUSTER_CLICK_VALUES)[number];
|
|
28
|
+
export declare const CLUSTER_DEFAULTS: {
|
|
29
|
+
radius: number;
|
|
30
|
+
maxZoom: number;
|
|
31
|
+
minPoints: number;
|
|
32
|
+
click: ClusterClick;
|
|
33
|
+
label: boolean;
|
|
34
|
+
};
|
|
35
|
+
/** The eased duration of click-to-expand and of `expand-cluster` when no `duration` is authored. */
|
|
36
|
+
export declare const CLUSTER_EXPAND_MS = 600;
|
|
37
|
+
/**
|
|
38
|
+
* The default bubble size — self-normalising per zoom: the largest cluster at
|
|
39
|
+
* any zoom is 36 px and the rest scale by the square root of their share
|
|
40
|
+
* (area ∝ count). `count_max` is the dataset-wide maximum at the cluster's own
|
|
41
|
+
* zoom (cluster-index.ts), so this never collapses to the minimum as the
|
|
42
|
+
* reader zooms in the way a literal count domain would.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DEFAULT_CLUSTER_RADIUS_EXPR = "scale($count / $count_max, sqrt, [12, 36], domain=[0, 1])";
|
|
45
|
+
export declare const DEFAULT_CLUSTER_LINE_COLOR_EXPR = "'#ffffff'";
|
|
46
|
+
export declare const DEFAULT_CLUSTER_LABEL_EXPR = "$count_abbreviated";
|
|
47
|
+
/** The accessor props a cluster row is styled through — `getCluster*`, never the host's own. */
|
|
48
|
+
export declare const CLUSTER_ACCESSOR_PROPS: readonly ["getClusterRadius", "getClusterFillColor", "getClusterLineColor", "getClusterLabel"];
|
|
49
|
+
export type ClusterAccessorProp = (typeof CLUSTER_ACCESSOR_PROPS)[number];
|
|
50
|
+
/**
|
|
51
|
+
* Registered onto every CLUSTER_CAPABLE type (layer-registry.ts). `deckProp`
|
|
52
|
+
* is the prop-bag key extraction looks for; none of these ever reaches deck.
|
|
53
|
+
*/
|
|
54
|
+
export declare const CLUSTER_PROP_DESCRIPTORS: readonly PropDescriptor[];
|
|
55
|
+
/** Every prop-bag key the toggle owns — what extraction removes from the host's props. */
|
|
56
|
+
export declare const CLUSTER_PROP_KEYS: readonly string[];
|
|
57
|
+
export type ClusterAccessor = (row: unknown, info: {
|
|
58
|
+
index: number;
|
|
59
|
+
data: unknown;
|
|
60
|
+
}) => unknown;
|
|
61
|
+
/** What `LayerIR.cluster` carries — everything ClusterLayer needs beyond the host's own props. */
|
|
62
|
+
export interface ClusterOptions {
|
|
63
|
+
radius: number;
|
|
64
|
+
maxZoom: number;
|
|
65
|
+
minPoints: number;
|
|
66
|
+
/** The authored `cluster-properties` text, kept for snapshots and diagnostics. */
|
|
67
|
+
properties?: string;
|
|
68
|
+
aggregates: ClusterAggregate[];
|
|
69
|
+
click: ClusterClick;
|
|
70
|
+
label: boolean;
|
|
71
|
+
/** Compiled `get-cluster-*` accessors (through the same cache as the host's). */
|
|
72
|
+
accessors: Partial<Record<ClusterAccessorProp, ClusterAccessor | unknown>>;
|
|
73
|
+
/** Their update-trigger fingerprints, keyed like `accessors`. */
|
|
74
|
+
updateTriggers: Partial<Record<ClusterAccessorProp, string>>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Pulls the toggle's props OUT of a resolved prop bag (and their triggers out
|
|
78
|
+
* of `updateTriggers`) — always, so a host layer never sees `clusterRadius`
|
|
79
|
+
* as a deck prop — and returns the options when `cluster` is on.
|
|
80
|
+
*
|
|
81
|
+
* Shared by both front-ends (parse-manifest and the descriptor lane), which is
|
|
82
|
+
* what keeps `<om-layer cluster>` and `<OmLayer cluster>` identical.
|
|
83
|
+
*/
|
|
84
|
+
export declare function extractClusterOptions(props: Record<string, unknown>, updateTriggers: Record<string, string>, warn: (message: string) => void): ClusterOptions | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Point-only enforcement (D7): a GeoJSON layer whose rows carry any geometry
|
|
87
|
+
* other than Point is refused, with the fix. Returns null when clustering
|
|
88
|
+
* can proceed. Flat and columnar rows position through an accessor and are
|
|
89
|
+
* always fine here; a row with no geometry at all is left to the index's
|
|
90
|
+
* own skip count.
|
|
91
|
+
*/
|
|
92
|
+
export declare function clusterGeometryProblem(data: LayerData, shape: Shape): string | null;
|
package/dist/ctx.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export interface LayerMetaSnapshot {
|
|
|
23
23
|
filter?: LayerFilter;
|
|
24
24
|
/** The layer's active categorical filter, if any — independent of `filter`, read by the built-in `filter` widget's categorical mode. */
|
|
25
25
|
categoryFilter?: LayerCategoryFilter;
|
|
26
|
+
/** `cluster="true"` is on (docs/design/clustering.md) — the legend adds a bubble row so the count circles are explained. */
|
|
27
|
+
cluster?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export interface DataOpts {
|
|
28
30
|
/** Set `false` to bypass the layer's active declarative filter (spec: "Filter-aware stats & data (the coherence rule)"). Default `true`. */
|
|
@@ -214,6 +214,12 @@ export declare class OmMapElement extends HTMLElementBase {
|
|
|
214
214
|
setLayerVisible(id: string, visible: boolean): void;
|
|
215
215
|
/** A snapshot of the current layer IRs — the same shape `ctx.layers` is built from. */
|
|
216
216
|
getLayers(): readonly LayerIR[];
|
|
217
|
+
/**
|
|
218
|
+
* The rows inside a cluster bubble on a `cluster` layer (docs/design/clustering.md),
|
|
219
|
+
* flattened like `ctx.selection.object`. `clusterId` is the `cluster_id` a bubble
|
|
220
|
+
* pick carries. Empty when the layer is not clustered right now.
|
|
221
|
+
*/
|
|
222
|
+
clusterLeaves(layerId: string, clusterId: number, limit?: number, offset?: number): unknown[];
|
|
217
223
|
private notifyWidgets;
|
|
218
224
|
private buildCurrentCtx;
|
|
219
225
|
/** Picked object, normalized to flat — GeoJSON properties lifted; columnar rows materialized from columns at the pick index. */
|
|
@@ -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-
|
|
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-C-YAnesV.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-
|
|
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-C-YAnesV.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) {
|
package/dist/html-data.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ interface TagData {
|
|
|
15
15
|
}[];
|
|
16
16
|
}
|
|
17
17
|
/** Hand-authored action list — validated against hasAction() in html-data.test.ts. */
|
|
18
|
-
export declare const BUILTIN_ACTIONS: readonly ["toggle-layer", "set-pickable", "zoom-in", "zoom-out", "filter-layer", "highlight-feature", "fade", "pulse", "populate", "trace", "story-play", "story-pause", "story-seek", "fly-to", "zoom-to-feature", "show-overlay", "hide-overlay", "show-tooltip", "hide-tooltip", "draw-mode", "draw-commit", "draw-cancel", "draw-delete", "draw-clear", "draw-config", "draw-save", "export-region-3d", "measure-mode", "measure-clear", "measure-units", "set-basemap", "set-effect", "set-lighting", "set-terrain", "set-clip-box", "clip-box-edit", "set-widgets-visible", "undo", "redo", "warm-tiles"];
|
|
18
|
+
export declare const BUILTIN_ACTIONS: readonly ["toggle-layer", "set-pickable", "set-layer-attribute", "expand-cluster", "zoom-in", "zoom-out", "filter-layer", "highlight-feature", "fade", "pulse", "populate", "trace", "story-play", "story-pause", "story-seek", "fly-to", "zoom-to-feature", "show-overlay", "hide-overlay", "show-tooltip", "hide-tooltip", "draw-mode", "draw-commit", "draw-cancel", "draw-delete", "draw-clear", "draw-config", "draw-save", "export-region-3d", "measure-mode", "measure-clear", "measure-units", "set-basemap", "set-effect", "set-lighting", "set-terrain", "set-clip-box", "clip-box-edit", "set-widgets-visible", "undo", "redo", "warm-tiles"];
|
|
19
19
|
/** Hand-authored widget types — validated against the widget registry in html-data.test.ts.
|
|
20
20
|
* Declared in `widget-types.ts` so the runtime validator can use it without
|
|
21
21
|
* pulling this 42 KB table into the bundle. */
|
|
@@ -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-
|
|
2
|
-
import { P as s } from "./post-process-effect-
|
|
3
|
-
import { G as pa, a as na } from "./globe-view-
|
|
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-C-YAnesV.js";
|
|
2
|
+
import { P as s } from "./post-process-effect-CrZoIEYa.js";
|
|
3
|
+
import { G as pa, a as na } from "./globe-view-CTkofOiM.js";
|
|
4
4
|
export {
|
|
5
5
|
t as AmbientLight,
|
|
6
6
|
o as Attribute,
|
|
@@ -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-
|
|
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-C-YAnesV.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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bB as Bt, bM as Xt, bN as Yt, bO as Us } from "./index-
|
|
1
|
+
import { bB as Bt, bM as Xt, bN as Yt, bO as Us } from "./index-C-YAnesV.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";
|