@elaraai/east-ui 1.0.13 → 1.0.15
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/dist/src/collections/index.d.ts +1 -0
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js +1 -0
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/collections/map/index.d.ts +1180 -0
- package/dist/src/collections/map/index.d.ts.map +1 -0
- package/dist/src/collections/map/index.js +802 -0
- package/dist/src/collections/map/index.js.map +1 -0
- package/dist/src/collections/map/types.d.ts +586 -0
- package/dist/src/collections/map/types.d.ts.map +1 -0
- package/dist/src/collections/map/types.js +315 -0
- package/dist/src/collections/map/types.js.map +1 -0
- package/dist/src/component.d.ts +225 -0
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +36 -0
- package/dist/src/component.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +1 -1
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +1 -1
- package/dist/src/internal.js.map +1 -1
- package/dist/src/runtime/collections/index.d.ts +1 -0
- package/dist/src/runtime/collections/index.d.ts.map +1 -1
- package/dist/src/runtime/collections/index.js +1 -0
- package/dist/src/runtime/collections/index.js.map +1 -1
- package/dist/src/runtime/collections/map.d.ts +74 -0
- package/dist/src/runtime/collections/map.d.ts.map +1 -0
- package/dist/src/runtime/collections/map.js +70 -0
- package/dist/src/runtime/collections/map.js.map +1 -0
- package/dist/test/collections/map.examples.d.ts +8 -0
- package/dist/test/collections/map.examples.d.ts.map +1 -0
- package/dist/test/collections/map.examples.js +150 -0
- package/dist/test/collections/map.examples.js.map +1 -0
- package/dist/test/collections/schematic.examples.d.ts.map +1 -1
- package/dist/test/collections/schematic.examples.js +30 -2
- package/dist/test/collections/schematic.examples.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,1180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* `Map` — an interactive geographic basemap (CARTO / OSM raster tiles) with
|
|
7
|
+
* H3 hex and filled-area overlays, connector lines, pins, standalone labels,
|
|
8
|
+
* and a generalised overlay slot that hosts arbitrary East `UIComponent`
|
|
9
|
+
* children (a HUD, a legend, a back button) positioned over the canvas.
|
|
10
|
+
* **Read-only / selection-only**: click an area (returns its key), zoom, and
|
|
11
|
+
* fly to; any writes ride in through ordinary `Button` children in the
|
|
12
|
+
* overlay slot. Colour stays theme-owned — data selects a `tone` / `status`
|
|
13
|
+
* and the renderer's recipe maps each to a token.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import { type ExprType, type SubtypeExprOrValue, type TypeOf, ArrayType, BooleanType, FloatType, FunctionType, IntegerType, NullType, OptionType, StringType, StructType } from "@elaraai/east";
|
|
18
|
+
import { UIComponentType } from "../../component.js";
|
|
19
|
+
import { AlignType, type AlignLiteral } from "../../style/content.js";
|
|
20
|
+
import { type StatusTokenType } from "../../style/interaction.js";
|
|
21
|
+
import { type IconName } from "../../display/icon/types.js";
|
|
22
|
+
import { MapLatLngType, MapToneType, MapTileType, MapFocusType, MapAreaShapeType, MapAreaType, MapHexLayerType, MapMarkerType, MapLineStyleType, MapLineType, MapLabelType } from "./types.js";
|
|
23
|
+
export { MapLatLngType, MapToneType, MapCartoStyleType, MapTileType, MapFocusType, MapAreaShapeType, MapAreaType, MapHexLayerType, MapMarkerType, MapLineStyleType, MapLineType, MapLabelType, } from "./types.js";
|
|
24
|
+
/** String literal form of {@link MapToneType} tags. */
|
|
25
|
+
export type MapToneLiteral = "brand" | "ink" | "muted" | "success" | "warning" | "danger";
|
|
26
|
+
/** String literal form of {@link MapCartoStyleType} tags. */
|
|
27
|
+
export type MapCartoLiteral = "positron" | "darkMatter" | "voyager";
|
|
28
|
+
/**
|
|
29
|
+
* Builds a geographic point value.
|
|
30
|
+
*
|
|
31
|
+
* @param lat - Latitude in degrees
|
|
32
|
+
* @param lng - Longitude in degrees
|
|
33
|
+
* @returns A `MapLatLngType` value
|
|
34
|
+
*/
|
|
35
|
+
declare function at(lat: SubtypeExprOrValue<FloatType>, lng: SubtypeExprOrValue<FloatType>): ExprType<MapLatLngType>;
|
|
36
|
+
/**
|
|
37
|
+
* Builds a CARTO raster basemap.
|
|
38
|
+
*
|
|
39
|
+
* @param style - The CARTO preset (default `positron`)
|
|
40
|
+
* @returns A `MapTileType` value
|
|
41
|
+
*/
|
|
42
|
+
declare function carto(style?: MapCartoLiteral): ExprType<MapTileType>;
|
|
43
|
+
/**
|
|
44
|
+
* Builds an OpenStreetMap raster basemap.
|
|
45
|
+
*
|
|
46
|
+
* @returns A `MapTileType` value
|
|
47
|
+
*/
|
|
48
|
+
declare function osm(): ExprType<MapTileType>;
|
|
49
|
+
/** Configuration for {@link tile} — a raw XYZ basemap. */
|
|
50
|
+
export interface MapTileConfig {
|
|
51
|
+
/** XYZ tile URL template. */
|
|
52
|
+
url: SubtypeExprOrValue<StringType>;
|
|
53
|
+
/** Attribution HTML kept visible in the corner. */
|
|
54
|
+
attribution: SubtypeExprOrValue<StringType>;
|
|
55
|
+
/** Optional `{s}` subdomain list. */
|
|
56
|
+
subdomains?: SubtypeExprOrValue<ArrayType<StringType>>;
|
|
57
|
+
/** Optional max zoom for the layer. */
|
|
58
|
+
maxZoom?: SubtypeExprOrValue<IntegerType>;
|
|
59
|
+
/** Optional retina `{r}` tiles. */
|
|
60
|
+
detectRetina?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Builds a raw XYZ basemap with explicit attribution.
|
|
64
|
+
*
|
|
65
|
+
* @param config - The tile URL, attribution, and optional `subdomains` / `maxZoom` / `detectRetina`
|
|
66
|
+
* @returns A `MapTileType` value
|
|
67
|
+
*/
|
|
68
|
+
declare function tile(config: MapTileConfig): ExprType<MapTileType>;
|
|
69
|
+
/**
|
|
70
|
+
* Builds an `hexDisk` area shape — a `gridDisk(origin, k)` blob at a resolution.
|
|
71
|
+
*
|
|
72
|
+
* @param center - The disk origin
|
|
73
|
+
* @param k - Ring count around the origin
|
|
74
|
+
* @param resolution - H3 resolution
|
|
75
|
+
* @returns A `MapAreaShapeType` value
|
|
76
|
+
*/
|
|
77
|
+
declare function hexDisk(center: SubtypeExprOrValue<MapLatLngType>, k: SubtypeExprOrValue<IntegerType>, resolution: SubtypeExprOrValue<IntegerType>): ExprType<MapAreaShapeType>;
|
|
78
|
+
/**
|
|
79
|
+
* Builds a `cells` area shape — an explicit set of H3 cell ids.
|
|
80
|
+
*
|
|
81
|
+
* @param ids - The H3 cell ids
|
|
82
|
+
* @returns A `MapAreaShapeType` value
|
|
83
|
+
*/
|
|
84
|
+
declare function cells(ids: SubtypeExprOrValue<ArrayType<StringType>>): ExprType<MapAreaShapeType>;
|
|
85
|
+
/**
|
|
86
|
+
* Builds a `polygon` area shape — an explicit ring of points (an irregular
|
|
87
|
+
* region boundary). Two polygons that share an edge abut exactly, so adjacent
|
|
88
|
+
* regions running up against each other are authored by reusing the shared
|
|
89
|
+
* boundary points in both.
|
|
90
|
+
*
|
|
91
|
+
* @param points - The boundary points, in order (auto-closed; `Map.at(...)`)
|
|
92
|
+
* @returns A `MapAreaShapeType` value
|
|
93
|
+
*/
|
|
94
|
+
declare function polygon(points: SubtypeExprOrValue<ArrayType<MapLatLngType>>): ExprType<MapAreaShapeType>;
|
|
95
|
+
/**
|
|
96
|
+
* Builds a `point` camera target — centre on a point at a zoom level.
|
|
97
|
+
*
|
|
98
|
+
* @param center - The centre
|
|
99
|
+
* @param zoom - The zoom level to settle at
|
|
100
|
+
* @returns A `MapFocusType` value
|
|
101
|
+
*/
|
|
102
|
+
declare function point(center: SubtypeExprOrValue<MapLatLngType>, zoom: SubtypeExprOrValue<IntegerType>): ExprType<MapFocusType>;
|
|
103
|
+
/**
|
|
104
|
+
* Builds a `bounds` camera target — frame a south-west / north-east box.
|
|
105
|
+
*
|
|
106
|
+
* @param sw - South-west corner
|
|
107
|
+
* @param ne - North-east corner
|
|
108
|
+
* @returns A `MapFocusType` value
|
|
109
|
+
*/
|
|
110
|
+
declare function bounds(sw: SubtypeExprOrValue<MapLatLngType>, ne: SubtypeExprOrValue<MapLatLngType>): ExprType<MapFocusType>;
|
|
111
|
+
/** Stroke configuration for {@link solid} / {@link dashed}. */
|
|
112
|
+
export interface MapLineStyleConfig {
|
|
113
|
+
/** Stroke tone. */
|
|
114
|
+
tone?: MapToneLiteral;
|
|
115
|
+
/** Stroke width in px. */
|
|
116
|
+
weight?: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Builds a `solid` line style.
|
|
120
|
+
*
|
|
121
|
+
* @param config - Optional stroke configuration (`tone`, `weight`)
|
|
122
|
+
* @returns A `MapLineStyleType` value
|
|
123
|
+
*/
|
|
124
|
+
declare function solid(config?: MapLineStyleConfig): ExprType<MapLineStyleType>;
|
|
125
|
+
/**
|
|
126
|
+
* Builds a `dashed` line style.
|
|
127
|
+
*
|
|
128
|
+
* @param config - Optional stroke configuration (`tone`, `weight`)
|
|
129
|
+
* @returns A `MapLineStyleType` value
|
|
130
|
+
*/
|
|
131
|
+
declare function dashed(config?: MapLineStyleConfig): ExprType<MapLineStyleType>;
|
|
132
|
+
/** Configuration for {@link hex}. */
|
|
133
|
+
export interface MapHexConfig {
|
|
134
|
+
/** Optional faint background lattice (a disk of cells around a centre). */
|
|
135
|
+
lattice?: {
|
|
136
|
+
/** The lattice centre. */
|
|
137
|
+
center: SubtypeExprOrValue<MapLatLngType>;
|
|
138
|
+
/** Ring count around the centre. */
|
|
139
|
+
k: SubtypeExprOrValue<IntegerType>;
|
|
140
|
+
/** H3 resolution. */
|
|
141
|
+
resolution: SubtypeExprOrValue<IntegerType>;
|
|
142
|
+
};
|
|
143
|
+
/** Optional per-cell detail. */
|
|
144
|
+
cells?: readonly MapHexCellInput[];
|
|
145
|
+
/** Optional lattice stroke tone (default `muted`). */
|
|
146
|
+
tone?: SubtypeExprOrValue<MapToneType> | MapToneLiteral;
|
|
147
|
+
/** Optional click-through flag (default false — decorative). */
|
|
148
|
+
interactive?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
149
|
+
}
|
|
150
|
+
/** One per-cell detail entry for {@link hex}. */
|
|
151
|
+
export interface MapHexCellInput {
|
|
152
|
+
/** H3 cell id. */
|
|
153
|
+
id: SubtypeExprOrValue<StringType>;
|
|
154
|
+
/** Optional status-token option for the cell fill. */
|
|
155
|
+
status?: SubtypeExprOrValue<OptionType<StatusTokenType>>;
|
|
156
|
+
/** Optional fill alpha (0–1). */
|
|
157
|
+
fillOpacity?: SubtypeExprOrValue<FloatType>;
|
|
158
|
+
/** Optional detail text shown only at/after `lodZoom`. */
|
|
159
|
+
detail?: SubtypeExprOrValue<StringType>;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Builds the hex layer — a faint background lattice plus optional per-cell
|
|
163
|
+
* detail revealed at LOD.
|
|
164
|
+
*
|
|
165
|
+
* @param config - Optional `lattice`, `cells`, `tone`, and `interactive`
|
|
166
|
+
* @returns A `MapHexLayerType` value
|
|
167
|
+
*/
|
|
168
|
+
declare function hex(config?: MapHexConfig): ExprType<MapHexLayerType>;
|
|
169
|
+
/**
|
|
170
|
+
* The generalised overlay slot value — an East `UIComponent` positioned over
|
|
171
|
+
* the map, either screen-anchored (`align` / `verticalAlign`) or pinned to a
|
|
172
|
+
* coordinate (`geoAnchor`).
|
|
173
|
+
*
|
|
174
|
+
* @property content - The East child tree rendered over the canvas
|
|
175
|
+
* @property align - Horizontal screen anchor
|
|
176
|
+
* @property verticalAlign - Vertical screen anchor
|
|
177
|
+
* @property key - Optional stable child storage-key segment
|
|
178
|
+
* @property geoAnchor - Optional coordinate the overlay follows on pan / zoom
|
|
179
|
+
* @property offset - Optional px nudge from the anchor
|
|
180
|
+
* @property interactive - Optional pointer-events flag (default true)
|
|
181
|
+
*/
|
|
182
|
+
export declare const MapOverlayType: StructType<{
|
|
183
|
+
/** The East child tree rendered over the canvas */
|
|
184
|
+
readonly content: import("@elaraai/east").RecursiveType<import("../../component.js").UIComponentNode>;
|
|
185
|
+
/** Horizontal screen anchor */
|
|
186
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
187
|
+
readonly start: NullType;
|
|
188
|
+
readonly center: NullType;
|
|
189
|
+
readonly end: NullType;
|
|
190
|
+
}>;
|
|
191
|
+
/** Vertical screen anchor */
|
|
192
|
+
readonly verticalAlign: import("@elaraai/east").VariantType<{
|
|
193
|
+
readonly start: NullType;
|
|
194
|
+
readonly center: NullType;
|
|
195
|
+
readonly end: NullType;
|
|
196
|
+
}>;
|
|
197
|
+
/** Optional stable child storage-key segment */
|
|
198
|
+
readonly key: OptionType<StringType>;
|
|
199
|
+
/** Optional coordinate the overlay follows on pan / zoom */
|
|
200
|
+
readonly geoAnchor: OptionType<StructType<{
|
|
201
|
+
readonly lat: FloatType;
|
|
202
|
+
readonly lng: FloatType;
|
|
203
|
+
}>>;
|
|
204
|
+
/** Optional px nudge from the anchor */
|
|
205
|
+
readonly offset: OptionType<StructType<{
|
|
206
|
+
readonly x: FloatType;
|
|
207
|
+
readonly y: FloatType;
|
|
208
|
+
}>>;
|
|
209
|
+
/** Optional pointer-events flag (default true; false ⇒ click-through) */
|
|
210
|
+
readonly interactive: OptionType<BooleanType>;
|
|
211
|
+
}>;
|
|
212
|
+
/**
|
|
213
|
+
* Type representing the overlay slot.
|
|
214
|
+
*/
|
|
215
|
+
export type MapOverlayType = typeof MapOverlayType;
|
|
216
|
+
/** A positioned overlay child, as produced by {@link overlay}. */
|
|
217
|
+
export type MapOverlayInput = ExprType<MapOverlayType>;
|
|
218
|
+
/** Options for {@link overlay}. */
|
|
219
|
+
export interface MapOverlayOptions {
|
|
220
|
+
/** Horizontal screen anchor (default `start`). */
|
|
221
|
+
align?: AlignLiteral | SubtypeExprOrValue<AlignType>;
|
|
222
|
+
/** Vertical screen anchor (default `start`). */
|
|
223
|
+
verticalAlign?: AlignLiteral | SubtypeExprOrValue<AlignType>;
|
|
224
|
+
/** Optional stable child storage-key segment. */
|
|
225
|
+
key?: SubtypeExprOrValue<StringType>;
|
|
226
|
+
/** Optional coordinate the overlay follows on pan / zoom. */
|
|
227
|
+
geoAnchor?: SubtypeExprOrValue<MapLatLngType>;
|
|
228
|
+
/** Optional px nudge from the anchor. */
|
|
229
|
+
offset?: {
|
|
230
|
+
x: SubtypeExprOrValue<FloatType>;
|
|
231
|
+
y: SubtypeExprOrValue<FloatType>;
|
|
232
|
+
};
|
|
233
|
+
/** Optional pointer-events flag (default true; false ⇒ click-through). */
|
|
234
|
+
interactive?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Builds a positioned overlay child for the `overlays` slot.
|
|
238
|
+
*
|
|
239
|
+
* @param content - The East child tree (a HUD, legend, back button)
|
|
240
|
+
* @param options - Anchor / offset / interactivity options
|
|
241
|
+
* @returns A `MapOverlayType` value
|
|
242
|
+
*/
|
|
243
|
+
declare function overlay(content: SubtypeExprOrValue<UIComponentType>, options?: MapOverlayOptions): MapOverlayInput;
|
|
244
|
+
/**
|
|
245
|
+
* The struct element type of a `SubtypeExprOrValue<ArrayType<StructType>>`.
|
|
246
|
+
*/
|
|
247
|
+
export type RowElement<T extends SubtypeExprOrValue<ArrayType<StructType>>> = TypeOf<T> extends ArrayType<infer S> ? (S extends StructType ? S : never) : never;
|
|
248
|
+
/**
|
|
249
|
+
* Fields the `marker` mapper returns — one pin, before defaults.
|
|
250
|
+
*
|
|
251
|
+
* @property key - Marker identity — `onMarkerClick` returns it
|
|
252
|
+
* @property lat - Latitude in degrees
|
|
253
|
+
* @property lng - Longitude in degrees
|
|
254
|
+
* @property label - Optional permanent tooltip
|
|
255
|
+
* @property icon - Optional Font Awesome solid icon (static name or expression)
|
|
256
|
+
* @property tone - Optional marker tone
|
|
257
|
+
* @property minZoom - Optional LOD gate; the pin appears only at/after this zoom
|
|
258
|
+
* @property interactive - Optional click flag (default true)
|
|
259
|
+
*/
|
|
260
|
+
export interface MapMarkerFields {
|
|
261
|
+
/** Marker identity — `onMarkerClick` returns it. */
|
|
262
|
+
key: SubtypeExprOrValue<StringType>;
|
|
263
|
+
/** Latitude in degrees. */
|
|
264
|
+
lat: SubtypeExprOrValue<FloatType>;
|
|
265
|
+
/** Longitude in degrees. */
|
|
266
|
+
lng: SubtypeExprOrValue<FloatType>;
|
|
267
|
+
/** Optional permanent tooltip. */
|
|
268
|
+
label?: SubtypeExprOrValue<StringType>;
|
|
269
|
+
/** Optional Font Awesome solid icon (static name or expression). */
|
|
270
|
+
icon?: IconName | ExprType<StringType>;
|
|
271
|
+
/** Optional marker tone. */
|
|
272
|
+
tone?: SubtypeExprOrValue<MapToneType> | MapToneLiteral;
|
|
273
|
+
/** Optional LOD gate; the pin appears only at/after this zoom. */
|
|
274
|
+
minZoom?: SubtypeExprOrValue<IntegerType>;
|
|
275
|
+
/** Optional click flag (default true). */
|
|
276
|
+
interactive?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Builds a resolved marker value.
|
|
280
|
+
*
|
|
281
|
+
* @param fields - The marker fields ({@link MapMarkerFields})
|
|
282
|
+
* @returns A `MapMarkerType` value
|
|
283
|
+
*/
|
|
284
|
+
declare function marker(fields: MapMarkerFields): ExprType<MapMarkerType>;
|
|
285
|
+
/**
|
|
286
|
+
* Fields the `area` mapper returns — one filled area, before defaults.
|
|
287
|
+
*
|
|
288
|
+
* @property key - Area identity — `onAreaClick` returns it
|
|
289
|
+
* @property shape - The H3 / polygon boundary (`Map.hexDisk()` / `Map.cells()`)
|
|
290
|
+
* @property label - Optional permanent tooltip
|
|
291
|
+
* @property detailLabel - Optional richer label shown only at/after `lodZoom`
|
|
292
|
+
* @property status - Optional status-token option; drives colour + pulse
|
|
293
|
+
* @property tone - Optional explicit tone override; absent ⇒ `status` drives colour
|
|
294
|
+
* @property color - Optional raw CSS colour; wins over `tone`
|
|
295
|
+
* @property fillOpacity - Optional fill alpha (0–1)
|
|
296
|
+
* @property weight - Optional stroke width in px
|
|
297
|
+
* @property pulse - Optional explicit pulse override; absent ⇒ derived from `status`
|
|
298
|
+
* @property flyTo - Optional click camera target; absent ⇒ frame the shape
|
|
299
|
+
*/
|
|
300
|
+
export interface MapAreaFields {
|
|
301
|
+
/** Area identity — `onAreaClick` returns it. */
|
|
302
|
+
key: SubtypeExprOrValue<StringType>;
|
|
303
|
+
/** The H3 / polygon boundary (`Map.hexDisk()` / `Map.cells()`). */
|
|
304
|
+
shape: SubtypeExprOrValue<MapAreaShapeType>;
|
|
305
|
+
/** Optional permanent tooltip. */
|
|
306
|
+
label?: SubtypeExprOrValue<StringType>;
|
|
307
|
+
/** Optional richer label shown only at/after `lodZoom`. */
|
|
308
|
+
detailLabel?: SubtypeExprOrValue<StringType>;
|
|
309
|
+
/** Optional status-token option; drives colour + pulse. */
|
|
310
|
+
status?: SubtypeExprOrValue<OptionType<StatusTokenType>>;
|
|
311
|
+
/** Optional explicit tone override; absent ⇒ `status` drives colour. */
|
|
312
|
+
tone?: SubtypeExprOrValue<MapToneType> | MapToneLiteral;
|
|
313
|
+
/** Optional raw CSS colour (e.g. `"#2D7FF9"`); wins over `tone`. */
|
|
314
|
+
color?: SubtypeExprOrValue<StringType>;
|
|
315
|
+
/** Optional fill alpha (0–1). */
|
|
316
|
+
fillOpacity?: SubtypeExprOrValue<FloatType>;
|
|
317
|
+
/** Optional stroke width in px. */
|
|
318
|
+
weight?: SubtypeExprOrValue<FloatType>;
|
|
319
|
+
/** Optional explicit pulse override; absent ⇒ derived from `status`. */
|
|
320
|
+
pulse?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
321
|
+
/** Optional click camera target; absent ⇒ frame the shape. */
|
|
322
|
+
flyTo?: SubtypeExprOrValue<MapFocusType>;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Builds a resolved area value.
|
|
326
|
+
*
|
|
327
|
+
* @param fields - The area fields ({@link MapAreaFields})
|
|
328
|
+
* @returns A `MapAreaType` value
|
|
329
|
+
*/
|
|
330
|
+
declare function area(fields: MapAreaFields): ExprType<MapAreaType>;
|
|
331
|
+
/**
|
|
332
|
+
* Fields the `line` mapper returns — one connector, before defaults.
|
|
333
|
+
*
|
|
334
|
+
* @property key - Line identity
|
|
335
|
+
* @property points - The polyline points, in order (`Map.at()`)
|
|
336
|
+
* @property style - Optional style (default `Map.solid()`)
|
|
337
|
+
* @property flow - Optional animated dash-offset when active
|
|
338
|
+
* @property arrow - Optional arrowhead at the destination
|
|
339
|
+
*/
|
|
340
|
+
export interface MapLineFields {
|
|
341
|
+
/** Line identity. */
|
|
342
|
+
key: SubtypeExprOrValue<StringType>;
|
|
343
|
+
/** The polyline points, in order (`Map.at()`). */
|
|
344
|
+
points: SubtypeExprOrValue<ArrayType<MapLatLngType>>;
|
|
345
|
+
/** Optional style (default `Map.solid()`). */
|
|
346
|
+
style?: SubtypeExprOrValue<MapLineStyleType>;
|
|
347
|
+
/** Optional animated dash-offset when active. */
|
|
348
|
+
flow?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
349
|
+
/** Optional arrowhead at the destination. */
|
|
350
|
+
arrow?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Builds a resolved line value.
|
|
354
|
+
*
|
|
355
|
+
* @param fields - The line fields ({@link MapLineFields})
|
|
356
|
+
* @returns A `MapLineType` value
|
|
357
|
+
*/
|
|
358
|
+
declare function line(fields: MapLineFields): ExprType<MapLineType>;
|
|
359
|
+
/**
|
|
360
|
+
* Fields the `label` mapper returns — one standalone label, before defaults.
|
|
361
|
+
*
|
|
362
|
+
* @property key - Label identity
|
|
363
|
+
* @property lat - Latitude in degrees
|
|
364
|
+
* @property lng - Longitude in degrees
|
|
365
|
+
* @property text - The label text
|
|
366
|
+
*/
|
|
367
|
+
export interface MapLabelFields {
|
|
368
|
+
/** Label identity. */
|
|
369
|
+
key: SubtypeExprOrValue<StringType>;
|
|
370
|
+
/** Latitude in degrees. */
|
|
371
|
+
lat: SubtypeExprOrValue<FloatType>;
|
|
372
|
+
/** Longitude in degrees. */
|
|
373
|
+
lng: SubtypeExprOrValue<FloatType>;
|
|
374
|
+
/** The label text. */
|
|
375
|
+
text: SubtypeExprOrValue<StringType>;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* East StructType for the Map component.
|
|
379
|
+
*
|
|
380
|
+
* @remarks
|
|
381
|
+
* The `overlays` slot and (via `content`) any child trees are recursive
|
|
382
|
+
* `UIComponentType` values; the registration in `component.ts` spells the
|
|
383
|
+
* same shape with the recursion `node`.
|
|
384
|
+
*
|
|
385
|
+
* @property tiles - Basemap source
|
|
386
|
+
* @property center - Initial centre
|
|
387
|
+
* @property zoom - Initial zoom
|
|
388
|
+
* @property minZoom - Optional minimum zoom clamp
|
|
389
|
+
* @property maxZoom - Optional maximum zoom clamp
|
|
390
|
+
* @property lodZoom - Optional detail-LOD threshold
|
|
391
|
+
* @property fitBounds - Optional camera framing (alternative to center / zoom)
|
|
392
|
+
* @property areas - Filled boundaries
|
|
393
|
+
* @property hexes - Optional H3 lattice + per-cell detail
|
|
394
|
+
* @property markers - Pins
|
|
395
|
+
* @property lines - Connectors / move arrows
|
|
396
|
+
* @property labels - Standalone labels
|
|
397
|
+
* @property overlays - Positioned East children (HUD / legend / back)
|
|
398
|
+
* @property scrollWheelZoom - Optional scroll-wheel zoom (default true)
|
|
399
|
+
* @property attributionPrefix - Optional Leaflet prefix toggle (default false)
|
|
400
|
+
* @property height - Optional fixed panel height
|
|
401
|
+
* @property onAreaClick - Optional area-click callback (receives the area key)
|
|
402
|
+
* @property onMarkerClick - Optional marker-click callback (receives the marker key)
|
|
403
|
+
* @property onZoom - Optional zoom-end callback (receives the zoom level)
|
|
404
|
+
* @property onSelect - Optional hex / marker selection callback (receives the key)
|
|
405
|
+
*/
|
|
406
|
+
export declare const MapRootType: StructType<{
|
|
407
|
+
tiles: MapTileType;
|
|
408
|
+
center: MapLatLngType;
|
|
409
|
+
zoom: IntegerType;
|
|
410
|
+
minZoom: OptionType<IntegerType>;
|
|
411
|
+
maxZoom: OptionType<IntegerType>;
|
|
412
|
+
lodZoom: OptionType<IntegerType>;
|
|
413
|
+
fitBounds: OptionType<MapFocusType>;
|
|
414
|
+
areas: ArrayType<MapAreaType>;
|
|
415
|
+
hexes: OptionType<MapHexLayerType>;
|
|
416
|
+
markers: ArrayType<MapMarkerType>;
|
|
417
|
+
lines: ArrayType<MapLineType>;
|
|
418
|
+
labels: ArrayType<MapLabelType>;
|
|
419
|
+
overlays: ArrayType<MapOverlayType>;
|
|
420
|
+
scrollWheelZoom: OptionType<BooleanType>;
|
|
421
|
+
attributionPrefix: OptionType<BooleanType>;
|
|
422
|
+
height: OptionType<StringType>;
|
|
423
|
+
onAreaClick: OptionType<FunctionType<[StringType], NullType>>;
|
|
424
|
+
onMarkerClick: OptionType<FunctionType<[StringType], NullType>>;
|
|
425
|
+
onZoom: OptionType<FunctionType<[IntegerType], NullType>>;
|
|
426
|
+
onSelect: OptionType<FunctionType<[StringType], NullType>>;
|
|
427
|
+
}>;
|
|
428
|
+
/**
|
|
429
|
+
* Type representing the Map component.
|
|
430
|
+
*/
|
|
431
|
+
export type MapRootType = typeof MapRootType;
|
|
432
|
+
/**
|
|
433
|
+
* Configuration for {@link createMap}.
|
|
434
|
+
*
|
|
435
|
+
* @typeParam M - The markers row struct
|
|
436
|
+
* @typeParam A - The areas row struct
|
|
437
|
+
* @typeParam La - The labels row struct
|
|
438
|
+
* @typeParam L - The lines row struct
|
|
439
|
+
* @property tiles - Optional basemap (default `Map.carto("positron")`)
|
|
440
|
+
* @property center - Initial centre (`Map.at(lat, lng)`)
|
|
441
|
+
* @property zoom - Initial zoom
|
|
442
|
+
* @property minZoom - Optional minimum zoom clamp
|
|
443
|
+
* @property maxZoom - Optional maximum zoom clamp
|
|
444
|
+
* @property lodZoom - Optional detail-LOD threshold
|
|
445
|
+
* @property fitBounds - Optional camera framing (alternative to center / zoom)
|
|
446
|
+
* @property marker - Markers row mapper (omit when rows are already resolved)
|
|
447
|
+
* @property areas - Optional areas table
|
|
448
|
+
* @property area - Areas row mapper (omit when rows are already resolved)
|
|
449
|
+
* @property hexes - Optional H3 lattice + per-cell detail (`Map.hex()`)
|
|
450
|
+
* @property labels - Optional labels table
|
|
451
|
+
* @property label - Labels row mapper (omit when rows are already resolved)
|
|
452
|
+
* @property lines - Optional lines table
|
|
453
|
+
* @property line - Lines row mapper (omit when rows are already resolved)
|
|
454
|
+
* @property overlays - Positioned East children (`Map.overlay()`)
|
|
455
|
+
* @property scrollWheelZoom - Optional scroll-wheel zoom (default true)
|
|
456
|
+
* @property attributionPrefix - Optional Leaflet prefix toggle (default false)
|
|
457
|
+
* @property height - Optional fixed panel height
|
|
458
|
+
* @property onAreaClick - Optional area-click callback (receives the area key)
|
|
459
|
+
* @property onMarkerClick - Optional marker-click callback (receives the marker key)
|
|
460
|
+
* @property onZoom - Optional zoom-end callback (receives the zoom level)
|
|
461
|
+
* @property onSelect - Optional hex / marker selection callback (receives the key)
|
|
462
|
+
*/
|
|
463
|
+
export interface MapConfig<M extends StructType, A extends StructType, La extends StructType, L extends StructType> {
|
|
464
|
+
/** Optional basemap (default `Map.carto("positron")`). */
|
|
465
|
+
tiles?: SubtypeExprOrValue<MapTileType>;
|
|
466
|
+
/** Initial centre (`Map.at(lat, lng)`). */
|
|
467
|
+
center: SubtypeExprOrValue<MapLatLngType>;
|
|
468
|
+
/** Initial zoom. */
|
|
469
|
+
zoom: SubtypeExprOrValue<IntegerType>;
|
|
470
|
+
/** Optional minimum zoom clamp. */
|
|
471
|
+
minZoom?: SubtypeExprOrValue<IntegerType>;
|
|
472
|
+
/** Optional maximum zoom clamp. */
|
|
473
|
+
maxZoom?: SubtypeExprOrValue<IntegerType>;
|
|
474
|
+
/** Optional detail-LOD threshold; zoom ≥ this ⇒ detail. */
|
|
475
|
+
lodZoom?: SubtypeExprOrValue<IntegerType>;
|
|
476
|
+
/** Optional camera framing (alternative to `center` / `zoom`). */
|
|
477
|
+
fitBounds?: SubtypeExprOrValue<MapFocusType>;
|
|
478
|
+
/** Markers row mapper; omit when `markers` is already `ArrayType(Map.Types.Marker)`. */
|
|
479
|
+
marker?: (m: ExprType<M>) => MapMarkerFields;
|
|
480
|
+
/** Optional areas table. */
|
|
481
|
+
areas?: SubtypeExprOrValue<ArrayType<A>>;
|
|
482
|
+
/** Areas row mapper; omit when `areas` is already `ArrayType(Map.Types.Area)`. */
|
|
483
|
+
area?: (a: ExprType<A>) => MapAreaFields;
|
|
484
|
+
/** Optional H3 lattice + per-cell detail (`Map.hex()`). */
|
|
485
|
+
hexes?: SubtypeExprOrValue<MapHexLayerType>;
|
|
486
|
+
/** Optional labels table. */
|
|
487
|
+
labels?: SubtypeExprOrValue<ArrayType<La>>;
|
|
488
|
+
/** Labels row mapper; omit when `labels` is already `ArrayType(Map.Types.Label)`. */
|
|
489
|
+
label?: (s: ExprType<La>) => MapLabelFields;
|
|
490
|
+
/** Optional lines table. */
|
|
491
|
+
lines?: SubtypeExprOrValue<ArrayType<L>>;
|
|
492
|
+
/** Lines row mapper; omit when `lines` is already `ArrayType(Map.Types.Line)`. */
|
|
493
|
+
line?: (l: ExprType<L>) => MapLineFields;
|
|
494
|
+
/** Positioned East children (`Map.overlay()`). */
|
|
495
|
+
overlays?: readonly MapOverlayInput[];
|
|
496
|
+
/** Optional scroll-wheel zoom (default true). */
|
|
497
|
+
scrollWheelZoom?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
498
|
+
/** Optional Leaflet prefix toggle (default false — strips it, keeps the tile credit). */
|
|
499
|
+
attributionPrefix?: SubtypeExprOrValue<BooleanType> | boolean;
|
|
500
|
+
/** Optional fixed panel height (any CSS length, e.g. `"540px"`). */
|
|
501
|
+
height?: SubtypeExprOrValue<StringType> | string;
|
|
502
|
+
/** Optional area-click callback (receives the area key). */
|
|
503
|
+
onAreaClick?: SubtypeExprOrValue<FunctionType<[StringType], NullType>>;
|
|
504
|
+
/** Optional marker-click callback (receives the marker key). */
|
|
505
|
+
onMarkerClick?: SubtypeExprOrValue<FunctionType<[StringType], NullType>>;
|
|
506
|
+
/** Optional zoom-end callback (receives the zoom level). */
|
|
507
|
+
onZoom?: SubtypeExprOrValue<FunctionType<[IntegerType], NullType>>;
|
|
508
|
+
/** Optional hex / marker selection callback (receives the key). */
|
|
509
|
+
onSelect?: SubtypeExprOrValue<FunctionType<[StringType], NullType>>;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Creates a Map — an interactive geographic basemap with H3 / area overlays
|
|
513
|
+
* and a generalised East-child overlay slot.
|
|
514
|
+
*
|
|
515
|
+
* @typeParam M - The markers-table input
|
|
516
|
+
* @typeParam A - The areas-table input
|
|
517
|
+
* @typeParam La - The labels-table input
|
|
518
|
+
* @typeParam L - The lines-table input
|
|
519
|
+
* @param markers - The pin rows (the required first table)
|
|
520
|
+
* @param config - The Map configuration ({@link MapConfig})
|
|
521
|
+
* @returns An East expression of `UIComponentType`
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* ```ts
|
|
525
|
+
* import { East } from "@elaraai/east";
|
|
526
|
+
* import { Map, UIComponentType } from "@elaraai/east-ui";
|
|
527
|
+
*
|
|
528
|
+
* const example = East.function([], UIComponentType, _$ =>
|
|
529
|
+
* Map.Root(
|
|
530
|
+
* [{ id: "okafor", lat: -34.842, lng: 138.598, name: "J. Okafor" }],
|
|
531
|
+
* {
|
|
532
|
+
* center: Map.at(-34.881, 138.6), zoom: 12n,
|
|
533
|
+
* marker: m => ({ key: m.id, lat: m.lat, lng: m.lng, label: m.name }),
|
|
534
|
+
* },
|
|
535
|
+
* ),
|
|
536
|
+
* );
|
|
537
|
+
* ```
|
|
538
|
+
*/
|
|
539
|
+
declare function createMap<M extends SubtypeExprOrValue<ArrayType<StructType>>, A extends SubtypeExprOrValue<ArrayType<StructType>> = [], La extends SubtypeExprOrValue<ArrayType<StructType>> = [], L extends SubtypeExprOrValue<ArrayType<StructType>> = []>(markers: M, config: MapConfig<RowElement<M>, RowElement<A>, RowElement<La>, RowElement<L>> & {
|
|
540
|
+
areas?: A;
|
|
541
|
+
labels?: La;
|
|
542
|
+
lines?: L;
|
|
543
|
+
}): ExprType<UIComponentType>;
|
|
544
|
+
/**
|
|
545
|
+
* Map component namespace.
|
|
546
|
+
*
|
|
547
|
+
* @remarks
|
|
548
|
+
* `Map.Root(markers, config)` builds the basemap from flat tables (markers,
|
|
549
|
+
* areas, labels, lines) plus the `hexes` layer and the `overlays` slot;
|
|
550
|
+
* closed-set fields in data (`status`, `tone`, `style`) are typed variant
|
|
551
|
+
* values (`Map.Types.*`).
|
|
552
|
+
*/
|
|
553
|
+
export declare const Map: {
|
|
554
|
+
/**
|
|
555
|
+
* Creates a Map — an interactive geographic basemap with H3 / area
|
|
556
|
+
* overlays and a generalised East-child overlay slot.
|
|
557
|
+
*
|
|
558
|
+
* @typeParam M - The markers-table input
|
|
559
|
+
* @typeParam A - The areas-table input
|
|
560
|
+
* @typeParam La - The labels-table input
|
|
561
|
+
* @typeParam L - The lines-table input
|
|
562
|
+
* @param markers - The pin rows (the required first table)
|
|
563
|
+
* @param config - The Map configuration ({@link MapConfig})
|
|
564
|
+
* @returns An East expression of `UIComponentType`
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ```ts
|
|
568
|
+
* import { East } from "@elaraai/east";
|
|
569
|
+
* import { Map, UIComponentType } from "@elaraai/east-ui";
|
|
570
|
+
*
|
|
571
|
+
* const example = East.function([], UIComponentType, _$ =>
|
|
572
|
+
* Map.Root(
|
|
573
|
+
* [{ id: "okafor", lat: -34.842, lng: 138.598, name: "J. Okafor" }],
|
|
574
|
+
* {
|
|
575
|
+
* center: Map.at(-34.881, 138.6), zoom: 12n,
|
|
576
|
+
* marker: m => ({ key: m.id, lat: m.lat, lng: m.lng, label: m.name }),
|
|
577
|
+
* },
|
|
578
|
+
* ),
|
|
579
|
+
* );
|
|
580
|
+
* ```
|
|
581
|
+
*/
|
|
582
|
+
readonly Root: typeof createMap;
|
|
583
|
+
/**
|
|
584
|
+
* Builds a geographic point value.
|
|
585
|
+
*
|
|
586
|
+
* @param lat - Latitude in degrees
|
|
587
|
+
* @param lng - Longitude in degrees
|
|
588
|
+
* @returns A `MapLatLngType` value
|
|
589
|
+
*
|
|
590
|
+
* @example
|
|
591
|
+
* ```ts
|
|
592
|
+
* Map.at(-34.881, 138.6)
|
|
593
|
+
* ```
|
|
594
|
+
*/
|
|
595
|
+
readonly at: typeof at;
|
|
596
|
+
/**
|
|
597
|
+
* Builds a CARTO raster basemap.
|
|
598
|
+
*
|
|
599
|
+
* @param style - The CARTO preset (default `positron`)
|
|
600
|
+
* @returns A `MapTileType` value
|
|
601
|
+
*
|
|
602
|
+
* @example
|
|
603
|
+
* ```ts
|
|
604
|
+
* Map.carto("voyager")
|
|
605
|
+
* ```
|
|
606
|
+
*/
|
|
607
|
+
readonly carto: typeof carto;
|
|
608
|
+
/**
|
|
609
|
+
* Builds an OpenStreetMap raster basemap.
|
|
610
|
+
*
|
|
611
|
+
* @returns A `MapTileType` value
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```ts
|
|
615
|
+
* Map.osm()
|
|
616
|
+
* ```
|
|
617
|
+
*/
|
|
618
|
+
readonly osm: typeof osm;
|
|
619
|
+
/**
|
|
620
|
+
* Builds a raw XYZ basemap with explicit attribution.
|
|
621
|
+
*
|
|
622
|
+
* @param config - The tile URL, attribution, and optional layer options
|
|
623
|
+
* @returns A `MapTileType` value
|
|
624
|
+
*
|
|
625
|
+
* @example
|
|
626
|
+
* ```ts
|
|
627
|
+
* Map.tile({ url: "https://{s}.tiles.example/{z}/{x}/{y}.png", attribution: "© Example" })
|
|
628
|
+
* ```
|
|
629
|
+
*/
|
|
630
|
+
readonly tile: typeof tile;
|
|
631
|
+
/**
|
|
632
|
+
* Builds an `hexDisk` area shape — a `gridDisk(origin, k)` blob.
|
|
633
|
+
*
|
|
634
|
+
* @param center - The disk origin
|
|
635
|
+
* @param k - Ring count around the origin
|
|
636
|
+
* @param resolution - H3 resolution
|
|
637
|
+
* @returns A `MapAreaShapeType` value
|
|
638
|
+
*
|
|
639
|
+
* @example
|
|
640
|
+
* ```ts
|
|
641
|
+
* Map.hexDisk(Map.at(-34.9258, 138.5994), 1n, 8n)
|
|
642
|
+
* ```
|
|
643
|
+
*/
|
|
644
|
+
readonly hexDisk: typeof hexDisk;
|
|
645
|
+
/**
|
|
646
|
+
* Builds a `cells` area shape — an explicit set of H3 cell ids.
|
|
647
|
+
*
|
|
648
|
+
* @param ids - The H3 cell ids
|
|
649
|
+
* @returns A `MapAreaShapeType` value
|
|
650
|
+
*
|
|
651
|
+
* @example
|
|
652
|
+
* ```ts
|
|
653
|
+
* Map.cells(["882830829bfffff"])
|
|
654
|
+
* ```
|
|
655
|
+
*/
|
|
656
|
+
readonly cells: typeof cells;
|
|
657
|
+
/**
|
|
658
|
+
* Builds a `polygon` area shape — an explicit ring of points (an irregular
|
|
659
|
+
* region boundary). Two polygons sharing an edge abut exactly.
|
|
660
|
+
*
|
|
661
|
+
* @param points - The boundary points, in order (auto-closed; `Map.at(...)`)
|
|
662
|
+
* @returns A `MapAreaShapeType` value
|
|
663
|
+
*/
|
|
664
|
+
readonly polygon: typeof polygon;
|
|
665
|
+
/**
|
|
666
|
+
* Builds the hex layer — a faint background lattice plus optional per-cell
|
|
667
|
+
* detail revealed at LOD.
|
|
668
|
+
*
|
|
669
|
+
* @param config - Optional `lattice`, `cells`, `tone`, and `interactive`
|
|
670
|
+
* @returns A `MapHexLayerType` value
|
|
671
|
+
*
|
|
672
|
+
* @example
|
|
673
|
+
* ```ts
|
|
674
|
+
* Map.hex({ lattice: { center: Map.at(-34.881, 138.6), k: 11n, resolution: 8n }, tone: "muted" })
|
|
675
|
+
* ```
|
|
676
|
+
*/
|
|
677
|
+
readonly hex: typeof hex;
|
|
678
|
+
/**
|
|
679
|
+
* Builds a resolved marker value.
|
|
680
|
+
*
|
|
681
|
+
* @param fields - The marker fields ({@link MapMarkerFields})
|
|
682
|
+
* @returns A `MapMarkerType` value
|
|
683
|
+
*
|
|
684
|
+
* @example
|
|
685
|
+
* ```ts
|
|
686
|
+
* Map.marker({ key: "okafor", lat: -34.842, lng: 138.598, label: "J. Okafor", icon: "house" })
|
|
687
|
+
* ```
|
|
688
|
+
*/
|
|
689
|
+
readonly marker: typeof marker;
|
|
690
|
+
/**
|
|
691
|
+
* Builds a resolved area value.
|
|
692
|
+
*
|
|
693
|
+
* @param fields - The area fields ({@link MapAreaFields})
|
|
694
|
+
* @returns A `MapAreaType` value
|
|
695
|
+
*
|
|
696
|
+
* @example
|
|
697
|
+
* ```ts
|
|
698
|
+
* Map.area({ key: "5000", shape: Map.hexDisk(Map.at(-34.9258, 138.5994), 1n, 8n), label: "5000 · CBD" })
|
|
699
|
+
* ```
|
|
700
|
+
*/
|
|
701
|
+
readonly area: typeof area;
|
|
702
|
+
/**
|
|
703
|
+
* Builds a resolved line value.
|
|
704
|
+
*
|
|
705
|
+
* @param fields - The line fields ({@link MapLineFields})
|
|
706
|
+
* @returns A `MapLineType` value
|
|
707
|
+
*
|
|
708
|
+
* @example
|
|
709
|
+
* ```ts
|
|
710
|
+
* Map.line({ key: "move", points: [Map.at(-34.905, 138.6), Map.at(-34.852, 138.6)], style: Map.dashed({ tone: "brand" }), arrow: true })
|
|
711
|
+
* ```
|
|
712
|
+
*/
|
|
713
|
+
readonly line: typeof line;
|
|
714
|
+
/**
|
|
715
|
+
* Builds a `solid` line style.
|
|
716
|
+
*
|
|
717
|
+
* @param config - Optional stroke configuration (`tone`, `weight`)
|
|
718
|
+
* @returns A `MapLineStyleType` value
|
|
719
|
+
*
|
|
720
|
+
* @example
|
|
721
|
+
* ```ts
|
|
722
|
+
* Map.solid({ tone: "brand" })
|
|
723
|
+
* ```
|
|
724
|
+
*/
|
|
725
|
+
readonly solid: typeof solid;
|
|
726
|
+
/**
|
|
727
|
+
* Builds a `dashed` line style.
|
|
728
|
+
*
|
|
729
|
+
* @param config - Optional stroke configuration (`tone`, `weight`)
|
|
730
|
+
* @returns A `MapLineStyleType` value
|
|
731
|
+
*
|
|
732
|
+
* @example
|
|
733
|
+
* ```ts
|
|
734
|
+
* Map.dashed({ tone: "brand" })
|
|
735
|
+
* ```
|
|
736
|
+
*/
|
|
737
|
+
readonly dashed: typeof dashed;
|
|
738
|
+
/**
|
|
739
|
+
* Builds a `point` camera target.
|
|
740
|
+
*
|
|
741
|
+
* @param center - The centre
|
|
742
|
+
* @param zoom - The zoom level to settle at
|
|
743
|
+
* @returns A `MapFocusType` value
|
|
744
|
+
*
|
|
745
|
+
* @example
|
|
746
|
+
* ```ts
|
|
747
|
+
* Map.point(Map.at(-34.9258, 138.5994), 14n)
|
|
748
|
+
* ```
|
|
749
|
+
*/
|
|
750
|
+
readonly point: typeof point;
|
|
751
|
+
/**
|
|
752
|
+
* Builds a `bounds` camera target.
|
|
753
|
+
*
|
|
754
|
+
* @param sw - South-west corner
|
|
755
|
+
* @param ne - North-east corner
|
|
756
|
+
* @returns A `MapFocusType` value
|
|
757
|
+
*
|
|
758
|
+
* @example
|
|
759
|
+
* ```ts
|
|
760
|
+
* Map.bounds(Map.at(-34.95, 138.55), Map.at(-34.80, 138.65))
|
|
761
|
+
* ```
|
|
762
|
+
*/
|
|
763
|
+
readonly bounds: typeof bounds;
|
|
764
|
+
/**
|
|
765
|
+
* Builds a positioned overlay child for the `overlays` slot.
|
|
766
|
+
*
|
|
767
|
+
* @param content - The East child tree (a HUD, legend, back button)
|
|
768
|
+
* @param options - Anchor / offset / interactivity options
|
|
769
|
+
* @returns A `MapOverlayType` value
|
|
770
|
+
*
|
|
771
|
+
* @example
|
|
772
|
+
* ```ts
|
|
773
|
+
* Map.overlay(Text.Root("ELARA"), { align: "start", verticalAlign: "start", key: "hud" })
|
|
774
|
+
* ```
|
|
775
|
+
*/
|
|
776
|
+
readonly overlay: typeof overlay;
|
|
777
|
+
readonly Types: {
|
|
778
|
+
/**
|
|
779
|
+
* East StructType for the Map component.
|
|
780
|
+
*
|
|
781
|
+
* @remarks
|
|
782
|
+
* See {@link MapRootType} for per-field docs.
|
|
783
|
+
*
|
|
784
|
+
* @property tiles - Basemap source
|
|
785
|
+
* @property center - Initial centre
|
|
786
|
+
* @property zoom - Initial zoom
|
|
787
|
+
* @property areas - Filled boundaries
|
|
788
|
+
* @property markers - Pins
|
|
789
|
+
* @property overlays - Positioned East children
|
|
790
|
+
*/
|
|
791
|
+
readonly Map: StructType<{
|
|
792
|
+
tiles: MapTileType;
|
|
793
|
+
center: MapLatLngType;
|
|
794
|
+
zoom: IntegerType;
|
|
795
|
+
minZoom: OptionType<IntegerType>;
|
|
796
|
+
maxZoom: OptionType<IntegerType>;
|
|
797
|
+
lodZoom: OptionType<IntegerType>;
|
|
798
|
+
fitBounds: OptionType<MapFocusType>;
|
|
799
|
+
areas: ArrayType<MapAreaType>;
|
|
800
|
+
hexes: OptionType<MapHexLayerType>;
|
|
801
|
+
markers: ArrayType<MapMarkerType>;
|
|
802
|
+
lines: ArrayType<MapLineType>;
|
|
803
|
+
labels: ArrayType<MapLabelType>;
|
|
804
|
+
overlays: ArrayType<MapOverlayType>;
|
|
805
|
+
scrollWheelZoom: OptionType<BooleanType>;
|
|
806
|
+
attributionPrefix: OptionType<BooleanType>;
|
|
807
|
+
height: OptionType<StringType>;
|
|
808
|
+
onAreaClick: OptionType<FunctionType<[StringType], NullType>>;
|
|
809
|
+
onMarkerClick: OptionType<FunctionType<[StringType], NullType>>;
|
|
810
|
+
onZoom: OptionType<FunctionType<[IntegerType], NullType>>;
|
|
811
|
+
onSelect: OptionType<FunctionType<[StringType], NullType>>;
|
|
812
|
+
}>;
|
|
813
|
+
/**
|
|
814
|
+
* A geographic point.
|
|
815
|
+
*
|
|
816
|
+
* @property lat - Latitude in degrees
|
|
817
|
+
* @property lng - Longitude in degrees
|
|
818
|
+
*/
|
|
819
|
+
readonly LatLng: StructType<{
|
|
820
|
+
readonly lat: FloatType;
|
|
821
|
+
readonly lng: FloatType;
|
|
822
|
+
}>;
|
|
823
|
+
/**
|
|
824
|
+
* Theme tone for areas / hexes / markers / lines.
|
|
825
|
+
*
|
|
826
|
+
* @property brand - Brand teal
|
|
827
|
+
* @property ink - Foreground ink
|
|
828
|
+
* @property muted - Muted foreground
|
|
829
|
+
* @property success - Status ok
|
|
830
|
+
* @property warning - Status warn
|
|
831
|
+
* @property danger - Status bad
|
|
832
|
+
*/
|
|
833
|
+
readonly Tone: import("@elaraai/east").VariantType<{
|
|
834
|
+
readonly brand: NullType;
|
|
835
|
+
readonly ink: NullType;
|
|
836
|
+
readonly muted: NullType;
|
|
837
|
+
readonly success: NullType;
|
|
838
|
+
readonly warning: NullType;
|
|
839
|
+
readonly danger: NullType;
|
|
840
|
+
}>;
|
|
841
|
+
/**
|
|
842
|
+
* CARTO basemap preset.
|
|
843
|
+
*
|
|
844
|
+
* @property positron - Light base
|
|
845
|
+
* @property darkMatter - Dark base
|
|
846
|
+
* @property voyager - Colour base
|
|
847
|
+
*/
|
|
848
|
+
readonly CartoStyle: import("@elaraai/east").VariantType<{
|
|
849
|
+
readonly positron: NullType;
|
|
850
|
+
readonly darkMatter: NullType;
|
|
851
|
+
readonly voyager: NullType;
|
|
852
|
+
}>;
|
|
853
|
+
/**
|
|
854
|
+
* Basemap source (`carto` / `osm` / `custom`).
|
|
855
|
+
*
|
|
856
|
+
* @property carto - A CARTO raster preset
|
|
857
|
+
* @property osm - OpenStreetMap raster tiles
|
|
858
|
+
* @property custom - A raw XYZ template with attribution
|
|
859
|
+
*/
|
|
860
|
+
readonly Tile: import("@elaraai/east").VariantType<{
|
|
861
|
+
readonly carto: StructType<{
|
|
862
|
+
readonly style: import("@elaraai/east").VariantType<{
|
|
863
|
+
readonly positron: NullType;
|
|
864
|
+
readonly darkMatter: NullType;
|
|
865
|
+
readonly voyager: NullType;
|
|
866
|
+
}>;
|
|
867
|
+
}>;
|
|
868
|
+
readonly osm: NullType;
|
|
869
|
+
readonly custom: StructType<{
|
|
870
|
+
readonly url: StringType;
|
|
871
|
+
readonly attribution: StringType;
|
|
872
|
+
readonly subdomains: OptionType<ArrayType<StringType>>;
|
|
873
|
+
readonly maxZoom: OptionType<IntegerType>;
|
|
874
|
+
readonly detectRetina: OptionType<BooleanType>;
|
|
875
|
+
}>;
|
|
876
|
+
}>;
|
|
877
|
+
/**
|
|
878
|
+
* Camera target (`point` / `bounds`).
|
|
879
|
+
*
|
|
880
|
+
* @property point - Centre on a point at a zoom level
|
|
881
|
+
* @property bounds - Frame a south-west / north-east box
|
|
882
|
+
*/
|
|
883
|
+
readonly Focus: import("@elaraai/east").VariantType<{
|
|
884
|
+
readonly point: StructType<{
|
|
885
|
+
readonly center: StructType<{
|
|
886
|
+
readonly lat: FloatType;
|
|
887
|
+
readonly lng: FloatType;
|
|
888
|
+
}>;
|
|
889
|
+
readonly zoom: IntegerType;
|
|
890
|
+
}>;
|
|
891
|
+
readonly bounds: StructType<{
|
|
892
|
+
readonly sw: StructType<{
|
|
893
|
+
readonly lat: FloatType;
|
|
894
|
+
readonly lng: FloatType;
|
|
895
|
+
}>;
|
|
896
|
+
readonly ne: StructType<{
|
|
897
|
+
readonly lat: FloatType;
|
|
898
|
+
readonly lng: FloatType;
|
|
899
|
+
}>;
|
|
900
|
+
}>;
|
|
901
|
+
}>;
|
|
902
|
+
/**
|
|
903
|
+
* Area boundary (`hexDisk` / `polygon` / `cells`).
|
|
904
|
+
*
|
|
905
|
+
* @property hexDisk - A `gridDisk(origin, k)` blob
|
|
906
|
+
* @property polygon - An explicit ring of points
|
|
907
|
+
* @property cells - Explicit H3 cell ids
|
|
908
|
+
*/
|
|
909
|
+
readonly AreaShape: import("@elaraai/east").VariantType<{
|
|
910
|
+
readonly hexDisk: StructType<{
|
|
911
|
+
readonly center: StructType<{
|
|
912
|
+
readonly lat: FloatType;
|
|
913
|
+
readonly lng: FloatType;
|
|
914
|
+
}>;
|
|
915
|
+
readonly k: IntegerType;
|
|
916
|
+
readonly resolution: IntegerType;
|
|
917
|
+
}>;
|
|
918
|
+
readonly polygon: ArrayType<StructType<{
|
|
919
|
+
readonly lat: FloatType;
|
|
920
|
+
readonly lng: FloatType;
|
|
921
|
+
}>>;
|
|
922
|
+
readonly cells: ArrayType<StringType>;
|
|
923
|
+
}>;
|
|
924
|
+
/**
|
|
925
|
+
* A resolved area.
|
|
926
|
+
*
|
|
927
|
+
* @property key - Area identity
|
|
928
|
+
* @property shape - The boundary
|
|
929
|
+
* @property status - Optional status (drives colour + pulse)
|
|
930
|
+
* @property flyTo - Optional click camera target
|
|
931
|
+
*/
|
|
932
|
+
readonly Area: StructType<{
|
|
933
|
+
readonly key: StringType;
|
|
934
|
+
readonly shape: import("@elaraai/east").VariantType<{
|
|
935
|
+
readonly hexDisk: StructType<{
|
|
936
|
+
readonly center: StructType<{
|
|
937
|
+
readonly lat: FloatType;
|
|
938
|
+
readonly lng: FloatType;
|
|
939
|
+
}>;
|
|
940
|
+
readonly k: IntegerType;
|
|
941
|
+
readonly resolution: IntegerType;
|
|
942
|
+
}>;
|
|
943
|
+
readonly polygon: ArrayType<StructType<{
|
|
944
|
+
readonly lat: FloatType;
|
|
945
|
+
readonly lng: FloatType;
|
|
946
|
+
}>>;
|
|
947
|
+
readonly cells: ArrayType<StringType>;
|
|
948
|
+
}>;
|
|
949
|
+
readonly label: OptionType<StringType>;
|
|
950
|
+
readonly detailLabel: OptionType<StringType>;
|
|
951
|
+
readonly status: OptionType<import("@elaraai/east").VariantType<{
|
|
952
|
+
readonly success: NullType;
|
|
953
|
+
readonly warning: NullType;
|
|
954
|
+
readonly danger: NullType;
|
|
955
|
+
readonly info: NullType;
|
|
956
|
+
readonly neutral: NullType;
|
|
957
|
+
}>>;
|
|
958
|
+
readonly tone: OptionType<import("@elaraai/east").VariantType<{
|
|
959
|
+
readonly brand: NullType;
|
|
960
|
+
readonly ink: NullType;
|
|
961
|
+
readonly muted: NullType;
|
|
962
|
+
readonly success: NullType;
|
|
963
|
+
readonly warning: NullType;
|
|
964
|
+
readonly danger: NullType;
|
|
965
|
+
}>>;
|
|
966
|
+
readonly color: OptionType<StringType>;
|
|
967
|
+
readonly fillOpacity: OptionType<FloatType>;
|
|
968
|
+
readonly weight: OptionType<FloatType>;
|
|
969
|
+
readonly pulse: OptionType<BooleanType>;
|
|
970
|
+
readonly flyTo: OptionType<import("@elaraai/east").VariantType<{
|
|
971
|
+
readonly point: StructType<{
|
|
972
|
+
readonly center: StructType<{
|
|
973
|
+
readonly lat: FloatType;
|
|
974
|
+
readonly lng: FloatType;
|
|
975
|
+
}>;
|
|
976
|
+
readonly zoom: IntegerType;
|
|
977
|
+
}>;
|
|
978
|
+
readonly bounds: StructType<{
|
|
979
|
+
readonly sw: StructType<{
|
|
980
|
+
readonly lat: FloatType;
|
|
981
|
+
readonly lng: FloatType;
|
|
982
|
+
}>;
|
|
983
|
+
readonly ne: StructType<{
|
|
984
|
+
readonly lat: FloatType;
|
|
985
|
+
readonly lng: FloatType;
|
|
986
|
+
}>;
|
|
987
|
+
}>;
|
|
988
|
+
}>>;
|
|
989
|
+
}>;
|
|
990
|
+
/**
|
|
991
|
+
* The hex layer (lattice + per-cell detail).
|
|
992
|
+
*
|
|
993
|
+
* @property lattice - Optional faint background lattice
|
|
994
|
+
* @property cells - Per-cell detail
|
|
995
|
+
* @property tone - Optional lattice stroke tone
|
|
996
|
+
*/
|
|
997
|
+
readonly Hex: StructType<{
|
|
998
|
+
readonly lattice: OptionType<StructType<{
|
|
999
|
+
readonly center: StructType<{
|
|
1000
|
+
readonly lat: FloatType;
|
|
1001
|
+
readonly lng: FloatType;
|
|
1002
|
+
}>;
|
|
1003
|
+
readonly k: IntegerType;
|
|
1004
|
+
readonly resolution: IntegerType;
|
|
1005
|
+
}>>;
|
|
1006
|
+
readonly cells: ArrayType<StructType<{
|
|
1007
|
+
readonly id: StringType;
|
|
1008
|
+
readonly status: OptionType<import("@elaraai/east").VariantType<{
|
|
1009
|
+
readonly success: NullType;
|
|
1010
|
+
readonly warning: NullType;
|
|
1011
|
+
readonly danger: NullType;
|
|
1012
|
+
readonly info: NullType;
|
|
1013
|
+
readonly neutral: NullType;
|
|
1014
|
+
}>>;
|
|
1015
|
+
readonly fillOpacity: OptionType<FloatType>;
|
|
1016
|
+
readonly detail: OptionType<StringType>;
|
|
1017
|
+
}>>;
|
|
1018
|
+
readonly tone: OptionType<import("@elaraai/east").VariantType<{
|
|
1019
|
+
readonly brand: NullType;
|
|
1020
|
+
readonly ink: NullType;
|
|
1021
|
+
readonly muted: NullType;
|
|
1022
|
+
readonly success: NullType;
|
|
1023
|
+
readonly warning: NullType;
|
|
1024
|
+
readonly danger: NullType;
|
|
1025
|
+
}>>;
|
|
1026
|
+
readonly interactive: OptionType<BooleanType>;
|
|
1027
|
+
}>;
|
|
1028
|
+
/**
|
|
1029
|
+
* A resolved marker.
|
|
1030
|
+
*
|
|
1031
|
+
* @property key - Marker identity
|
|
1032
|
+
* @property at - The pin location
|
|
1033
|
+
* @property minZoom - Optional LOD gate
|
|
1034
|
+
*/
|
|
1035
|
+
readonly Marker: StructType<{
|
|
1036
|
+
readonly key: StringType;
|
|
1037
|
+
readonly at: StructType<{
|
|
1038
|
+
readonly lat: FloatType;
|
|
1039
|
+
readonly lng: FloatType;
|
|
1040
|
+
}>;
|
|
1041
|
+
readonly label: OptionType<StringType>;
|
|
1042
|
+
readonly icon: OptionType<StringType>;
|
|
1043
|
+
readonly tone: OptionType<import("@elaraai/east").VariantType<{
|
|
1044
|
+
readonly brand: NullType;
|
|
1045
|
+
readonly ink: NullType;
|
|
1046
|
+
readonly muted: NullType;
|
|
1047
|
+
readonly success: NullType;
|
|
1048
|
+
readonly warning: NullType;
|
|
1049
|
+
readonly danger: NullType;
|
|
1050
|
+
}>>;
|
|
1051
|
+
readonly minZoom: OptionType<IntegerType>;
|
|
1052
|
+
readonly interactive: OptionType<BooleanType>;
|
|
1053
|
+
}>;
|
|
1054
|
+
/**
|
|
1055
|
+
* Line render style (`solid` / `dashed`).
|
|
1056
|
+
*
|
|
1057
|
+
* @property solid - A solid connector
|
|
1058
|
+
* @property dashed - A dashed / routing connector
|
|
1059
|
+
*/
|
|
1060
|
+
readonly LineStyle: import("@elaraai/east").VariantType<{
|
|
1061
|
+
readonly solid: StructType<{
|
|
1062
|
+
readonly tone: OptionType<import("@elaraai/east").VariantType<{
|
|
1063
|
+
readonly brand: NullType;
|
|
1064
|
+
readonly ink: NullType;
|
|
1065
|
+
readonly muted: NullType;
|
|
1066
|
+
readonly success: NullType;
|
|
1067
|
+
readonly warning: NullType;
|
|
1068
|
+
readonly danger: NullType;
|
|
1069
|
+
}>>;
|
|
1070
|
+
readonly weight: OptionType<FloatType>;
|
|
1071
|
+
}>;
|
|
1072
|
+
readonly dashed: StructType<{
|
|
1073
|
+
readonly tone: OptionType<import("@elaraai/east").VariantType<{
|
|
1074
|
+
readonly brand: NullType;
|
|
1075
|
+
readonly ink: NullType;
|
|
1076
|
+
readonly muted: NullType;
|
|
1077
|
+
readonly success: NullType;
|
|
1078
|
+
readonly warning: NullType;
|
|
1079
|
+
readonly danger: NullType;
|
|
1080
|
+
}>>;
|
|
1081
|
+
readonly weight: OptionType<FloatType>;
|
|
1082
|
+
}>;
|
|
1083
|
+
}>;
|
|
1084
|
+
/**
|
|
1085
|
+
* A resolved line.
|
|
1086
|
+
*
|
|
1087
|
+
* @property key - Line identity
|
|
1088
|
+
* @property points - The polyline points
|
|
1089
|
+
* @property style - Render style
|
|
1090
|
+
* @property flow - Optional animated dash-offset
|
|
1091
|
+
*/
|
|
1092
|
+
readonly Line: StructType<{
|
|
1093
|
+
readonly key: StringType;
|
|
1094
|
+
readonly points: ArrayType<StructType<{
|
|
1095
|
+
readonly lat: FloatType;
|
|
1096
|
+
readonly lng: FloatType;
|
|
1097
|
+
}>>;
|
|
1098
|
+
readonly style: import("@elaraai/east").VariantType<{
|
|
1099
|
+
readonly solid: StructType<{
|
|
1100
|
+
readonly tone: OptionType<import("@elaraai/east").VariantType<{
|
|
1101
|
+
readonly brand: NullType;
|
|
1102
|
+
readonly ink: NullType;
|
|
1103
|
+
readonly muted: NullType;
|
|
1104
|
+
readonly success: NullType;
|
|
1105
|
+
readonly warning: NullType;
|
|
1106
|
+
readonly danger: NullType;
|
|
1107
|
+
}>>;
|
|
1108
|
+
readonly weight: OptionType<FloatType>;
|
|
1109
|
+
}>;
|
|
1110
|
+
readonly dashed: StructType<{
|
|
1111
|
+
readonly tone: OptionType<import("@elaraai/east").VariantType<{
|
|
1112
|
+
readonly brand: NullType;
|
|
1113
|
+
readonly ink: NullType;
|
|
1114
|
+
readonly muted: NullType;
|
|
1115
|
+
readonly success: NullType;
|
|
1116
|
+
readonly warning: NullType;
|
|
1117
|
+
readonly danger: NullType;
|
|
1118
|
+
}>>;
|
|
1119
|
+
readonly weight: OptionType<FloatType>;
|
|
1120
|
+
}>;
|
|
1121
|
+
}>;
|
|
1122
|
+
readonly flow: OptionType<BooleanType>;
|
|
1123
|
+
readonly arrow: OptionType<BooleanType>;
|
|
1124
|
+
}>;
|
|
1125
|
+
/**
|
|
1126
|
+
* A resolved standalone label.
|
|
1127
|
+
*
|
|
1128
|
+
* @property key - Label identity
|
|
1129
|
+
* @property at - The anchor
|
|
1130
|
+
* @property text - The text
|
|
1131
|
+
*/
|
|
1132
|
+
readonly Label: StructType<{
|
|
1133
|
+
readonly key: StringType;
|
|
1134
|
+
readonly at: StructType<{
|
|
1135
|
+
readonly lat: FloatType;
|
|
1136
|
+
readonly lng: FloatType;
|
|
1137
|
+
}>;
|
|
1138
|
+
readonly text: StringType;
|
|
1139
|
+
}>;
|
|
1140
|
+
/**
|
|
1141
|
+
* The overlay slot value.
|
|
1142
|
+
*
|
|
1143
|
+
* @property content - The East child tree
|
|
1144
|
+
* @property align - Horizontal screen anchor
|
|
1145
|
+
* @property verticalAlign - Vertical screen anchor
|
|
1146
|
+
* @property geoAnchor - Optional coordinate anchor
|
|
1147
|
+
*/
|
|
1148
|
+
readonly Overlay: StructType<{
|
|
1149
|
+
/** The East child tree rendered over the canvas */
|
|
1150
|
+
readonly content: import("@elaraai/east").RecursiveType<import("../../component.js").UIComponentNode>;
|
|
1151
|
+
/** Horizontal screen anchor */
|
|
1152
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
1153
|
+
readonly start: NullType;
|
|
1154
|
+
readonly center: NullType;
|
|
1155
|
+
readonly end: NullType;
|
|
1156
|
+
}>;
|
|
1157
|
+
/** Vertical screen anchor */
|
|
1158
|
+
readonly verticalAlign: import("@elaraai/east").VariantType<{
|
|
1159
|
+
readonly start: NullType;
|
|
1160
|
+
readonly center: NullType;
|
|
1161
|
+
readonly end: NullType;
|
|
1162
|
+
}>;
|
|
1163
|
+
/** Optional stable child storage-key segment */
|
|
1164
|
+
readonly key: OptionType<StringType>;
|
|
1165
|
+
/** Optional coordinate the overlay follows on pan / zoom */
|
|
1166
|
+
readonly geoAnchor: OptionType<StructType<{
|
|
1167
|
+
readonly lat: FloatType;
|
|
1168
|
+
readonly lng: FloatType;
|
|
1169
|
+
}>>;
|
|
1170
|
+
/** Optional px nudge from the anchor */
|
|
1171
|
+
readonly offset: OptionType<StructType<{
|
|
1172
|
+
readonly x: FloatType;
|
|
1173
|
+
readonly y: FloatType;
|
|
1174
|
+
}>>;
|
|
1175
|
+
/** Optional pointer-events flag (default true; false ⇒ click-through) */
|
|
1176
|
+
readonly interactive: OptionType<BooleanType>;
|
|
1177
|
+
}>;
|
|
1178
|
+
};
|
|
1179
|
+
};
|
|
1180
|
+
//# sourceMappingURL=index.d.ts.map
|