@elaraai/east-ui 1.0.97 → 1.0.98
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 +0 -1
- package/dist/src/collections/index.d.ts.map +1 -1
- package/dist/src/collections/index.js +0 -1
- package/dist/src/collections/index.js.map +1 -1
- package/dist/src/component.d.ts +0 -999
- package/dist/src/component.d.ts.map +1 -1
- package/dist/src/component.js +0 -44
- package/dist/src/component.js.map +1 -1
- package/dist/src/contracts/drag.d.ts +2 -2
- package/dist/src/contracts/drag.js +2 -2
- package/dist/src/contracts/editing.d.ts +4 -0
- package/dist/src/contracts/editing.d.ts.map +1 -1
- package/dist/src/contracts/editing.js +2 -1
- package/dist/src/contracts/editing.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +4 -1
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +5 -2
- package/dist/src/internal.js.map +1 -1
- package/dist/src/layout/snap-grid/index.d.ts +1 -0
- package/dist/src/layout/snap-grid/index.d.ts.map +1 -1
- package/dist/src/pick/panel/index.js +1 -1
- package/dist/src/pick/panel/index.js.map +1 -1
- package/dist/src/platform/slice/index.d.ts +4 -7
- package/dist/src/platform/slice/index.d.ts.map +1 -1
- package/dist/src/platform/slice/index.js +5 -8
- package/dist/src/platform/slice/index.js.map +1 -1
- package/dist/src/platform/slice/record-area.d.ts +181 -0
- package/dist/src/platform/slice/record-area.d.ts.map +1 -0
- package/dist/src/platform/slice/record-area.js +304 -0
- package/dist/src/platform/slice/record-area.js.map +1 -0
- package/dist/src/platform/slice/record-chrome.d.ts +138 -0
- package/dist/src/platform/slice/record-chrome.d.ts.map +1 -1
- package/dist/src/platform/slice/record-plan.d.ts +34 -1
- package/dist/src/platform/slice/record-plan.d.ts.map +1 -1
- package/dist/src/platform/slice/record-plan.js +126 -3
- package/dist/src/platform/slice/record-plan.js.map +1 -1
- package/dist/src/platform/slice/record-series.d.ts +166 -0
- package/dist/src/platform/slice/record-series.d.ts.map +1 -0
- package/dist/src/platform/slice/record-series.js +258 -0
- package/dist/src/platform/slice/record-series.js.map +1 -0
- package/dist/src/platform/slice/record-types.d.ts +1862 -13
- package/dist/src/platform/slice/record-types.d.ts.map +1 -1
- package/dist/src/platform/slice/record-types.js +50 -4
- package/dist/src/platform/slice/record-types.js.map +1 -1
- package/dist/src/platform/slice/record.d.ts +17 -2
- package/dist/src/platform/slice/record.d.ts.map +1 -1
- package/dist/src/platform/slice/record.js +62 -9
- package/dist/src/platform/slice/record.js.map +1 -1
- package/dist/src/runtime/collections/index.d.ts +0 -1
- package/dist/src/runtime/collections/index.d.ts.map +1 -1
- package/dist/src/runtime/collections/index.js +0 -1
- package/dist/src/runtime/collections/index.js.map +1 -1
- package/dist/src/runtime/record-slice-source.d.ts +298 -0
- package/dist/src/runtime/record-slice-source.d.ts.map +1 -1
- package/dist/src/runtime/record-slice-source.js +554 -16
- package/dist/src/runtime/record-slice-source.js.map +1 -1
- package/dist/src/runtime/record-slice.d.ts +87 -3
- package/dist/src/runtime/record-slice.d.ts.map +1 -1
- package/dist/src/runtime/record-slice.js +175 -12
- package/dist/src/runtime/record-slice.js.map +1 -1
- package/dist/src/slice/record/index.d.ts +69 -0
- package/dist/src/slice/record/index.d.ts.map +1 -1
- package/dist/src/style/color.d.ts +237 -0
- package/dist/src/style/color.d.ts.map +1 -0
- package/dist/src/style/color.js +105 -0
- package/dist/src/style/color.js.map +1 -0
- package/dist/src/style/namespace.d.ts +151 -1
- package/dist/src/style/namespace.d.ts.map +1 -1
- package/dist/src/style/namespace.js +9 -1
- package/dist/src/style/namespace.js.map +1 -1
- package/dist/src/style.d.ts +3 -0
- package/dist/src/style.d.ts.map +1 -1
- package/dist/src/style.js +3 -0
- package/dist/src/style.js.map +1 -1
- package/dist/test/style.examples.d.ts +1 -0
- package/dist/test/style.examples.d.ts.map +1 -1
- package/dist/test/style.examples.js +17 -2
- package/dist/test/style.examples.js.map +1 -1
- package/package.json +4 -4
- package/dist/src/collections/schematic/index.d.ts +0 -1390
- package/dist/src/collections/schematic/index.d.ts.map +0 -1
- package/dist/src/collections/schematic/index.js +0 -815
- package/dist/src/collections/schematic/index.js.map +0 -1
- package/dist/src/collections/schematic/types.d.ts +0 -1183
- package/dist/src/collections/schematic/types.d.ts.map +0 -1
- package/dist/src/collections/schematic/types.js +0 -724
- package/dist/src/collections/schematic/types.js.map +0 -1
- package/dist/src/runtime/collections/schematic.d.ts +0 -73
- package/dist/src/runtime/collections/schematic.d.ts.map +0 -1
- package/dist/src/runtime/collections/schematic.js +0 -69
- package/dist/src/runtime/collections/schematic.js.map +0 -1
- package/dist/test/collections/schematic.examples.d.ts +0 -23
- package/dist/test/collections/schematic.examples.d.ts.map +0 -1
- package/dist/test/collections/schematic.examples.js +0 -602
- package/dist/test/collections/schematic.examples.js.map +0 -1
|
@@ -0,0 +1,181 @@
|
|
|
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
|
+
* Queries for e3's generated area index (#1385): a loose quadtree laid along a
|
|
7
|
+
* Z-order curve (XZ-ordering), whose keys e3's `e3.recordIndex.area` files each
|
|
8
|
+
* row under once. The twin of `record-interval.ts`.
|
|
9
|
+
*
|
|
10
|
+
* The index's domain is the square `[−cell·2²⁷, cell·2²⁷)` world units in 29
|
|
11
|
+
* levels, a level-L cell `s_L = cell · 2^(28−L)` wide. A row is filed at the
|
|
12
|
+
* deepest level whose cell is at least twice its box's larger side, in the cell
|
|
13
|
+
* holding its box's centre, so its box lies within that cell grown by `s_L/4`
|
|
14
|
+
* on each side (its loose bounds); its key is `m · 32 + L`, `m` the cell's
|
|
15
|
+
* Morton code aligned to level 28 (x in the even bits, y in the odd). A row with
|
|
16
|
+
* no place is `−1`; one outside the domain, not finite or larger than half of it
|
|
17
|
+
* is the root's, `0`.
|
|
18
|
+
*/
|
|
19
|
+
import { type ValueTypeOf } from "@elaraai/east";
|
|
20
|
+
import type { SeekQueryType } from "../../contracts/source.js";
|
|
21
|
+
import type { RecordSliceChoiceType } from "./record-types.js";
|
|
22
|
+
/** The area index's key field: the row's cell and level, after its leading fields. */
|
|
23
|
+
export declare const AREA_FIELD = "__area";
|
|
24
|
+
/** How an area index reads a row's box, as a binding's index metadata carries it. */
|
|
25
|
+
export interface AreaMarker {
|
|
26
|
+
/** The row field holding the box's `x`. */
|
|
27
|
+
readonly x: string;
|
|
28
|
+
/** The row field holding its `y`. */
|
|
29
|
+
readonly y: string;
|
|
30
|
+
/** The row field holding its width; absent for a point. */
|
|
31
|
+
readonly width?: string;
|
|
32
|
+
/** The row field holding its height; absent for a point. */
|
|
33
|
+
readonly height?: string;
|
|
34
|
+
/** Whether `x`, `y` is the box's centre, rather than its minimum corner. */
|
|
35
|
+
readonly centre: boolean;
|
|
36
|
+
/** The finest cell's side in world units, a power of two. */
|
|
37
|
+
readonly cell: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The names of the struct `Data.bindPaged` marks an area index's `__area` with
|
|
41
|
+
* in a binding's index metadata, as an interval's start is marked with a struct
|
|
42
|
+
* naming its end: the box's fields in order — `x`, `y`, then `width` and
|
|
43
|
+
* `height` when given — each named with its role (`x=…`), so one field may hold
|
|
44
|
+
* two roles; `__centre` when the box is placed by its centre; and the cell's
|
|
45
|
+
* power of two (`cell=…`).
|
|
46
|
+
*
|
|
47
|
+
* @param box - How the index reads a row's box
|
|
48
|
+
* @returns The marker struct's field names, in order
|
|
49
|
+
*/
|
|
50
|
+
export declare function areaMarkerFields(box: AreaMarker): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Read an area index's box back from its `__area` marker's field names
|
|
53
|
+
* ({@link areaMarkerFields}).
|
|
54
|
+
*
|
|
55
|
+
* @param names - The marker struct's field names
|
|
56
|
+
* @returns The box, or `undefined` when the names are not an area marker's
|
|
57
|
+
*/
|
|
58
|
+
export declare function readAreaMarker(names: readonly string[]): AreaMarker | undefined;
|
|
59
|
+
/** The finest level: a level-28 cell is `cell` wide. */
|
|
60
|
+
export declare const AREA_FINEST_LEVEL = 28;
|
|
61
|
+
/** The `__area` an unplaced row files under, as its `.east` literal: the unplaced clause's one value. */
|
|
62
|
+
export declare const AREA_UNPLACED: string;
|
|
63
|
+
/** The most searches a window takes a combination of leading values (§11.3). */
|
|
64
|
+
export declare const MAX_AREA_SEARCHES = 266;
|
|
65
|
+
/** A window's box in world units, the `window` clause's value. */
|
|
66
|
+
export type AreaWindow = Extract<ValueTypeOf<RecordSliceChoiceType>, {
|
|
67
|
+
type: "window";
|
|
68
|
+
}>["value"];
|
|
69
|
+
/**
|
|
70
|
+
* One cell of an area index that a window or a density raster searches
|
|
71
|
+
* (§11.3, D25): its level, where it is, and the search its rows file under —
|
|
72
|
+
* at the window's or the raster's own level, the range from its own key up to
|
|
73
|
+
* its last descendant's, which holds every row filed at that level or finer
|
|
74
|
+
* whose centre lies in it; at a coarser level, its exact key, which holds the
|
|
75
|
+
* rows filed in it, their centres anywhere in it.
|
|
76
|
+
*/
|
|
77
|
+
export interface AreaCell {
|
|
78
|
+
/** Its level. */
|
|
79
|
+
readonly level: number;
|
|
80
|
+
/** Its index along x, at its level. */
|
|
81
|
+
readonly ix: number;
|
|
82
|
+
/** Its index along y. */
|
|
83
|
+
readonly iy: number;
|
|
84
|
+
/** Its left edge, in world units. */
|
|
85
|
+
readonly minX: number;
|
|
86
|
+
/** Its top edge. */
|
|
87
|
+
readonly minY: number;
|
|
88
|
+
/** Its side, in world units: `cell · 2^(28 − level)`. */
|
|
89
|
+
readonly side: number;
|
|
90
|
+
/** The search its rows file under: a range at the window's or the raster's level, an exact key at a coarser one. */
|
|
91
|
+
readonly query: ValueTypeOf<SeekQueryType>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Plan a window over an area index (§11.3): at most {@link MAX_AREA_SEARCHES}
|
|
95
|
+
* disjoint key searches for one combination of the index's leading values,
|
|
96
|
+
* which together hold every row whose box meets the window, each once — each
|
|
97
|
+
* search a cell, where it is beside it, so a reader can weigh its count by
|
|
98
|
+
* how much of the cell a view holds.
|
|
99
|
+
*
|
|
100
|
+
* 1. The window is the viewport grown by an eighth of its larger side on each
|
|
101
|
+
* side: the margin, which keeps a pan of that much in hand.
|
|
102
|
+
* 2. `C` is the deepest level whose cell is at least an eighth of the window's
|
|
103
|
+
* larger side.
|
|
104
|
+
* 3. At each level coarser than `C`, the exact key of each cell whose loose
|
|
105
|
+
* bounds meet the window. The root is searched whatever the window, since a
|
|
106
|
+
* row outside the domain, or not finite, files under it.
|
|
107
|
+
* 4. At `C`, for each cell whose loose bounds meet the window, the range from
|
|
108
|
+
* its own key up to its last descendant's, which starts above the coarser
|
|
109
|
+
* cells sharing its corner that step 3 reads.
|
|
110
|
+
*
|
|
111
|
+
* Cells are never merged, so a cell's search is the same in every window that
|
|
112
|
+
* holds it, and a pan searches only the cells it adds. What the searches hold
|
|
113
|
+
* beyond the window — rows of a searched cell that the window misses — is the
|
|
114
|
+
* reader's to draw or not.
|
|
115
|
+
*
|
|
116
|
+
* @param prefix - The `.east` literals of the index's leading fields, in order
|
|
117
|
+
* @param box - The viewport, in world units: its minimum and maximum corners
|
|
118
|
+
* @param cell - The index's finest cell's side, a power of two (its `area.cell`)
|
|
119
|
+
* @returns The cells, in their searches' key order
|
|
120
|
+
* @throws {Error} When the viewport is not finite or its maximum is below its
|
|
121
|
+
* minimum, or when `cell` is not a positive power of two
|
|
122
|
+
*/
|
|
123
|
+
export declare function areaCells(prefix: readonly string[], box: AreaWindow, cell: number): AreaCell[];
|
|
124
|
+
/**
|
|
125
|
+
* Plan a window over an area index (§11.3): its searches, as
|
|
126
|
+
* {@link areaCells} plans them, without where each cell is.
|
|
127
|
+
*
|
|
128
|
+
* @param prefix - The `.east` literals of the index's leading fields, in order
|
|
129
|
+
* @param box - The viewport, in world units: its minimum and maximum corners
|
|
130
|
+
* @param cell - The index's finest cell's side, a power of two (its `area.cell`)
|
|
131
|
+
* @returns The searches, in key order
|
|
132
|
+
* @throws {Error} As {@link areaCells} does
|
|
133
|
+
*/
|
|
134
|
+
export declare function areaQueries(prefix: readonly string[], box: AreaWindow, cell: number): ValueTypeOf<SeekQueryType>[];
|
|
135
|
+
/** The most counted ranges a density raster asks in one request (§10.4, D25). */
|
|
136
|
+
export declare const MAX_AREA_RASTER = 4096;
|
|
137
|
+
/** A density raster over a box (§10.4, D25): its level's cells, counted, and the coarser levels' cells, by exact key. */
|
|
138
|
+
export interface AreaRaster {
|
|
139
|
+
/** Its level. */
|
|
140
|
+
readonly level: number;
|
|
141
|
+
/** Its cells' side, in world units. */
|
|
142
|
+
readonly side: number;
|
|
143
|
+
/**
|
|
144
|
+
* Its cells that meet the box, row by row: each the range holding its own rows and every finer level's inside it, so
|
|
145
|
+
* a row counts once, in the cell holding its centre.
|
|
146
|
+
*/
|
|
147
|
+
readonly cells: readonly AreaCell[];
|
|
148
|
+
/**
|
|
149
|
+
* The coarser levels' cells whose loose bounds meet the box, in key order, each by its exact key: their rows are
|
|
150
|
+
* boxes larger than half a raster cell, their centres anywhere in it, which the raster's ranges leave out — counted
|
|
151
|
+
* by their keys and read as rows while they are few.
|
|
152
|
+
*/
|
|
153
|
+
readonly coarse: readonly AreaCell[];
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Plan a density raster over an area index (§10.4, D25): the counts of its
|
|
157
|
+
* cells at the level whose cells are about a sixty-fourth of the box's larger
|
|
158
|
+
* side, for one combination of the index's leading values, and no row read.
|
|
159
|
+
*
|
|
160
|
+
* 1. The raster's level `R` is the deepest whose cell is at least a
|
|
161
|
+
* sixty-fourth of the box's larger side, coarser while its cells meeting
|
|
162
|
+
* the box number more than `budget`.
|
|
163
|
+
* 2. Each level-`R` cell meeting the box is the range from its own key up to
|
|
164
|
+
* its last descendant's, as {@link areaQueries}' finest level is: it holds
|
|
165
|
+
* every row filed at `R` or finer whose centre lies in the cell, so a row
|
|
166
|
+
* counts once, in the cell holding its centre.
|
|
167
|
+
* 3. At each level coarser than `R`, each cell whose loose bounds meet the
|
|
168
|
+
* box, the root among them, by its exact key: those rows are boxes larger
|
|
169
|
+
* than half a raster cell, which the ranges leave out — counted by their
|
|
170
|
+
* keys, and read as rows while they are few.
|
|
171
|
+
*
|
|
172
|
+
* @param prefix - The `.east` literals of the index's leading fields, in order
|
|
173
|
+
* @param box - The box the raster covers, in world units
|
|
174
|
+
* @param cell - The index's finest cell's side, a power of two (its `area.cell`)
|
|
175
|
+
* @param budget - The most cells the raster takes
|
|
176
|
+
* @returns The raster's level, its cells' side, its cells and the coarser levels' cells
|
|
177
|
+
* @throws {Error} When the box is not finite or its maximum is below its minimum, when `cell` is not a positive power of
|
|
178
|
+
* two, or when `budget` is not a positive whole number
|
|
179
|
+
*/
|
|
180
|
+
export declare function areaRaster(prefix: readonly string[], box: AreaWindow, cell: number, budget?: number): AreaRaster;
|
|
181
|
+
//# sourceMappingURL=record-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-area.d.ts","sourceRoot":"","sources":["../../../../src/platform/slice/record-area.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAyE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,sFAAsF;AACtF,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC,qFAAqF;AACrF,MAAM,WAAW,UAAU;IACvB,2CAA2C;IAC3C,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,QAAQ,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E,WAAW,CAAC,aAAa,CAAC,CAAC;CAC9C;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAkC9F;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,aAAa,CAAC,EAAE,CAElH;AAED,iFAAiF;AACjF,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,yHAAyH;AACzH,MAAM,WAAW,UAAU;IACvB,iBAAiB;IACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAwB,GAAG,UAAU,CAmDjI"}
|
|
@@ -0,0 +1,304 @@
|
|
|
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
|
+
* Queries for e3's generated area index (#1385): a loose quadtree laid along a
|
|
7
|
+
* Z-order curve (XZ-ordering), whose keys e3's `e3.recordIndex.area` files each
|
|
8
|
+
* row under once. The twin of `record-interval.ts`.
|
|
9
|
+
*
|
|
10
|
+
* The index's domain is the square `[−cell·2²⁷, cell·2²⁷)` world units in 29
|
|
11
|
+
* levels, a level-L cell `s_L = cell · 2^(28−L)` wide. A row is filed at the
|
|
12
|
+
* deepest level whose cell is at least twice its box's larger side, in the cell
|
|
13
|
+
* holding its box's centre, so its box lies within that cell grown by `s_L/4`
|
|
14
|
+
* on each side (its loose bounds); its key is `m · 32 + L`, `m` the cell's
|
|
15
|
+
* Morton code aligned to level 28 (x in the even bits, y in the odd). A row with
|
|
16
|
+
* no place is `−1`; one outside the domain, not finite or larger than half of it
|
|
17
|
+
* is the root's, `0`.
|
|
18
|
+
*/
|
|
19
|
+
import { FloatType, IntegerType, compareFor, none, parseFor, printFor, variant } from "@elaraai/east";
|
|
20
|
+
/** The area index's key field: the row's cell and level, after its leading fields. */
|
|
21
|
+
export const AREA_FIELD = "__area";
|
|
22
|
+
/** The marker's name for a box placed by its centre. */
|
|
23
|
+
const AREA_CENTRE = "__centre";
|
|
24
|
+
const AREA_ROLES = ["x", "y", "width", "height", "cell"];
|
|
25
|
+
const floatText = printFor(FloatType);
|
|
26
|
+
const floatOf = parseFor(FloatType);
|
|
27
|
+
/**
|
|
28
|
+
* The names of the struct `Data.bindPaged` marks an area index's `__area` with
|
|
29
|
+
* in a binding's index metadata, as an interval's start is marked with a struct
|
|
30
|
+
* naming its end: the box's fields in order — `x`, `y`, then `width` and
|
|
31
|
+
* `height` when given — each named with its role (`x=…`), so one field may hold
|
|
32
|
+
* two roles; `__centre` when the box is placed by its centre; and the cell's
|
|
33
|
+
* power of two (`cell=…`).
|
|
34
|
+
*
|
|
35
|
+
* @param box - How the index reads a row's box
|
|
36
|
+
* @returns The marker struct's field names, in order
|
|
37
|
+
*/
|
|
38
|
+
export function areaMarkerFields(box) {
|
|
39
|
+
return [`x=${box.x}`, `y=${box.y}`,
|
|
40
|
+
...(box.width === undefined || box.height === undefined ? [] : [`width=${box.width}`, `height=${box.height}`]),
|
|
41
|
+
...(box.centre ? [AREA_CENTRE] : []), `cell=${floatText(box.cell)}`];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Read an area index's box back from its `__area` marker's field names
|
|
45
|
+
* ({@link areaMarkerFields}).
|
|
46
|
+
*
|
|
47
|
+
* @param names - The marker struct's field names
|
|
48
|
+
* @returns The box, or `undefined` when the names are not an area marker's
|
|
49
|
+
*/
|
|
50
|
+
export function readAreaMarker(names) {
|
|
51
|
+
const roles = new Map();
|
|
52
|
+
let centre = false;
|
|
53
|
+
for (const name of names) {
|
|
54
|
+
if (name === AREA_CENTRE) {
|
|
55
|
+
if (centre)
|
|
56
|
+
return undefined;
|
|
57
|
+
centre = true;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const at = name.indexOf("=");
|
|
61
|
+
const role = name.slice(0, Math.max(at, 0));
|
|
62
|
+
if (at <= 0 || !AREA_ROLES.includes(role) || roles.has(role))
|
|
63
|
+
return undefined;
|
|
64
|
+
roles.set(role, name.slice(at + 1));
|
|
65
|
+
}
|
|
66
|
+
const x = roles.get("x"), y = roles.get("y"), width = roles.get("width"), height = roles.get("height");
|
|
67
|
+
const cell = floatOf(roles.get("cell") ?? "");
|
|
68
|
+
if (x === undefined || y === undefined || (width === undefined) !== (height === undefined) || !cell.success || !(cell.value > 0))
|
|
69
|
+
return undefined;
|
|
70
|
+
return { x, y, ...(width !== undefined && height !== undefined && { width, height }), centre, cell: cell.value };
|
|
71
|
+
}
|
|
72
|
+
/** The finest level: a level-28 cell is `cell` wide. */
|
|
73
|
+
export const AREA_FINEST_LEVEL = 28;
|
|
74
|
+
/** The `__area` an unplaced row files under, as its `.east` literal: the unplaced clause's one value. */
|
|
75
|
+
export const AREA_UNPLACED = printFor(IntegerType)(-1n);
|
|
76
|
+
/** The most searches a window takes a combination of leading values (§11.3). */
|
|
77
|
+
export const MAX_AREA_SEARCHES = 266;
|
|
78
|
+
const integerText = printFor(IntegerType);
|
|
79
|
+
const keyOrder = compareFor(IntegerType);
|
|
80
|
+
const FINEST = BigInt(AREA_FINEST_LEVEL);
|
|
81
|
+
/**
|
|
82
|
+
* The cells of a level whose loose bounds meet an interval, on one axis.
|
|
83
|
+
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* Every bound is exact: a cell's edges are multiples of its side, a power of
|
|
86
|
+
* two, and its loose bounds a quarter of its side beyond them. A row placed by
|
|
87
|
+
* its box's corner is filed by the centre its key function computes, `x + w/2`,
|
|
88
|
+
* which rounds at most onto a cell's edge, never past one, so its box lies
|
|
89
|
+
* within the loose bounds of the cell it is filed in, as a centred box's does.
|
|
90
|
+
*
|
|
91
|
+
* @param from - The interval's lower end
|
|
92
|
+
* @param to - Its upper end
|
|
93
|
+
* @param half - Half the domain's side
|
|
94
|
+
* @param size - The level's cell side
|
|
95
|
+
* @param count - The level's cells along the axis
|
|
96
|
+
* @returns The cells' indices along the axis, ascending
|
|
97
|
+
*/
|
|
98
|
+
function cellsMeeting(from, to, half, size, count) {
|
|
99
|
+
const reach = size / 4;
|
|
100
|
+
// A conservative span of candidates, each then held to the exact test.
|
|
101
|
+
const lo = Math.max(0, Math.floor((from + half - size - reach) / size) - 1);
|
|
102
|
+
const hi = Math.min(count - 1, Math.floor((to + half + reach) / size) + 1);
|
|
103
|
+
const cells = [];
|
|
104
|
+
for (let i = lo; i <= hi; i++) {
|
|
105
|
+
const start = -half + i * size;
|
|
106
|
+
if (start - reach <= to && start + size + reach >= from)
|
|
107
|
+
cells.push(i);
|
|
108
|
+
}
|
|
109
|
+
return cells;
|
|
110
|
+
}
|
|
111
|
+
/** Each byte's bits spread to the even places of sixteen: a byte of one axis's half of a Morton code. */
|
|
112
|
+
const SPREAD = Array.from({ length: 256 }, (_, byte) => {
|
|
113
|
+
let spread = 0;
|
|
114
|
+
for (let bit = 0; bit < 8; bit++)
|
|
115
|
+
spread |= ((byte >> bit) & 1) << (2 * bit);
|
|
116
|
+
return spread;
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* The Morton code of a level's cell, aligned to the finest level: a byte of
|
|
120
|
+
* each axis at a time, as a raster of thousands of cells computes thousands.
|
|
121
|
+
*
|
|
122
|
+
* @param ix - The cell's index along x at its level, below `2 ** level`
|
|
123
|
+
* @param iy - Its index along y
|
|
124
|
+
* @param level - Its level
|
|
125
|
+
* @returns x's bits in the even places, y's in the odd, shifted to level 28
|
|
126
|
+
*/
|
|
127
|
+
function morton(ix, iy, level) {
|
|
128
|
+
let code = 0n;
|
|
129
|
+
for (let byte = 3; byte >= 0; byte--) {
|
|
130
|
+
const shift = 8 * byte;
|
|
131
|
+
code = (code << 16n) | BigInt(SPREAD[(ix >>> shift) & 255] | (SPREAD[(iy >>> shift) & 255] << 1));
|
|
132
|
+
}
|
|
133
|
+
return code << BigInt(2 * (AREA_FINEST_LEVEL - level));
|
|
134
|
+
}
|
|
135
|
+
/** A level's cell, its search given: where it is, from its indices. */
|
|
136
|
+
function cellAt(level, ix, iy, half, side, query) {
|
|
137
|
+
return { level, ix, iy, minX: -half + ix * side, minY: -half + iy * side, side, query };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Plan a window over an area index (§11.3): at most {@link MAX_AREA_SEARCHES}
|
|
141
|
+
* disjoint key searches for one combination of the index's leading values,
|
|
142
|
+
* which together hold every row whose box meets the window, each once — each
|
|
143
|
+
* search a cell, where it is beside it, so a reader can weigh its count by
|
|
144
|
+
* how much of the cell a view holds.
|
|
145
|
+
*
|
|
146
|
+
* 1. The window is the viewport grown by an eighth of its larger side on each
|
|
147
|
+
* side: the margin, which keeps a pan of that much in hand.
|
|
148
|
+
* 2. `C` is the deepest level whose cell is at least an eighth of the window's
|
|
149
|
+
* larger side.
|
|
150
|
+
* 3. At each level coarser than `C`, the exact key of each cell whose loose
|
|
151
|
+
* bounds meet the window. The root is searched whatever the window, since a
|
|
152
|
+
* row outside the domain, or not finite, files under it.
|
|
153
|
+
* 4. At `C`, for each cell whose loose bounds meet the window, the range from
|
|
154
|
+
* its own key up to its last descendant's, which starts above the coarser
|
|
155
|
+
* cells sharing its corner that step 3 reads.
|
|
156
|
+
*
|
|
157
|
+
* Cells are never merged, so a cell's search is the same in every window that
|
|
158
|
+
* holds it, and a pan searches only the cells it adds. What the searches hold
|
|
159
|
+
* beyond the window — rows of a searched cell that the window misses — is the
|
|
160
|
+
* reader's to draw or not.
|
|
161
|
+
*
|
|
162
|
+
* @param prefix - The `.east` literals of the index's leading fields, in order
|
|
163
|
+
* @param box - The viewport, in world units: its minimum and maximum corners
|
|
164
|
+
* @param cell - The index's finest cell's side, a power of two (its `area.cell`)
|
|
165
|
+
* @returns The cells, in their searches' key order
|
|
166
|
+
* @throws {Error} When the viewport is not finite or its maximum is below its
|
|
167
|
+
* minimum, or when `cell` is not a positive power of two
|
|
168
|
+
*/
|
|
169
|
+
export function areaCells(prefix, box, cell) {
|
|
170
|
+
const { minX, minY, maxX, maxY } = box;
|
|
171
|
+
if (![minX, minY, maxX, maxY].every(Number.isFinite))
|
|
172
|
+
throw new Error("Choose a window with finite bounds");
|
|
173
|
+
if (maxX < minX || maxY < minY)
|
|
174
|
+
throw new Error("A window's maximum is below its minimum");
|
|
175
|
+
if (!Number.isFinite(cell) || cell <= 0 || 2 ** Math.round(Math.log2(cell)) !== cell) {
|
|
176
|
+
throw new Error(`An area index's cell is a positive power of two, not ${cell}`);
|
|
177
|
+
}
|
|
178
|
+
const margin = Math.max(maxX - minX, maxY - minY) / 8;
|
|
179
|
+
const fromX = minX - margin, toX = maxX + margin, fromY = minY - margin, toY = maxY + margin;
|
|
180
|
+
const larger = Math.max(toX - fromX, toY - fromY);
|
|
181
|
+
const half = cell * 2 ** 27;
|
|
182
|
+
let deepest = AREA_FINEST_LEVEL;
|
|
183
|
+
while (deepest > 0 && cell * 2 ** (AREA_FINEST_LEVEL - deepest) < larger / 8)
|
|
184
|
+
deepest--;
|
|
185
|
+
const searches = [];
|
|
186
|
+
for (let level = 0; level <= deepest; level++) {
|
|
187
|
+
const size = cell * 2 ** (AREA_FINEST_LEVEL - level);
|
|
188
|
+
const count = 2 ** level;
|
|
189
|
+
const xs = level === 0 ? [0] : cellsMeeting(fromX, toX, half, size, count);
|
|
190
|
+
const ys = level === 0 ? [0] : cellsMeeting(fromY, toY, half, size, count);
|
|
191
|
+
for (const ix of xs) {
|
|
192
|
+
for (const iy of ys) {
|
|
193
|
+
const m = morton(ix, iy, level);
|
|
194
|
+
const start = m * 32n + BigInt(level);
|
|
195
|
+
if (level < deepest) {
|
|
196
|
+
searches.push({ start, cell: cellAt(level, ix, iy, half, size, variant("fields", { values: [...prefix, integerText(start)], prefix: none })) });
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
const end = (m + 4n ** (FINEST - BigInt(level))) * 32n;
|
|
200
|
+
const query = variant("range", { from: [...prefix, integerText(start)], to: [...prefix, integerText(end)] });
|
|
201
|
+
searches.push({ start, cell: cellAt(level, ix, iy, half, size, query) });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return searches.sort((a, b) => keyOrder(a.start, b.start)).map(search => search.cell);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Plan a window over an area index (§11.3): its searches, as
|
|
209
|
+
* {@link areaCells} plans them, without where each cell is.
|
|
210
|
+
*
|
|
211
|
+
* @param prefix - The `.east` literals of the index's leading fields, in order
|
|
212
|
+
* @param box - The viewport, in world units: its minimum and maximum corners
|
|
213
|
+
* @param cell - The index's finest cell's side, a power of two (its `area.cell`)
|
|
214
|
+
* @returns The searches, in key order
|
|
215
|
+
* @throws {Error} As {@link areaCells} does
|
|
216
|
+
*/
|
|
217
|
+
export function areaQueries(prefix, box, cell) {
|
|
218
|
+
return areaCells(prefix, box, cell).map(found => found.query);
|
|
219
|
+
}
|
|
220
|
+
/** The most counted ranges a density raster asks in one request (§10.4, D25). */
|
|
221
|
+
export const MAX_AREA_RASTER = 4096;
|
|
222
|
+
/**
|
|
223
|
+
* Plan a density raster over an area index (§10.4, D25): the counts of its
|
|
224
|
+
* cells at the level whose cells are about a sixty-fourth of the box's larger
|
|
225
|
+
* side, for one combination of the index's leading values, and no row read.
|
|
226
|
+
*
|
|
227
|
+
* 1. The raster's level `R` is the deepest whose cell is at least a
|
|
228
|
+
* sixty-fourth of the box's larger side, coarser while its cells meeting
|
|
229
|
+
* the box number more than `budget`.
|
|
230
|
+
* 2. Each level-`R` cell meeting the box is the range from its own key up to
|
|
231
|
+
* its last descendant's, as {@link areaQueries}' finest level is: it holds
|
|
232
|
+
* every row filed at `R` or finer whose centre lies in the cell, so a row
|
|
233
|
+
* counts once, in the cell holding its centre.
|
|
234
|
+
* 3. At each level coarser than `R`, each cell whose loose bounds meet the
|
|
235
|
+
* box, the root among them, by its exact key: those rows are boxes larger
|
|
236
|
+
* than half a raster cell, which the ranges leave out — counted by their
|
|
237
|
+
* keys, and read as rows while they are few.
|
|
238
|
+
*
|
|
239
|
+
* @param prefix - The `.east` literals of the index's leading fields, in order
|
|
240
|
+
* @param box - The box the raster covers, in world units
|
|
241
|
+
* @param cell - The index's finest cell's side, a power of two (its `area.cell`)
|
|
242
|
+
* @param budget - The most cells the raster takes
|
|
243
|
+
* @returns The raster's level, its cells' side, its cells and the coarser levels' cells
|
|
244
|
+
* @throws {Error} When the box is not finite or its maximum is below its minimum, when `cell` is not a positive power of
|
|
245
|
+
* two, or when `budget` is not a positive whole number
|
|
246
|
+
*/
|
|
247
|
+
export function areaRaster(prefix, box, cell, budget = MAX_AREA_RASTER) {
|
|
248
|
+
const { minX, minY, maxX, maxY } = box;
|
|
249
|
+
if (![minX, minY, maxX, maxY].every(Number.isFinite))
|
|
250
|
+
throw new Error("Choose a raster's box with finite bounds");
|
|
251
|
+
if (maxX < minX || maxY < minY)
|
|
252
|
+
throw new Error("A raster's box has its maximum below its minimum");
|
|
253
|
+
if (!Number.isFinite(cell) || cell <= 0 || 2 ** Math.round(Math.log2(cell)) !== cell) {
|
|
254
|
+
throw new Error(`An area index's cell is a positive power of two, not ${cell}`);
|
|
255
|
+
}
|
|
256
|
+
if (!Number.isInteger(budget) || budget < 1)
|
|
257
|
+
throw new Error(`A raster takes at least one cell, not ${budget}`);
|
|
258
|
+
const half = cell * 2 ** 27;
|
|
259
|
+
const larger = Math.max(maxX - minX, maxY - minY);
|
|
260
|
+
// The cells of a level whose own bounds meet an interval, on one axis: the first and the last, inside the domain.
|
|
261
|
+
const span = (from, to, size, count) => {
|
|
262
|
+
const lo = Math.max(0, Math.floor((from + half) / size));
|
|
263
|
+
const hi = Math.min(count - 1, Math.floor((to + half) / size));
|
|
264
|
+
return hi < lo ? undefined : [lo, hi];
|
|
265
|
+
};
|
|
266
|
+
let level = AREA_FINEST_LEVEL;
|
|
267
|
+
while (level > 0 && cell * 2 ** (AREA_FINEST_LEVEL - level) < larger / 64)
|
|
268
|
+
level--;
|
|
269
|
+
const sizeOf = (l) => cell * 2 ** (AREA_FINEST_LEVEL - l);
|
|
270
|
+
const cellsAt = (l) => {
|
|
271
|
+
const xs = span(minX, maxX, sizeOf(l), 2 ** l);
|
|
272
|
+
const ys = span(minY, maxY, sizeOf(l), 2 ** l);
|
|
273
|
+
return xs === undefined || ys === undefined ? 0 : (xs[1] - xs[0] + 1) * (ys[1] - ys[0] + 1);
|
|
274
|
+
};
|
|
275
|
+
while (level > 0 && cellsAt(level) > budget)
|
|
276
|
+
level--;
|
|
277
|
+
const side = sizeOf(level);
|
|
278
|
+
const cells = [];
|
|
279
|
+
const xs = span(minX, maxX, side, 2 ** level);
|
|
280
|
+
const ys = span(minY, maxY, side, 2 ** level);
|
|
281
|
+
if (xs !== undefined && ys !== undefined) {
|
|
282
|
+
const descendants = 4n ** (FINEST - BigInt(level));
|
|
283
|
+
for (let iy = ys[0]; iy <= ys[1]; iy++) {
|
|
284
|
+
for (let ix = xs[0]; ix <= xs[1]; ix++) {
|
|
285
|
+
const m = morton(ix, iy, level);
|
|
286
|
+
const query = variant("range", { from: [...prefix, integerText(m * 32n + BigInt(level))], to: [...prefix, integerText((m + descendants) * 32n)] });
|
|
287
|
+
cells.push(cellAt(level, ix, iy, half, side, query));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
const coarse = [];
|
|
292
|
+
for (let l = 0; l < level; l++) {
|
|
293
|
+
const size = sizeOf(l);
|
|
294
|
+
const count = 2 ** l;
|
|
295
|
+
for (const ix of l === 0 ? [0] : cellsMeeting(minX, maxX, half, size, count)) {
|
|
296
|
+
for (const iy of l === 0 ? [0] : cellsMeeting(minY, maxY, half, size, count)) {
|
|
297
|
+
const start = morton(ix, iy, l) * 32n + BigInt(l);
|
|
298
|
+
coarse.push({ start, cell: cellAt(l, ix, iy, half, size, variant("fields", { values: [...prefix, integerText(start)], prefix: none })) });
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return { level, side, cells, coarse: coarse.sort((a, b) => keyOrder(a.start, b.start)).map(search => search.cell) };
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=record-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-area.js","sourceRoot":"","sources":["../../../../src/platform/slice/record-area.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAoB,MAAM,eAAe,CAAC;AAIxH,sFAAsF;AACtF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAkBnC,wDAAwD;AACxD,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAClE,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEpC;;;;;;;;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