@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.
- package/CHANGELOG.md +13 -0
- package/README.md +14 -2
- package/dist/{basemap-BH76eQA0.js → basemap-Bg73oXUb.js} +2 -2
- 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-DzKLe-0r.js → geoparquet-BASBa9tf.js} +1 -1
- package/dist/{globe-view-B-prUQFh.js → globe-view-CTkofOiM.js} +1 -1
- package/dist/{hillshade-CDng2Jsi.js → hillshade-DdVEO8lc.js} +1 -1
- package/dist/html-data.d.ts +1 -1
- package/dist/{index-laD2SEAB.js → index-BCDmJfeb.js} +3 -3
- package/dist/{index-DOfIeNux.js → index-BLfj5bIo.js} +1 -1
- package/dist/{index-D86S8KJ1.js → index-BOjo5N6i.js} +1 -1
- package/dist/{index-DvEcTZ4i.js → index-C-YAnesV.js} +17527 -16473
- package/dist/{index-CpLydTmE.js → index-C7CNrOGW.js} +1 -1
- package/dist/{index-Rvd-zFrS.js → index-CVAyXg52.js} +1 -1
- package/dist/{index-cwieLGSg.js → index-DbfTOgYl.js} +1 -1
- package/dist/{index-8Fj-yh7f.js → index-DsLNa_IB.js} +2 -2
- package/dist/{index-CIo8LgRZ.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-BJB4-X6n.js → lerc-CoNq0xxX.js} +1 -1
- package/dist/onlymap.standalone.js +35944 -34890
- package/dist/onlymapjs.js +1 -1
- package/dist/{post-process-effect-Bd5plkno.js → post-process-effect-CrZoIEYa.js} +1 -1
- package/dist/programmatic.d.ts +6 -0
- package/dist/{raster-DJ6vvro6.js → raster-CZMdghdy.js} +3 -3
- package/dist/{raster-pipeline-BQhNhrPq.js → raster-pipeline-n2wrLc9r.js} +1 -1
- package/dist/runtime-core.d.ts +24 -0
- package/dist/{text-on-path-CrqchF3O.js → text-on-path-CHkHjky-.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-oAkG7ZLM.js → zarr-DRBhsEZZ.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/llms.txt +2 -1
- package/onlymapjs.attributes.json +33 -0
- package/onlymapjs.html-data.json +68 -0
- 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 +47 -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
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,19 @@ 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.0 — 2026-09-30
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Points that pile up can now be clustered with one attribute.** `cluster="true"` on a `ScatterplotLayer`, a `GeoJsonLayer` of Point features or an `IconLayer` merges the points that would overlap on screen into count bubbles that split apart as the reader zooms in. It is a toggle, not a different layer type: the layer keeps its id, its data, its own colours and sizes for the points that stand alone, its popups and its actions. `cluster-radius`, `cluster-max-zoom` and `cluster-min-points` use the names MapLibre users already know.
|
|
15
|
+
- **Bubbles can say more than a count.** `cluster-properties="sum:capacity_mw,mode:fuel"` carries totals, extremes, means or the commonest category onto each bubble, and `get-cluster-radius`, `get-cluster-fill-color`, `get-cluster-line-color` and `get-cluster-label` style the bubbles with the same expressions the rest of the map uses — a bubble coloured by the fuel most of its plants burn, sized by their combined capacity.
|
|
16
|
+
- **Bubble sizes stay meaningful at every zoom.** Every bubble knows the largest cluster at the current zoom (`$count_max`, and `$sum_x_max` for each aggregate), so the default size keeps the biggest bubble at 36 px whether the reader is looking at a continent or a county, and a custom size or colour ramp can do the same.
|
|
17
|
+
- **A click on a bubble flies to where it splits**, eased, with `cluster-click="none"` to opt out and an `expand-cluster` action to wire it by hand. Hovering or clicking a bubble picks it like any feature — `{{count}}` and the aggregates work in overlays — and `pick="cluster"` / `pick="point"` on `<om-behavior>` gives bubbles and single points their own cards. `map.clusterLeaves(layerId, clusterId)` lists the points inside a bubble. The legend explains the bubbles with a row of its own.
|
|
18
|
+
- **Any layer attribute can be changed at runtime from a widget** with the `set-layer-attribute` action (`{ layer, name, value }`) — the switch behind an on/off button for clustering, or anything else; live, story-capturable and undoable like the other layer actions.
|
|
19
|
+
- **A new example**, *Cluster points*: twenty thousand power plants, a clustering on/off button, bubbles coloured by fuel, a hover summary per bubble, and icons taking over from the circles past z12 with `visible-zoom-range`.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- **The package ships its user guides only.** Working design notes under `docs/design/` were included in earlier tarballs by accident; they are internal planning documents, not documentation, and no longer ship. Nothing that was documented has moved.
|
|
23
|
+
|
|
11
24
|
## 0.10.10 — 2026-09-29
|
|
12
25
|
|
|
13
26
|
### Added
|
package/README.md
CHANGED
|
@@ -137,9 +137,21 @@ Numeric timestamps are always epoch **milliseconds**, never guessed as seconds.
|
|
|
137
137
|
|
|
138
138
|
Private endpoints: `OmMap.configureData({ headers, credentials, fetch })` — applied to every fetch including refreshes. Credentials stay out of markup by design. Full guide: [docs/live-data.md](docs/live-data.md).
|
|
139
139
|
|
|
140
|
+
### Clustering
|
|
141
|
+
|
|
142
|
+
Thousands of points that overlap on screen become count bubbles that split apart as the reader zooms in — one attribute on the layer, not a different layer type:
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<om-layer id="plants" type="ScatterplotLayer" data="./plants.csv" get-position="[$lon, $lat]" color="#2563eb"
|
|
146
|
+
cluster="true" cluster-properties="sum:capacity_mw,mode:fuel"
|
|
147
|
+
get-cluster-fill-color="$mode_fuel == 'Hydro' ? '#0ea5e9' : '#64748b'" pickable></om-layer>
|
|
148
|
+
```
|
|
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"` carries aggregates onto each bubble as `$sum_f`, `$mode_f`…, beside `$count`; `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
|
+
|
|
140
152
|
### Interaction
|
|
141
153
|
|
|
142
|
-
Built-in actions wire to picks, widget buttons (`data-emit`), or script (`ctx.emit`) with one shared payload contract: `show-overlay`, `hide-overlay`, `show-tooltip`, `hide-tooltip`, `toggle-layer`, `set-pickable` (a runtime popups-on/off switch per layer), `highlight-feature`, `zoom-to-feature`, `filter-layer`, `set-basemap`, `set-effect`, `zoom-in`, `zoom-out`, `undo`, `redo` — plus `OmMap.registerAction` for your own.
|
|
154
|
+
Built-in actions wire to picks, widget buttons (`data-emit`), or script (`ctx.emit`) with one shared payload contract: `show-overlay`, `hide-overlay`, `show-tooltip`, `hide-tooltip`, `toggle-layer`, `set-pickable` (a runtime popups-on/off switch per layer), `set-layer-attribute` (write any layer attribute at runtime — the generic switch behind a widget button), `expand-cluster`, `highlight-feature`, `zoom-to-feature`, `filter-layer`, `set-basemap`, `set-effect`, `zoom-in`, `zoom-out`, `undo`, `redo` — plus `OmMap.registerAction` for your own.
|
|
143
155
|
|
|
144
156
|
Hovering a pickable feature shows a pointer cursor automatically, so recipients can tell a map is interactive without clicking at random (`pick-cursor` on `<om-map>` customizes or disables it). Hover GPU picking is rest-debounced by default — one pick when the pointer stops instead of one per mouse move — which keeps hover popups smooth even on integrated graphics; `hover-pick="continuous|off|<ms>"` tunes it.
|
|
145
157
|
|
|
@@ -432,7 +444,7 @@ The library reports one **deployment-scoped** usage snapshot per map per page lo
|
|
|
432
444
|
|
|
433
445
|
## Not implemented yet (honestly)
|
|
434
446
|
|
|
435
|
-
Mapbox GL basemaps, depth-interleaved 3D compositing, globe projection, SSE transport, `dblclick` behaviors, the typed fluent builder, and stories/draw as React components (both work via the HTML manifest). On cartography: relief cannot be masked to land (clipping one layer to another's geometry is layer-extension work), `contour` marches in the DEM's Mercator grid even on a projected sheet (the polylines project exactly; the sampling is what is Mercator), and native-CRS tile pyramids are deferred until asked for. On React Native (`@nika-js/onlymap-native`): stories, draw, widgets, and overlays as native components (build native UI beside the map instead), and bare (non-Expo) React Native until its `0.2.0`. On `pick-features`: instanced (i3dm) tiles keep tile-granularity picking, and `feature-styles`' `opacity` below 1 is still being validated. On BIM: clash detection is bounding-box only (no mesh-level test, and it cannot tell a resolved penetration from a collision), there is no BCF export, no equivalent of Navisworks' Auto Reveal, and prepared tilesets converted before the `bbox*` columns existed cannot take part in a clash pass — `strength` tinting and `opacity: 0` (hide, a shader discard) work. On the measure widget's `volume` mode: the per-cell grid integration measures against the map's active terrain DEM only — measuring against an imported design surface or a previous survey (period-over-period reconciliation) and a cut/fill heat-map overlay are not implemented yet, and a snapped footprint vertex takes the matched feature's horizontal position only — its exact elevation is not threaded through (see **XY snapping** above).
|
|
447
|
+
Mapbox GL basemaps, depth-interleaved 3D compositing, globe projection, SSE transport, `dblclick` behaviors, the typed fluent builder, and stories/draw as React components (both work via the HTML manifest). On clustering: lines and polygons are not clustered by centroid (Point data only), tiled sources (`MVTLayer`/`TileLayer`) do not cluster, and a projected (`crs=`) sheet renders a clustered layer unclustered with a warning. On cartography: relief cannot be masked to land (clipping one layer to another's geometry is layer-extension work), `contour` marches in the DEM's Mercator grid even on a projected sheet (the polylines project exactly; the sampling is what is Mercator), and native-CRS tile pyramids are deferred until asked for. On React Native (`@nika-js/onlymap-native`): stories, draw, widgets, and overlays as native components (build native UI beside the map instead), and bare (non-Expo) React Native until its `0.2.0`. On `pick-features`: instanced (i3dm) tiles keep tile-granularity picking, and `feature-styles`' `opacity` below 1 is still being validated. On BIM: clash detection is bounding-box only (no mesh-level test, and it cannot tell a resolved penetration from a collision), there is no BCF export, no equivalent of Navisworks' Auto Reveal, and prepared tilesets converted before the `bbox*` columns existed cannot take part in a clash pass — `strength` tinting and `opacity: 0` (hide, a shader discard) work. On the measure widget's `volume` mode: the per-cell grid integration measures against the map's active terrain DEM only — measuring against an imported design surface or a previous survey (period-over-period reconciliation) and a cut/fill heat-map overlay are not implemented yet, and a snapped footprint vertex takes the matched feature's horizontal position only — its exact elevation is not threaded through (see **XY snapping** above).
|
|
436
448
|
|
|
437
449
|
## Going deeper
|
|
438
450
|
|
|
@@ -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-
|
|
2
|
-
import { a as ty } from "./globe-view-
|
|
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-C-YAnesV.js";
|
|
2
|
+
import { a as ty } from "./globe-view-CTkofOiM.js";
|
|
3
3
|
var Ou = { exports: {} };
|
|
4
4
|
/**
|
|
5
5
|
* MapLibre GL JS
|
|
@@ -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";
|