@graview/pages 0.1.74 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/context-menu.d.ts.map +1 -1
  2. package/dist/context-menu.js +11 -1
  3. package/dist/context-menu.js.map +1 -1
  4. package/dist/face-controls.d.ts.map +1 -1
  5. package/dist/face-controls.js +17 -2
  6. package/dist/face-controls.js.map +1 -1
  7. package/dist/held-element.d.ts +12 -0
  8. package/dist/held-element.d.ts.map +1 -0
  9. package/dist/held-element.js +90 -0
  10. package/dist/held-element.js.map +1 -0
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/one-place-city.d.ts +9 -0
  16. package/dist/one-place-city.d.ts.map +1 -0
  17. package/dist/one-place-city.js +1892 -0
  18. package/dist/one-place-city.js.map +1 -0
  19. package/dist/one-place-control.d.ts +37 -0
  20. package/dist/one-place-control.d.ts.map +1 -0
  21. package/dist/one-place-control.js +14 -0
  22. package/dist/one-place-control.js.map +1 -0
  23. package/dist/one-place-geometry.d.ts +297 -0
  24. package/dist/one-place-geometry.d.ts.map +1 -0
  25. package/dist/one-place-geometry.js +532 -0
  26. package/dist/one-place-geometry.js.map +1 -0
  27. package/dist/one-place-signs.d.ts +59 -0
  28. package/dist/one-place-signs.d.ts.map +1 -0
  29. package/dist/one-place-signs.js +358 -0
  30. package/dist/one-place-signs.js.map +1 -0
  31. package/dist/one-place.d.ts +87 -0
  32. package/dist/one-place.d.ts.map +1 -0
  33. package/dist/one-place.js +1325 -0
  34. package/dist/one-place.js.map +1 -0
  35. package/dist/page-context.d.ts +28 -0
  36. package/dist/page-context.d.ts.map +1 -1
  37. package/dist/page-context.js +3 -0
  38. package/dist/page-context.js.map +1 -1
  39. package/dist/page-problems.d.ts.map +1 -1
  40. package/dist/page-problems.js +18 -6
  41. package/dist/page-problems.js.map +1 -1
  42. package/dist/page-record.d.ts.map +1 -1
  43. package/dist/page-record.js +3 -1
  44. package/dist/page-record.js.map +1 -1
  45. package/dist/page-search.d.ts.map +1 -1
  46. package/dist/page-search.js +32 -4
  47. package/dist/page-search.js.map +1 -1
  48. package/dist/page-shell.d.ts.map +1 -1
  49. package/dist/page-shell.js +72 -11
  50. package/dist/page-shell.js.map +1 -1
  51. package/dist/page-typography.d.ts.map +1 -1
  52. package/dist/page-typography.js +3 -2
  53. package/dist/page-typography.js.map +1 -1
  54. package/dist/router.d.ts +2 -0
  55. package/dist/router.d.ts.map +1 -1
  56. package/dist/router.js +69 -3
  57. package/dist/router.js.map +1 -1
  58. package/package.json +6 -6
@@ -0,0 +1,532 @@
1
+ /*
2
+ * PAGES AND THE SCENE ARE ONE PLACE: THE ARITHMETIC
3
+ * (Graview HQ feature:f-page-zooms-out-to-the-city).
4
+ *
5
+ * Pure, no DOM. One number says where a person is: the ALTITUDE, from 0
6
+ * (the page, the whole window) through 1 (the page as a panel beside its
7
+ * place in the city) to 2 (the city, every page and view of the app a
8
+ * board standing on its place, this page among them). It is not a mode: it
9
+ * is read off the Scene's own camera — how close it is — so a slow pinch
10
+ * moves everything a little, and the levels are where it rests when let go.
11
+ * From it follow the page's box, where it stands, and where the camera aims.
12
+ *
13
+ * THE PROJECTION IS THE CITY'S OWN. The city is drawn isometric, its ground
14
+ * a 2:1 lattice, and in that projection the ground's diagonal that runs
15
+ * across the window is level on the window. A board standing upright along
16
+ * that diagonal is therefore drawn as an upright rectangle: no shear, no
17
+ * turn, no perspective, at every zoom — only moved and scaled, as the
18
+ * camera moves and scales everything else. So a page goes into its board by
19
+ * translation and uniform scale alone, and the boards keep their shape as
20
+ * the camera rises or falls.
21
+ */
22
+ /** The share of a desk's window its panel opens at: a page read at its own measure beside the city on a laptop. */
23
+ export const PANEL_SHARE = 0.55;
24
+ /** The shares a host may ask the panel to open at: below, a page too narrow to read; above, a city too narrow to see. */
25
+ export const PANEL_SHARES = { min: 0.25, max: 0.75 };
26
+ /**
27
+ * THE WIDEST A DESK'S PANEL OPENS: the page's wide measure (`WIDE`, 1160,
28
+ * the home's gallery and a picture at full width) and the panel's gutters
29
+ * either side. Past it a wider panel gives the page nothing — its columns
30
+ * stop at their measure and the rest is margin — and takes it from the
31
+ * city: on a 2560 monitor 55% would be 1408 pixels of page; held here it is
32
+ * 1192, and the city keeps the other 1350.
33
+ */
34
+ export const PANEL_MOST = 1192;
35
+ /** The band of city a desk's panel opens beside, at least: room for a district, its name and its views to be read beside the page. */
36
+ export const CITY_LEAST = 480;
37
+ /** The narrowest a desk's panel opens, where the window has room for it: a page's column at a phone's width. */
38
+ const PANEL_LEAST = 360;
39
+ /** How wide a desk's panel may be, and how high a phone's sheet may stand (the share above it), on this window. */
40
+ export function panelRange(view) {
41
+ // A phone's sheet never rises so far that the city above it is lost under the control: it keeps the control's room and a band of city.
42
+ if (phoneOf(view))
43
+ return { min: Math.min(0.4, Math.max(0.15, (CONTROL_ROOM + 180) / Math.max(1, view.height - (view.top ?? 0)))), max: 0.7, default: 0.4 };
44
+ const fallback = deskPanelWidth(view);
45
+ return { min: Math.min(fallback, PANEL_LEAST), max: Math.max(fallback, Math.round(view.width * 0.72)), default: fallback };
46
+ }
47
+ /**
48
+ * THE WIDTH A DESK'S PANEL OPENS AT: its share of the window (55% unless a
49
+ * host says otherwise), no wider than `PANEL_MOST` and leaving the city at
50
+ * least `CITY_LEAST` — and, on a window too narrow for both, never narrower
51
+ * than `PANEL_LEAST` (or the share, if that is less).
52
+ */
53
+ export function deskPanelWidth(view) {
54
+ const share = view.share === undefined || !Number.isFinite(view.share) ? PANEL_SHARE : Math.max(PANEL_SHARES.min, Math.min(PANEL_SHARES.max, view.share));
55
+ const asked = view.width * share;
56
+ const most = Math.min(PANEL_MOST, view.width - CITY_LEAST);
57
+ return Math.round(Math.max(Math.min(PANEL_LEAST, asked), Math.min(asked, most)));
58
+ }
59
+ /** The levels: the page, the panel beside the city, the city. */
60
+ export const PAGE = 0;
61
+ export const PANEL = 1;
62
+ export const CITY = 2;
63
+ export const LEVELS = CITY;
64
+ /** What each level is called, where a person is told it. */
65
+ export const LEVEL_NAMES = ["Page", "Nearby", "City"];
66
+ /** The height the control at the foot keeps on a phone, above the sheet, with its margin. */
67
+ export const CONTROL_ROOM = 72;
68
+ /** A window narrower than this is a phone's: the panel a sheet from the foot. */
69
+ export const PHONE = 600;
70
+ const phoneOf = (view) => view.width <= PHONE;
71
+ /**
72
+ * HOW CLOSE THE SCENE'S CAMERA IS AT EACH LEVEL — its own zoom from
73
+ * altitude, where 1 is the whole city fitted to the window — closest at
74
+ * the page and furthest at the city, so pulling back from a page is the
75
+ * camera rising. The page's own (level 0) is where the camera waits, a
76
+ * little closer than the panel's, so stepping out begins as a pull back.
77
+ */
78
+ export function levelZooms(where, view) {
79
+ if (where.type === "record") {
80
+ const panel = phoneOf(view) ? 2 : Math.max(1.25, 2.2 * besideShare(view));
81
+ return [Math.min(2.9, panel * 1.3), panel, 1];
82
+ }
83
+ if (where.type === "home" || where.type === "overview")
84
+ return [1.8, 1.4, 1];
85
+ return [2.1, Math.max(1.25, 1.6 * besideShare(view)), 1];
86
+ }
87
+ /**
88
+ * HOW MUCH OF A DESK'S CITY THE PANEL LEAVES, against the band it left at
89
+ * a third of the window, where Nearby's zooms were set: a wider panel leaves
90
+ * a narrower band of city, and the camera stands back by as much (no more
91
+ * than a little over a quarter), so what a record is linked to is still in
92
+ * sight beside it rather than behind the page. A phone's sheet is not this.
93
+ */
94
+ export function besideShare(view) {
95
+ if (phoneOf(view))
96
+ return 1;
97
+ const band = panelBox(view).x;
98
+ return Math.max(0.72, Math.min(1, band / (view.width * 0.62)));
99
+ }
100
+ /**
101
+ * THE ALTITUDE A ZOOM IS AT: between two levels, as far between them as the
102
+ * zoom is, on the ratio (so each step of a pinch moves it as much). Held
103
+ * within the page and the city.
104
+ */
105
+ export function altitudeAt(zoom, zooms) {
106
+ if (zoom >= zooms[0])
107
+ return 0;
108
+ for (let level = 0; level < zooms.length - 1; level++) {
109
+ const near = zooms[level];
110
+ const far = zooms[level + 1];
111
+ if (zoom <= near && zoom >= far)
112
+ return level + Math.log(near / zoom) / Math.log(near / far);
113
+ }
114
+ return zooms.length - 1;
115
+ }
116
+ /** The zoom an altitude is at: `altitudeAt` the other way. */
117
+ export function zoomAtAltitude(altitude, zooms) {
118
+ const a = Math.max(0, Math.min(zooms.length - 1, altitude));
119
+ const level = Math.min(zooms.length - 2, Math.floor(a));
120
+ const near = zooms[level];
121
+ const far = zooms[level + 1];
122
+ return near * Math.pow(far / near, a - level);
123
+ }
124
+ /** The level an altitude rests at when let go: the nearest. */
125
+ export const restingLevel = (altitude) => Math.max(PAGE, Math.min(CITY, Math.round(altitude)));
126
+ /** Where this browser keeps the panel as the person sized it: for this app, a desk's width and a phone's sheet apart. */
127
+ export const panelStoreKey = (app, phone) => `graview.one-face.panel.${phone ? "phone" : "desk"}.${app}`;
128
+ /** The page's gutter at its sides: a full page's, and a panel's. */
129
+ export const GUTTER = { page: 20, panel: 16 };
130
+ /**
131
+ * THE PAGE'S SPACING, AS THE FRAME SETS IT: `--graview-gutter` at both, so
132
+ * a page and a view read the gutter they stand in; in the panel the gutter,
133
+ * the room above the page's first words and the room under its last are a
134
+ * panel's, not a full page's 40, 20 and 96 (the room the control keeps at
135
+ * a full page's foot stands beside the panel, not over it).
136
+ */
137
+ export function frameSpacing(inPanel) {
138
+ if (!inPanel)
139
+ return { "--graview-gutter": `${GUTTER.page}px` };
140
+ return frameSpacingAt(PANEL);
141
+ }
142
+ /**
143
+ * AND BETWEEN THE TWO, AS THE PAGE MOVES: from a full page's at the page
144
+ * (altitude 0) to a panel's at Nearby and above, every step drawn, so the
145
+ * page's words never jump 24 pixels as it narrows into the panel or widens
146
+ * out of it. Whole pixels, so a step between frames is never a fraction.
147
+ */
148
+ export function frameSpacingAt(altitude) {
149
+ const t = Math.max(0, Math.min(1, altitude));
150
+ const at = (page, panel) => `${Math.round(page + (panel - page) * t)}px`;
151
+ return { "--graview-gutter": at(GUTTER.page, GUTTER.panel), "--graview-frame-top": at(40, GUTTER.panel), "--graview-frame-foot": at(96, 24) };
152
+ }
153
+ /**
154
+ * THE PANEL'S BOX: on a desk a column at the window's right, the city to
155
+ * its left; on a phone a sheet from the foot, the city above it.
156
+ */
157
+ export function panelBox(view) {
158
+ const bar = view.top ?? 0;
159
+ const range = panelRange(view);
160
+ const asked = view.panel === undefined ? range.default : Math.max(range.min, Math.min(range.max, view.panel));
161
+ if (phoneOf(view)) {
162
+ const top = Math.round(bar + (view.height - bar) * asked);
163
+ return { x: 8, y: top, width: view.width - 16, height: view.height - top - 8 };
164
+ }
165
+ const width = Math.round(asked);
166
+ return { x: view.width - width - 12, y: bar + 12, width, height: view.height - bar - 24 };
167
+ }
168
+ /** Where the place stands on the window: beside the panel at the page and the panel, the city's middle at the city. */
169
+ export function aimAt(level, view, room = CONTROL_ROOM) {
170
+ const bar = view.top ?? 0;
171
+ if (level <= PANEL) {
172
+ const panel = panelBox(view);
173
+ // On a phone the control (and the legend, when it is open) rides at the foot of the city, above the sheet: the place is aimed in what they leave, never less than half of it.
174
+ const kept = Math.max(CONTROL_ROOM, Math.min(room, (panel.y - bar) / 2));
175
+ if (phoneOf(view))
176
+ return { x: view.width / 2, y: (bar + panel.y - kept) / 2 };
177
+ // At a desk the control and the legend stand at the foot of the city's column: the place is aimed in what they leave above them.
178
+ const foot = Math.max(0, Math.min(room - CONTROL_ROOM, (view.height - bar) / 2));
179
+ return { x: panel.x / 2, y: bar + (view.height - bar - foot) / 2 };
180
+ }
181
+ // A little below the middle of what the bar leaves: the boards rise from the city, and want the room above it.
182
+ return { x: view.width / 2, y: bar + (view.height - bar) * 0.56 };
183
+ }
184
+ const lerp = (a, b, t) => a + (b - a) * t;
185
+ const ease = (t) => (t <= 0 ? 0 : t >= 1 ? 1 : t * t * (3 - 2 * t));
186
+ /** The page's box at an altitude: the window at 0, the panel from 1 on, every step between drawn. */
187
+ export function pageBox(altitude, view) {
188
+ // The page under the bar: the window less the bar, which stays where it is.
189
+ const bar = view.top ?? 0;
190
+ const full = { x: 0, y: bar, width: view.width, height: view.height - bar };
191
+ const panel = panelBox(view);
192
+ const t = ease(Math.min(1, Math.max(0, altitude)));
193
+ return { x: lerp(full.x, panel.x, t), y: lerp(full.y, panel.y, t), width: lerp(full.width, panel.width, t), height: lerp(full.height, panel.height, t) };
194
+ }
195
+ /*
196
+ * THE BOARDS. Every page and view of the app stands in the city as a board:
197
+ * an upright face, its foot on its place. A board is what a page is at the
198
+ * city — the page's own top, cut to a board's proportion — so the page a
199
+ * person was reading becomes its own board by moving and shrinking, and the
200
+ * others are drawn the same way.
201
+ */
202
+ /** A board's width in the city's own pixels, at the city's zoom (1). */
203
+ export const BOARD_WIDTH = 96;
204
+ /** A board's width at the city's zoom on this window: a seventh of a phone's width, at most `BOARD_WIDTH`. The city is fitted to the window, so the boards are sized with it: on a phone a fifth left a rich app's City wider than the camera reaches. */
205
+ export const boardWidthFor = (view) => Math.round(Math.max(52, Math.min(BOARD_WIDTH, view.width * 0.14)));
206
+ /*
207
+ * A BOARD'S WORDS ARE READ. Its face is drawn at a width of its own and
208
+ * scaled to the board: on a desk the panel's, so a board and the page that
209
+ * becomes one read alike; on a phone a narrower face, and a board never
210
+ * drawn narrower than `BOARD_LEAST_ON_A_PHONE`, so what it says is never
211
+ * smaller than 9 pixels. A phone's City drops a board it has no room for
212
+ * rather than draw it smaller (the bar reaches every view).
213
+ */
214
+ export const BOARD_LEAST_ON_A_PHONE = 68;
215
+ /** A window too small for a desk's boards: a phone, or one turned on its side. */
216
+ export const smallWindow = (view) => view.width <= PHONE || view.height <= 600;
217
+ /**
218
+ * THE WIDEST A BOARD IS DRAWN, AT A ZOOM: `boardWidthFor` at the City, and
219
+ * beside the page on a desk as much narrower as the camera stood back for
220
+ * the wider panel (`besideShare`), so a board keeps its size against its
221
+ * district and still finds room over it. Between, as far between as the
222
+ * zoom is: never a jump as the camera moves. A small window's are never
223
+ * narrower: their words are already as small as can be read.
224
+ */
225
+ export function boardMost(view, where, zoom) {
226
+ const most = boardWidthFor(view);
227
+ if (smallWindow(view))
228
+ return most;
229
+ const nearby = levelZooms(where, view)[PANEL];
230
+ const t = nearby > 1 ? Math.max(0, Math.min(1, (zoom - 1) / (nearby - 1))) : 0;
231
+ return most * (1 - (1 - besideShare(view)) * t);
232
+ }
233
+ export const boardFaceWidth = (view) => (smallWindow(view) ? 240 : panelBox(view).width);
234
+ export const boardLeast = (view) => (smallWindow(view) ? BOARD_LEAST_ON_A_PHONE : 0);
235
+ /** A board is this much wider than it is tall. */
236
+ export const BOARD_ASPECT = 1.5;
237
+ /** How tall a page is cut as it becomes its board: its own width over the board's proportion. */
238
+ export const boardCut = (panel) => panel.width / BOARD_ASPECT;
239
+ export function standingAt(altitude, panel, foot, width) {
240
+ const t = ease(Math.max(0, Math.min(1, altitude - PANEL)));
241
+ const height = lerp(panel.height, boardCut(panel), t);
242
+ const from = { x: panel.x + panel.width / 2, y: panel.y + height };
243
+ const scale = Math.exp(lerp(0, Math.log(width / panel.width), t));
244
+ return { x: lerp(0, foot.x - from.x, t), y: lerp(0, foot.y - from.y, t), scale, height };
245
+ }
246
+ /** The standing as CSS, about the page's foot (`SHEET_ORIGIN`): a translation and a uniform scale, nothing else. */
247
+ export function standingCss(standing) {
248
+ if (standing.x === 0 && standing.y === 0 && standing.scale === 1)
249
+ return "none";
250
+ return `translate(${standing.x.toFixed(2)}px, ${standing.y.toFixed(2)}px) scale(${standing.scale.toFixed(5)})`;
251
+ }
252
+ /** The transform's origin: the middle of the page's foot. */
253
+ export const SHEET_ORIGIN = "50% 100%";
254
+ export const LEVEL_LIVE = { x: 0, y: 0, s: 1 };
255
+ /** Where the camera puts a point of the picture. */
256
+ export const project = (live, p) => ({ x: p.x * live.s + live.x, y: p.y * live.s + live.y });
257
+ /** The camera that grows the picture by `s` and puts its point `p` at the window's point `at`. */
258
+ export const cameraPutting = (p, at, s) => ({ s, x: at.x - p.x * s, y: at.y - p.y * s });
259
+ /**
260
+ * BETWEEN TWO CAMERAS, AS FAR AS `t`: the place the page stands on moves in
261
+ * a straight line on the window while the picture grows or shrinks
262
+ * steadily, so it never swings out of the way and back.
263
+ */
264
+ export function cameraBetween(from, to, about, t) {
265
+ const a = project(from, about);
266
+ const b = project(to, about);
267
+ const s = Math.exp(lerp(Math.log(from.s), Math.log(to.s), t));
268
+ return cameraPutting(about, { x: lerp(a.x, b.x, t), y: lerp(a.y, b.y, t) }, s);
269
+ }
270
+ /** The smallest box around boxes, or null for none. */
271
+ export function unionOf(boxes) {
272
+ if (boxes.length === 0)
273
+ return null;
274
+ const left = Math.min(...boxes.map((box) => box.x));
275
+ const top = Math.min(...boxes.map((box) => box.y));
276
+ const right = Math.max(...boxes.map((box) => box.x + box.width));
277
+ const bottom = Math.max(...boxes.map((box) => box.y + box.height));
278
+ return { x: left, y: top, width: right - left, height: bottom - top };
279
+ }
280
+ const middleOf = (box) => ({ x: box.x + box.width / 2, y: box.y + box.height / 2 });
281
+ const inside = (point, box) => point.x > box.x && point.x < box.x + box.width && point.y > box.y && point.y < box.y + box.height;
282
+ /**
283
+ * WHERE A PLACE OF SEVERAL KINDS STANDS: where their districts meet — the
284
+ * middle of their middles — unless that falls inside one kind's district,
285
+ * when it stands on a plaza at the city's edge, above the districts it
286
+ * shows. Never inside one kind's district.
287
+ */
288
+ export function meetingOf(districts, all) {
289
+ if (districts.length === 0)
290
+ return null;
291
+ const middles = districts.map(middleOf);
292
+ const meet = { x: middles.reduce((sum, one) => sum + one.x, 0) / middles.length, y: middles.reduce((sum, one) => sum + one.y, 0) / middles.length };
293
+ if (districts.length > 1 && !all.some((box) => inside(meet, box)))
294
+ return meet;
295
+ const around = unionOf(all.length > 0 ? all : districts);
296
+ return { x: meet.x, y: around.y - 12 };
297
+ }
298
+ /**
299
+ * THE POINT OF THE PICTURE A PAGE STANDS ON: its building's roof, its
300
+ * district's middle, where its districts meet, or — the home — a plaza at
301
+ * the city's back edge, over all of it.
302
+ */
303
+ export function anchorOf(where, place) {
304
+ if (where.type === "record" && place.building)
305
+ return { x: place.building.x + place.building.width / 2, y: place.building.y + place.building.height * 0.3 };
306
+ if ((where.type === "record" || where.type === "list") && place.district)
307
+ return middleOf(place.district);
308
+ if (where.type === "place")
309
+ return place.districts?.length === 1 ? middleOf(place.districts[0]) : meetingOf(place.districts ?? [], place.all ?? []);
310
+ const city = unionOf(place.all ?? []);
311
+ return city ? middleOf(city) : null;
312
+ }
313
+ /**
314
+ * WHERE A PAGE'S BOARD STANDS: on a district, at its back corner, so the
315
+ * board rises behind the district's buildings rather than in front of them; on a
316
+ * record, on its building's roof; the home, at the city's back edge.
317
+ */
318
+ export function footOf(where, place) {
319
+ if (where.type === "record" && place.building)
320
+ return { x: place.building.x + place.building.width / 2, y: place.building.y + place.building.height * 0.3 };
321
+ // The district's back corner: the top of its tile as the window has it.
322
+ const back = (box) => ({ x: box.x + box.width / 2, y: box.y + 2 });
323
+ if ((where.type === "record" || where.type === "list") && place.district)
324
+ return back(place.district);
325
+ if (where.type === "place") {
326
+ if (place.districts?.length === 1)
327
+ return back(place.districts[0]);
328
+ return meetingOf(place.districts ?? [], place.all ?? []);
329
+ }
330
+ const city = unionOf(place.all ?? []);
331
+ return city ? { x: city.x + city.width / 2, y: city.y - 8 } : null;
332
+ }
333
+ /**
334
+ * WHERE A LINE LEAVES THE PAGE: from the page's edge that faces the city —
335
+ * its left at a desk, its top on a phone — level with the part it is
336
+ * about, so no line is drawn across the words of the page.
337
+ */
338
+ export function leaveFrom(part, page, phone) {
339
+ if (phone)
340
+ return { x: Math.max(page.x + 12, Math.min(page.x + page.width - 12, part.x)), y: page.y };
341
+ return { x: page.x, y: Math.max(page.y + 12, Math.min(page.y + page.height - 12, part.y)) };
342
+ }
343
+ /**
344
+ * A LINE THAT WOULD END UNDER THE PAGE ends at the page's edge nearest its
345
+ * building instead, an arrow there pointing on toward it. Null when the
346
+ * building is not under the page.
347
+ */
348
+ export function edgeToward(to, page) {
349
+ if (!inside(to, page))
350
+ return null;
351
+ const edges = [
352
+ { x: page.x, y: to.y },
353
+ { x: page.x + page.width, y: to.y },
354
+ { x: to.x, y: page.y },
355
+ { x: to.x, y: page.y + page.height },
356
+ ];
357
+ return edges.reduce((best, p) => (Math.hypot(p.x - to.x, p.y - to.y) < Math.hypot(best.x - to.x, best.y - to.y) ? p : best));
358
+ }
359
+ /**
360
+ * THE NEAREST BOARD IN A DIRECTION, for the arrow keys: among the boxes
361
+ * whose middle lies that way, the one nearest, the way it points counting
362
+ * double against the way across. Null when there is none that way.
363
+ */
364
+ export function nearestThatWay(from, others, way) {
365
+ const at = middleOf(from);
366
+ let best = null;
367
+ for (const other of others) {
368
+ const m = middleOf(other.box);
369
+ const dx = m.x - at.x;
370
+ const dy = m.y - at.y;
371
+ const along = way === "left" ? -dx : way === "right" ? dx : way === "up" ? -dy : dy;
372
+ const across = way === "left" || way === "right" ? Math.abs(dy) : Math.abs(dx);
373
+ if (along <= 1)
374
+ continue;
375
+ const cost = along + across * 2;
376
+ if (!best || cost < best.cost)
377
+ best = { key: other.key, cost };
378
+ }
379
+ return best?.key ?? null;
380
+ }
381
+ /*
382
+ * THE VIEWS STAND ON THEIR DISTRICTS. A view of one kind stands as a sign in
383
+ * the ground the city keeps for it under its district's name — the layout
384
+ * holds that room (`LayoutOptions.standing`), so no other district's name
385
+ * is placed on it — three to a row, the rows one behind another down the
386
+ * ground; a view of several kinds, or of none (the home, the connections),
387
+ * stands on the plaza at the city's back edge, the rows rising behind it.
388
+ * Each sign is an upright card on a short post, facing the camera: in the
389
+ * city's projection a face along the level diagonal is drawn as it is.
390
+ */
391
+ /** Signs side by side in a row before another stands behind. */
392
+ export const SIGNS_PER_ROW = 3;
393
+ /** The post a sign stands on, and the room between signs, in the city's pixels at its zoom. */
394
+ export const SIGN_POST = 10;
395
+ export const SIGN_GAP = 8;
396
+ /** The room a district keeps under its name for so many signs this wide: what the layout is asked to hold. */
397
+ export function signRoom(count, width) {
398
+ const rows = Math.ceil(count / SIGNS_PER_ROW);
399
+ const cols = Math.min(count, SIGNS_PER_ROW);
400
+ return { width: cols * width + (cols - 1) * SIGN_GAP, height: rows * (width / BOARD_ASPECT + SIGN_POST + SIGN_GAP) };
401
+ }
402
+ /**
403
+ * WHERE EACH SIGN'S CARD STANDS — the middle of its foot, where its post
404
+ * meets it — for signs in rows from a point: `down` from the top of the
405
+ * room under a district's name (the first row at the top), or `up` from the
406
+ * plaza's front edge (the first row in front, the rest rising behind).
407
+ */
408
+ export function signFeet(keys, from, width, way) {
409
+ const height = width / BOARD_ASPECT;
410
+ const step = height + SIGN_POST + SIGN_GAP;
411
+ const feet = new Map();
412
+ keys.forEach((key, index) => {
413
+ const row = Math.floor(index / SIGNS_PER_ROW);
414
+ const inRow = Math.min(SIGNS_PER_ROW, keys.length - row * SIGNS_PER_ROW);
415
+ const col = index % SIGNS_PER_ROW;
416
+ const x = from.x + (col - (inRow - 1) / 2) * (width + SIGN_GAP);
417
+ const y = way === "down" ? from.y + row * step + height : from.y - SIGN_POST - row * step;
418
+ feet.set(key, { x, y });
419
+ });
420
+ return feet;
421
+ }
422
+ /**
423
+ * THE CAMERA THAT FITS THE CITY AND ITS VIEWS into the part of the window
424
+ * nothing stands over — below the bar, above the control at the foot — with
425
+ * a margin: how much closer (or further) than now, and where.
426
+ */
427
+ export function fitCamera(around, area, margin = 16, most = Infinity) {
428
+ const room = { x: area.x + margin, y: area.y + margin, width: Math.max(1, area.width - 2 * margin), height: Math.max(1, area.height - 2 * margin) };
429
+ const s = Math.min(most, room.width / Math.max(1, around.width), room.height / Math.max(1, around.height));
430
+ return cameraPutting({ x: around.x + around.width / 2, y: around.y + around.height / 2 }, { x: room.x + room.width / 2, y: room.y + room.height / 2 }, s);
431
+ }
432
+ /**
433
+ * THE CITY FITTED BESIDE WHAT STANDS AT THE FOOT. The control, the legend
434
+ * over it when it is open, and the timeline beside them each keep their
435
+ * rect: the city is fitted either above all of them, or to the right of
436
+ * them and above the control, whichever draws it larger — never under any.
437
+ */
438
+ export function fitBeside(around, view, reserved, margin = 16, most = Infinity) {
439
+ const bar = view.top ?? 0;
440
+ const whole = { x: 0, y: bar, width: view.width, height: view.height - bar };
441
+ const kept = reserved.filter((box) => box.width > 0 && box.height > 0);
442
+ if (kept.length === 0)
443
+ return fitCamera(around, whole, margin, most);
444
+ const top = Math.min(...kept.map((box) => box.y));
445
+ const right = Math.max(...kept.map((box) => box.x + box.width));
446
+ const above = fitCamera(around, { x: 0, y: bar, width: view.width, height: Math.max(1, top - bar) }, margin, most);
447
+ // Beside them, above the line of what stands lowest (the control itself): nothing is drawn down at the window's foot.
448
+ const lowest = Math.max(...kept.map((box) => box.y + box.height));
449
+ const foot = Math.min(...kept.filter((box) => box.y + box.height >= lowest - 1).map((box) => box.y));
450
+ const beside = fitCamera(around, { x: right, y: bar, width: Math.max(1, view.width - right), height: Math.max(1, foot - bar) }, margin, most);
451
+ return beside.s > above.s ? beside : above;
452
+ }
453
+ const clampTo = (p, box) => ({ x: Math.max(box.x, Math.min(box.x + box.width, p.x)), y: Math.max(box.y, Math.min(box.y + box.height, p.y)) });
454
+ const grown = (box, by) => ({ x: box.x - by, y: box.y - by, width: box.width + 2 * by, height: box.height + 2 * by });
455
+ const inBox = (p, box) => p.x >= box.x && p.x <= box.x + box.width && p.y >= box.y && p.y <= box.y + box.height;
456
+ /** A point of the curve from `from` through `bend` to `to`, as far as `t`. */
457
+ export const curveAt = (from, bend, to, t) => ({
458
+ x: (1 - t) ** 2 * from.x + 2 * (1 - t) * t * bend.x + t * t * to.x,
459
+ y: (1 - t) ** 2 * from.y + 2 * (1 - t) * t * bend.y + t * t * to.y,
460
+ });
461
+ /** Whether no point of the curve falls inside any of the boxes. */
462
+ export function curveClear(from, bend, to, boxes, steps = 48) {
463
+ if (boxes.length === 0)
464
+ return true;
465
+ for (let i = 1; i < steps; i++) {
466
+ const p = curveAt(from, bend, to, i / steps);
467
+ if (boxes.some((box) => inside(p, box)))
468
+ return false;
469
+ }
470
+ return true;
471
+ }
472
+ /** How far a line's end keeps from the page's edge: its ring's reach, and the panel's edge that is dragged there. */
473
+ export const END_ROOM = 20;
474
+ /** How far a line keeps from what is reserved: its stroke and a little air. */
475
+ const KEEP_OFF = 3;
476
+ /** And how far its end ring reaches. */
477
+ const RING = 9;
478
+ export function routeLine(given, target, area, phone, reserved = []) {
479
+ const keepOut = reserved.filter((box) => box.width > 0 && box.height > 0).map((box) => grown(box, KEEP_OFF));
480
+ // The line starts where the page's edge meets the city's part: never beside the control, below or past it.
481
+ let from = phone ? { x: Math.max(area.x, Math.min(area.x + area.width, given.x)), y: given.y } : { x: given.x, y: Math.max(area.y, Math.min(area.y + area.height, given.y)) };
482
+ // Something standing on that edge (a phone's control rides on the sheet's top): the line leaves the edge past it.
483
+ for (let step = 0; step < keepOut.length; step++) {
484
+ const on = keepOut.find((box) => (phone ? from.x >= box.x && from.x <= box.x + box.width && box.y + box.height >= from.y - 40 && box.y <= from.y : from.y >= box.y && from.y <= box.y + box.height && box.x + box.width >= from.x - 40 && box.x <= from.x));
485
+ if (!on)
486
+ break;
487
+ from = phone ? { x: on.x + on.width + 8, y: from.y } : { x: from.x, y: on.y - 8 };
488
+ }
489
+ if (phone ? from.x > area.x + area.width : from.y < area.y)
490
+ return null;
491
+ // The end keeps clear of the page's edge, by its ring and the edge that is dragged there.
492
+ const ends = phone ? { ...area, height: Math.max(0, area.height - END_ROOM) } : { ...area, width: Math.max(0, area.width - END_ROOM) };
493
+ let to = inBox(target, ends) ? target : clampTo(target, ends);
494
+ // An end under what is reserved stops at its nearest edge instead, pointing on.
495
+ const under = keepOut.find((box) => inside(to, grown(box, RING)));
496
+ if (under) {
497
+ const out = grown(under, RING + 1);
498
+ const at = to;
499
+ const ways = [
500
+ { x: at.x, y: out.y },
501
+ { x: out.x + out.width, y: at.y },
502
+ { x: out.x, y: at.y },
503
+ { x: at.x, y: out.y + out.height },
504
+ ].filter((p) => inBox(p, ends) && !keepOut.some((box) => inside(p, grown(box, RING))));
505
+ if (ways.length === 0)
506
+ return null;
507
+ to = ways.reduce((best, p) => (Math.hypot(p.x - at.x, p.y - at.y) < Math.hypot(best.x - at.x, best.y - at.y) ? p : best));
508
+ }
509
+ const toward = to.x === target.x && to.y === target.y ? null : target;
510
+ /*
511
+ * THE BEND: out along the edge's normal and never past the city's part —
512
+ * every point of the curve lies between its ends and this one — as near
513
+ * the edge as lets the curve keep off everything reserved.
514
+ */
515
+ const reach = Math.min(80, Math.max(16, Math.hypot(to.x - from.x, to.y - from.y) / 2));
516
+ const span = phone ? from.y - area.y : from.x - area.x;
517
+ for (let out = reach; out <= Math.max(reach, span) + 12; out += 12) {
518
+ const bend = clampTo(phone ? { x: from.x, y: from.y - out } : { x: from.x - out, y: from.y }, area);
519
+ if (curveClear(from, bend, to, keepOut))
520
+ return { from, to, toward, bend };
521
+ }
522
+ return null;
523
+ }
524
+ /** The part of the window the city is seen in beside the page: left of it at a desk, above it on a phone; under the bar, above the control. */
525
+ export function cityArea(page, view, control, phone) {
526
+ const top = (view.top ?? 0) + 6;
527
+ // Above the control: on a phone it rides on the sheet, so the city's part ends over it.
528
+ const bottom = phone ? page.y - 6 : Math.min(view.height - 6, control ? control.y - 6 : Infinity);
529
+ const right = phone ? view.width - 6 : page.x - 6;
530
+ return { x: 6, y: top, width: Math.max(0, right - 6), height: Math.max(0, bottom - top) };
531
+ }
532
+ //# sourceMappingURL=one-place-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-place-geometry.js","sourceRoot":"","sources":["../src/one-place-geometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAyBH,mHAAmH;AACnH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAChC,yHAAyH;AACzH,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAW,CAAC;AAC9D;;;;;;;GAOG;AACH,MAAM,CAA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AE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACpG,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+IAA+I;AAC/I,MAAM,UAAU,QAAQ,CAAC,IAAS,EAAE,IAAU,EAAE,OAAmB,EAAE,KAAc;IACjF,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAChC,wFAAwF;IACxF,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClG,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAClD,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC;AAC5F,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { Box, Point } from "./one-place-geometry.js";
2
+ /** One board to stand: what it is about decides where. */
3
+ export interface SignAsked {
4
+ readonly key: string;
5
+ /** The one kind it is a view of, by whose district it stands; null for the plaza. */
6
+ readonly kind: string | null;
7
+ /** The building it stands on: the page of one record. */
8
+ readonly building?: Box | null;
9
+ }
10
+ export interface SignsAsked {
11
+ /** Each district's ground, its box (the diamond inside it is its ground). */
12
+ readonly tiles: ReadonlyMap<string, Box>;
13
+ readonly buildings: readonly Box[];
14
+ /** Each district's name, as wide and tall as it is drawn, in the picture's pixels; a district with none says none. */
15
+ readonly names: ReadonlyMap<string, {
16
+ readonly width: number;
17
+ readonly height: number;
18
+ }>;
19
+ readonly signs: readonly SignAsked[];
20
+ /** A board's card, and the post it stands on at the least. */
21
+ readonly board: {
22
+ readonly width: number;
23
+ readonly height: number;
24
+ readonly post: number;
25
+ readonly gap: number;
26
+ };
27
+ /** What nothing stands on. */
28
+ readonly reserved?: readonly Box[];
29
+ /** Words the picture draws itself (a district's "+n"): no name touches them, as none touches another name. */
30
+ readonly words?: readonly Box[];
31
+ /** What the camera can show: past it is covered, as far as it reaches past. */
32
+ readonly bounds?: Box;
33
+ /** A board with no clear place by its district stands nowhere, rather than smaller than can be read or over something (a phone). */
34
+ readonly dropCovered?: boolean;
35
+ /** Whether a board may be drawn a little smaller to stand on its own district: not where its words would drop below reading. */
36
+ readonly shrink?: boolean;
37
+ /** The narrowest a board may be drawn (`boardLeast`, where a small window's words are still read): a board is drawn as small as this, or half its size, before it stands nowhere. */
38
+ readonly least?: number;
39
+ /** How many half-boards up over its district a board may stand: a small window's City, which pans, takes them higher. */
40
+ readonly reach?: number;
41
+ /** Whether the views of no one kind stand on the plaza: not beside a page, where the plaza is behind the city. */
42
+ readonly plaza?: boolean;
43
+ }
44
+ export interface SignsPlaced {
45
+ /** Each board's foot: the middle of its card's lower edge, where its post meets it. */
46
+ readonly feet: ReadonlyMap<string, Point>;
47
+ /** Each board's post, from its foot down to the ground or the roof it stands on. */
48
+ readonly posts: ReadonlyMap<string, number>;
49
+ /** A board drawn smaller than the rest to stand by its own district where the room there is short: its share of their size. */
50
+ readonly scales: ReadonlyMap<string, number>;
51
+ /** Each district's name, where it stands. */
52
+ readonly names: ReadonlyMap<string, Box>;
53
+ /** Everything placed and every district: what the City's camera fits. */
54
+ readonly whole: Box | null;
55
+ }
56
+ /** How far into a district's diamond a box reaches: above 1 is clear of it; the least of `|dx|/half-width + |dy|/half-height` over the box. */
57
+ export declare function diamondReach(box: Box, tile: Box): number;
58
+ export declare function placeSigns(asked: SignsAsked): SignsPlaced;
59
+ //# sourceMappingURL=one-place-signs.d.ts.map