@fnndsc/orrery 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +12 -0
  2. package/dist/controls/cameraRig.d.ts +223 -0
  3. package/dist/controls/cameraRig.js +353 -0
  4. package/dist/controls/cameraRig.js.map +1 -0
  5. package/dist/controls/gestures.d.ts +133 -0
  6. package/dist/controls/gestures.js +282 -0
  7. package/dist/controls/gestures.js.map +1 -0
  8. package/dist/controls/index.d.ts +9 -0
  9. package/dist/controls/index.js +10 -0
  10. package/dist/controls/index.js.map +1 -0
  11. package/dist/controls/picker.d.ts +117 -0
  12. package/dist/controls/picker.js +167 -0
  13. package/dist/controls/picker.js.map +1 -0
  14. package/dist/controls/replay.d.ts +94 -0
  15. package/dist/controls/replay.js +147 -0
  16. package/dist/controls/replay.js.map +1 -0
  17. package/dist/draw/censusField.d.ts +113 -0
  18. package/dist/draw/censusField.js +241 -0
  19. package/dist/draw/censusField.js.map +1 -0
  20. package/dist/draw/constants.d.ts +13 -0
  21. package/dist/draw/constants.js +14 -0
  22. package/dist/draw/constants.js.map +1 -0
  23. package/dist/draw/geometry.d.ts +33 -0
  24. package/dist/draw/geometry.js +55 -0
  25. package/dist/draw/geometry.js.map +1 -0
  26. package/dist/draw/handoff.d.ts +11 -0
  27. package/dist/draw/handoff.js +12 -0
  28. package/dist/draw/handoff.js.map +1 -0
  29. package/dist/draw/handoffField.d.ts +74 -0
  30. package/dist/draw/handoffField.js +151 -0
  31. package/dist/draw/handoffField.js.map +1 -0
  32. package/dist/draw/index.d.ts +20 -0
  33. package/dist/draw/index.js +21 -0
  34. package/dist/draw/index.js.map +1 -0
  35. package/dist/draw/labelField.d.ts +63 -0
  36. package/dist/draw/labelField.js +149 -0
  37. package/dist/draw/labelField.js.map +1 -0
  38. package/dist/draw/lamps.d.ts +16 -0
  39. package/dist/draw/lamps.js +17 -0
  40. package/dist/draw/lamps.js.map +1 -0
  41. package/dist/draw/nebula.d.ts +8 -0
  42. package/dist/draw/nebula.js +28 -0
  43. package/dist/draw/nebula.js.map +1 -0
  44. package/dist/draw/palette.d.ts +41 -0
  45. package/dist/draw/palette.js +32 -0
  46. package/dist/draw/palette.js.map +1 -0
  47. package/dist/draw/sphereField.d.ts +98 -0
  48. package/dist/draw/sphereField.js +168 -0
  49. package/dist/draw/sphereField.js.map +1 -0
  50. package/dist/draw/starField.d.ts +127 -0
  51. package/dist/draw/starField.js +267 -0
  52. package/dist/draw/starField.js.map +1 -0
  53. package/dist/draw/stars.d.ts +65 -0
  54. package/dist/draw/stars.js +132 -0
  55. package/dist/draw/stars.js.map +1 -0
  56. package/dist/draw/timing.d.ts +11 -0
  57. package/dist/draw/timing.js +12 -0
  58. package/dist/draw/timing.js.map +1 -0
  59. package/dist/draw/tubeField.d.ts +131 -0
  60. package/dist/draw/tubeField.js +352 -0
  61. package/dist/draw/tubeField.js.map +1 -0
  62. package/dist/draw/tubes.d.ts +41 -0
  63. package/dist/draw/tubes.js +116 -0
  64. package/dist/draw/tubes.js.map +1 -0
  65. package/dist/index.d.ts +15 -0
  66. package/dist/index.js +15 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/layout/accretion.d.ts +31 -0
  69. package/dist/layout/accretion.js +384 -0
  70. package/dist/layout/accretion.js.map +1 -0
  71. package/dist/layout/constellations.d.ts +25 -0
  72. package/dist/layout/constellations.js +197 -0
  73. package/dist/layout/constellations.js.map +1 -0
  74. package/dist/layout/galaxy.d.ts +12 -0
  75. package/dist/layout/galaxy.js +99 -0
  76. package/dist/layout/galaxy.js.map +1 -0
  77. package/dist/layout/hierarchy.d.ts +45 -0
  78. package/dist/layout/hierarchy.js +464 -0
  79. package/dist/layout/hierarchy.js.map +1 -0
  80. package/dist/layout/index.d.ts +20 -0
  81. package/dist/layout/index.js +21 -0
  82. package/dist/layout/index.js.map +1 -0
  83. package/dist/layout/layoutInput.d.ts +29 -0
  84. package/dist/layout/layoutInput.js +45 -0
  85. package/dist/layout/layoutInput.js.map +1 -0
  86. package/dist/layout/molecule.d.ts +64 -0
  87. package/dist/layout/molecule.js +155 -0
  88. package/dist/layout/molecule.js.map +1 -0
  89. package/dist/layout/pull.d.ts +94 -0
  90. package/dist/layout/pull.js +137 -0
  91. package/dist/layout/pull.js.map +1 -0
  92. package/dist/layout/ranked.d.ts +75 -0
  93. package/dist/layout/ranked.js +148 -0
  94. package/dist/layout/ranked.js.map +1 -0
  95. package/dist/layout/registry.d.ts +23 -0
  96. package/dist/layout/registry.js +165 -0
  97. package/dist/layout/registry.js.map +1 -0
  98. package/dist/layout/seeded.d.ts +32 -0
  99. package/dist/layout/seeded.js +48 -0
  100. package/dist/layout/seeded.js.map +1 -0
  101. package/dist/layout/types.d.ts +81 -0
  102. package/dist/layout/types.js +14 -0
  103. package/dist/layout/types.js.map +1 -0
  104. package/dist/scene/index.d.ts +6 -0
  105. package/dist/scene/index.js +7 -0
  106. package/dist/scene/index.js.map +1 -0
  107. package/dist/scene/orrery.d.ts +592 -0
  108. package/dist/scene/orrery.js +1555 -0
  109. package/dist/scene/orrery.js.map +1 -0
  110. package/dist/types/encoding.d.ts +43 -0
  111. package/dist/types/encoding.js +7 -0
  112. package/dist/types/encoding.js.map +1 -0
  113. package/dist/types/space.d.ts +12 -0
  114. package/dist/types/space.js +10 -0
  115. package/dist/types/space.js.map +1 -0
  116. package/package.json +57 -0
@@ -0,0 +1,592 @@
1
+ import { PHYSICS_DEFAULT, type HierarchyArrangement, type PhysicsTerms } from '../layout/index.js';
2
+ import { type Palette } from '../draw/index.js';
3
+ import type { NodeLook } from '../types/encoding.js';
4
+ /** One node as the orrery draws it; a surface's own node type extends this. */
5
+ export interface SpaceNode {
6
+ id: string;
7
+ label: string;
8
+ /**
9
+ * What an engine that needs more reads (`LayoutEngine.needs`): a stage's
10
+ * plugin, a star's kind — whatever the surface supplies.
11
+ */
12
+ attrs?: Record<string, number | string | string[]>;
13
+ /** Words pinned above the node, read without hovering (a hub's name and count). */
14
+ caption?: string;
15
+ /** Drawn as a ringed star: a node of another kind among the stars (a plugin in constellations). */
16
+ ring?: boolean;
17
+ /** How it looks, read by the surface from its own domain. */
18
+ look: NodeLook;
19
+ parentIds: string[];
20
+ joinParentIds: string[];
21
+ /** Scalar for molecule radius scaling; undefined = degree fallback. */
22
+ metric?: number;
23
+ /** Collapsed-group multiplicity (×N); undefined or 1 for singletons. */
24
+ count?: number;
25
+ /**
26
+ * A ghost drawn as a halo: a translucent sphere at the anchor's place,
27
+ * sized by `count`, that names a cluster on hover and takes a click
28
+ * when no solid sphere is under the pointer. Never edged.
29
+ */
30
+ halo?: boolean;
31
+ /**
32
+ * Drawn as a lit sphere even when the scene draws stars: a node the
33
+ * operator is at (an entered feed's own nodes) stays solid to hover and
34
+ * press, whatever its size on screen.
35
+ */
36
+ solid?: boolean;
37
+ /**
38
+ * Drawn faint: the rest of a field while one part of it is entered.
39
+ * Present in the settle and drawn, but at a fraction of its opacity, and
40
+ * its edges with it.
41
+ */
42
+ dim?: boolean;
43
+ /**
44
+ * Present in the settle, never drawn: an anchor that pulls its children
45
+ * together (the universe hangs feeds of one shape from one), with no
46
+ * sphere, no edge and no pick of its own.
47
+ */
48
+ ghost?: boolean;
49
+ /**
50
+ * Its joins are drawn faint — a thread at a dim node's strength, never a
51
+ * tube — for a relation that is not an edge of the run (a feed's lineage
52
+ * to the feed it began from).
53
+ */
54
+ joinFaint?: boolean;
55
+ }
56
+ /** The normalized graph the scene renders. */
57
+ /**
58
+ * How a space is arranged: a hierarchy round each shape's hub (galaxy,
59
+ * spokes, clumps), constellations round the plugin stars, or a tree of hubs
60
+ * the surface names (hubs), or grown feed by feed as a coral (accretion).
61
+ */
62
+ export type SpaceArrangement = HierarchyArrangement | 'constellations' | 'hubs' | 'accretion';
63
+ export interface SpaceGraph<N extends SpaceNode = SpaceNode> {
64
+ nodes: N[];
65
+ }
66
+ /** The two ways a graph takes shape. */
67
+ export type LayoutStrategy = 'ranked' | 'molecule';
68
+ /** Callbacks the host wires into picking. */
69
+ export interface OrreryHandlers<N extends SpaceNode = SpaceNode> {
70
+ select?: (node: N) => void;
71
+ activate?: (node: N) => void;
72
+ /** A click on empty space cleared the selection. */
73
+ deselect?: () => void;
74
+ /**
75
+ * A two-finger gesture ended: the camera stands where the fingers left
76
+ * it. A host that reads a pinch as a step (out of a feed) asks
77
+ * {@link Orrery.camera_distance} here.
78
+ */
79
+ gesture_end?: () => void;
80
+ /** The words the hover tip shows for a node; null for the node's label. */
81
+ tip?: (node: N) => string | null;
82
+ /**
83
+ * A settle too big for one frame is run in slices, and each slice says
84
+ * how far it has come; `done === total` is the settle's end. A scene
85
+ * given this handler never holds the page for a whole settle.
86
+ */
87
+ progress?: (done: number, total: number, nodes: number) => void;
88
+ /**
89
+ * The feed a node belongs to, for the hand-off: while the scene draws
90
+ * stars, a feed near enough to read turns solid as a whole. No key, or no
91
+ * handler, and a node stays a star.
92
+ */
93
+ handoffKey?: (node: N) => string | null;
94
+ /**
95
+ * A replay moved: its moment (in the arrivals' units) and whether it
96
+ * still plays; called each frame it advances and once when it stops.
97
+ */
98
+ replay?: (at: number, playing: boolean) => void;
99
+ }
100
+ /** The terms a settle honours: orrery's own, re-exported for the panes. */
101
+ export type { PhysicsTerms };
102
+ export { PHYSICS_DEFAULT };
103
+ /** What a surface hands the orrery beside its graph. */
104
+ export interface OrreryOptions {
105
+ /** Ambient mode: slower spin, no picking, no selection ring. */
106
+ ambient?: boolean;
107
+ /**
108
+ * The colours to draw with, asked on every rebuild so a theme change
109
+ * repaints; the default palette when absent.
110
+ */
111
+ palette?: () => Palette;
112
+ /**
113
+ * A worker that settles a grouped space off the page, speaking the
114
+ * layout-worker protocol (`layout/worker` names the engines). The bundle
115
+ * that hosts the page must build it, so the surface makes it; without
116
+ * one, the settle runs on the page.
117
+ */
118
+ layoutWorker?: () => Worker;
119
+ }
120
+ /**
121
+ * The palette used when a surface hands none in.
122
+ *
123
+ * @returns Warm status colours, a cool root and a cool pulse.
124
+ */
125
+ export declare function palette_default(): Palette;
126
+ /**
127
+ * How a rebuild settles the graph it draws.
128
+ *
129
+ * - `full`: every node settles (seeded nodes start where they stood).
130
+ * - `new`: nodes that already stood somewhere hold still; only nodes new to
131
+ * the scene settle among them — a landing adds a molecule without moving
132
+ * three thousand spheres.
133
+ * - `hold`: nothing settles when every node already stands somewhere (a
134
+ * census toggle, a palette change, a space re-shown as it was); any new
135
+ * node settles as under `new`.
136
+ */
137
+ export type SettleMode = 'full' | 'new' | 'hold';
138
+ /** How the scene draws its nodes: lit spheres, or points of light. */
139
+ export type DrawMode = 'spheres' | 'stars';
140
+ /**
141
+ * One live DAG rendering bound to a container element.
142
+ */
143
+ export declare class Orrery<N extends SpaceNode = SpaceNode> {
144
+ private readonly container;
145
+ private readonly handlers;
146
+ private readonly paletteOf;
147
+ /** The replay under way, or null: its clock, the arrivals, and what is shown. */
148
+ private replay;
149
+ private readonly layoutWorkerOf;
150
+ private readonly ambient;
151
+ private readonly renderer;
152
+ private readonly scene;
153
+ private readonly camera;
154
+ private readonly group;
155
+ /** What lies under a pointer, among everything drawn. */
156
+ private readonly picker;
157
+ /** The solid spheres, halos and plain edges. */
158
+ private readonly spheres;
159
+ /** Every drawn sphere and halo, by its node's id: the sphere field's own map. */
160
+ private get meshes();
161
+ /** The field's stars, threads and nebulae. */
162
+ private readonly starField;
163
+ /** Captions pinned above nodes. */
164
+ private readonly labels;
165
+ /** Every solid molecule's tubes, and the lamps its stages wear. */
166
+ private readonly tubes;
167
+ /** Every molecule's place between stars and spheres. */
168
+ private readonly handoffField;
169
+ /** Every job of every stage, when the scene draws a census. */
170
+ private readonly censusField;
171
+ /** Where the last projection left every node — the next settle's seed. */
172
+ private lastPositions;
173
+ /** Nodes held still through the current settle. */
174
+ private frozen;
175
+ /** Physics for the current settle alone, over the standing terms. */
176
+ private physicsOnce;
177
+ /** CENSUS: render every member of every ×N group as an instanced point. */
178
+ private census;
179
+ /** The molecule's physics terms (see PhysicsTerms). */
180
+ private physics;
181
+ /** Sets physics terms and re-settles (warm-started, so it morphs). */
182
+ physics_set(terms: Partial<PhysicsTerms>, resettle?: boolean): void;
183
+ physics_get(): PhysicsTerms;
184
+ /**
185
+ * Toggles the census projection: the full multiplicity of the graph as
186
+ * instanced members on analytic shells (spectacle), versus the semantic
187
+ * shape (work). Selection belongs to shape; census draws, never picks.
188
+ *
189
+ * @param on - Whether census is active.
190
+ */
191
+ census_set(on: boolean): void;
192
+ census_get(): boolean;
193
+ private graph;
194
+ /** The grab in progress: which node, its drag plane, and travel so far. */
195
+ private drag;
196
+ /** The live reaction simulation while (and shortly after) a grab. */
197
+ private pull;
198
+ /** The pulse wave's schedule: node id to flare time (ms into the wave). */
199
+ private waveTimes;
200
+ /** Wall-clock start of the running wave, or null when no wave runs. */
201
+ private waveStartAt;
202
+ /**
203
+ * The camera and the world it turns: the focus, the flights, the hold
204
+ * inside a node, the idle spin, and whether the operator has placed the
205
+ * camera since the scene last framed itself.
206
+ */
207
+ private readonly rig;
208
+ /** How nodes are drawn: lit spheres (every pane), or stars (the universe's choice). */
209
+ private drawMode;
210
+ /** Placed nodes by id, for the spheres a solid feed draws. */
211
+ private placedById;
212
+ /**
213
+ * The pointer's intents on the canvas — the view drag, the fingers, the
214
+ * taps — or null for a miniature, which nobody steers.
215
+ */
216
+ private gestures;
217
+ /** The pending hide of a tap's name. */
218
+ private tapTipTimer;
219
+ /** The node the hover tip names, and where the pointer was. */
220
+ private hovered;
221
+ /** Times the scene has framed the graph itself (`camera_fit`). */
222
+ private fits;
223
+ private strategy;
224
+ private selectedId;
225
+ private frameHandle;
226
+ private disposed;
227
+ /** The hover tip naming the node under the pointer (pane mode only). */
228
+ private tip;
229
+ /** The wave's flare color, re-read from the palette on every rebuild. */
230
+ private pulseColor;
231
+ /**
232
+ * @param container - The element the canvas fills.
233
+ * @param handlers - Picking callbacks (ignored in ambient mode).
234
+ * @param options - Pane vs miniature behavior.
235
+ */
236
+ constructor(container: HTMLElement, handlers?: OrreryHandlers<N>, options?: OrreryOptions);
237
+ /**
238
+ * Replaces the rendered graph. Layout runs under the current strategy.
239
+ *
240
+ * @param graph - The normalized graph.
241
+ */
242
+ graph_set(graph: SpaceGraph<N>, options?: {
243
+ wave?: boolean;
244
+ fit?: boolean;
245
+ frozen?: ReadonlyArray<string>;
246
+ physics?: Partial<PhysicsTerms>;
247
+ settle?: SettleMode;
248
+ }): void;
249
+ /** Whether the pane's wave loops continuously (the PULSE ON state). */
250
+ private waveLooping;
251
+ /** Sets continuous wave looping; enabling fires a wave immediately. */
252
+ waveLoop_set(on: boolean): void;
253
+ /** @returns Whether the wave is looping. */
254
+ waveLoop_get(): boolean;
255
+ /**
256
+ * Where every node settled last, by id, for a caller that remembers.
257
+ *
258
+ * @returns Rounded positions, node id to [x, y, z].
259
+ */
260
+ positions_get(): Record<string, [number, number, number]>;
261
+ /**
262
+ * Seeds the next settle from remembered positions: a node that was here
263
+ * before starts where it stood, a new one starts fresh. Takes effect on
264
+ * the next `graph_set`.
265
+ *
266
+ * @param positions - Node id to [x, y, z].
267
+ */
268
+ positions_seed(positions: Record<string, [number, number, number]>): void;
269
+ /**
270
+ * Starts the pulse wave: nodes flare in dependency order, a join waiting
271
+ * for its last parent. History-honest — only nodes that actually executed
272
+ * (terminal success or error, or an authored template node) fire, so on a
273
+ * running feed the wave halts at the execution frontier.
274
+ */
275
+ wave_start(): void;
276
+ /**
277
+ * Flies the camera into a node: a dolly toward the sphere until it fills
278
+ * the frame. The idle spin holds for the whole stay; `flight_back` reverses.
279
+ *
280
+ * @param nodeId - The node to fly into.
281
+ * @param onArrived - Called once the camera is inside the node.
282
+ */
283
+ flight_into(nodeId: string, onArrived: () => void): void;
284
+ /**
285
+ * Flies the camera to frame a set of nodes: the fit `camera_fit` would
286
+ * give those nodes alone, reached by a flight from where the camera
287
+ * stands rather than a cut. A descent into one feed frames that feed;
288
+ * the climb back frames everything. Never holds: picking goes on.
289
+ *
290
+ * @param ids - The nodes to frame; every drawn node when empty.
291
+ * @param durationMs - The flight's length.
292
+ * @param onDone - Called when the camera arrives.
293
+ * @param bulk - The share of the nodes the frame must hold, 0..1: at 1
294
+ * every outlier is inside the frame; at 0.85 the farthest few spill,
295
+ * and the bulk is close enough to touch. A large feed's settle throws
296
+ * a few nodes far out, and a frame that held them all put the feed at
297
+ * the centre as a starburst of two-pixel spheres nobody could click.
298
+ */
299
+ camera_flyToFit(ids: ReadonlyArray<string>, durationMs: number, onDone: () => void, bulk?: number, margin?: number): void;
300
+ /**
301
+ * How far the camera stands from what it looks at.
302
+ *
303
+ * @returns The distance from the eye to the focus, in scene units.
304
+ */
305
+ camera_distance(): number;
306
+ /**
307
+ * Whether the operator has placed the camera since the scene last framed
308
+ * the graph: a wheel or a drag. A repaint of the same space keeps a
309
+ * placed camera; a fresh space is framed whole.
310
+ *
311
+ * @returns True once the operator has wheeled or dragged since the last fit.
312
+ */
313
+ camera_touched(): boolean;
314
+ /**
315
+ * Draws the nodes as lit spheres or as stars. Moves nothing: the scene
316
+ * is redrawn where it stands, the camera where the operator put it.
317
+ *
318
+ * @param mode - The draw mode.
319
+ */
320
+ draw_set(mode: DrawMode): void;
321
+ /**
322
+ * Shows or hides the nodes' captions; nothing is redrawn.
323
+ *
324
+ * @param on - Shown.
325
+ */
326
+ captions_set(on: boolean): void;
327
+ /** @returns How nodes are drawn. */
328
+ draw_get(): DrawMode;
329
+ /**
330
+ * What the scene holds, for a surface asked to say so: how it draws,
331
+ * how many nodes are solid spheres and how many stars, which of the
332
+ * graph's solid-marked nodes are drawn solid, and the hand-off's state.
333
+ *
334
+ * @returns A plain summary.
335
+ */
336
+ state_get(): Record<string, unknown>;
337
+ /**
338
+ * Flies the camera toward one node, along the line it already looks
339
+ * down, to a distance where its neighbourhood fills the view: the zoom
340
+ * into the star the operator clicked, not a framing of all it belongs to.
341
+ *
342
+ * @param id - The node.
343
+ * @param distance - How far from it to stop, in scene units.
344
+ * @param durationMs - The flight's length.
345
+ * @param onDone - Called on arrival (at once when the node is not drawn).
346
+ */
347
+ camera_flyToward(id: string, distance: number, durationMs: number, onDone: () => void): void;
348
+ /**
349
+ * Whether the camera is parked inside a node.
350
+ *
351
+ * The fly-in dollies to just shy of a node's surface, so while this is
352
+ * true the pane is filled by the inside of one sphere. Anything that can
353
+ * leave an operator there without an overlay on top has to be able to ask
354
+ * this and fly them back.
355
+ *
356
+ * @returns True while the camera is held inside a node.
357
+ */
358
+ holding_get(): boolean;
359
+ /**
360
+ * Flies the camera back out to its pre-dive stance and releases the hold.
361
+ *
362
+ * @param onDone - Called once the camera is home.
363
+ */
364
+ flight_back(onDone: () => void): void;
365
+ /** Computes each fireable node's flare time, in ms into the wave. */
366
+ private waveSchedule_compute;
367
+ /** Applies the wave's flares for this frame; loops in ambient mode. */
368
+ private wave_animate;
369
+ /**
370
+ * Switches the layout strategy and re-lays the current graph.
371
+ *
372
+ * @param strategy - Ranked tiers or the force-settled molecule.
373
+ */
374
+ strategy_set(strategy: LayoutStrategy): void;
375
+ /** Clears the node selection (a new graph owes nothing to the old one). */
376
+ selection_clear(): void;
377
+ /**
378
+ * Lights the selected sphere and dims the rest, touching materials only.
379
+ * Selection used to rebuild the scene: every click re-ran the settle of
380
+ * every node (seconds, on three thousand) and refitted the camera to
381
+ * the whole graph, so a click on a sphere the operator had dollied up
382
+ * to threw them back out to the whole space before anything else
383
+ * happened, and a double click could never land. A selection is paint.
384
+ */
385
+ private selection_paint;
386
+ /** @returns The active layout strategy. */
387
+ strategy_get(): LayoutStrategy;
388
+ /** The active projection: the sculpted 3D stage, or the flat schematic. */
389
+ private projection;
390
+ /**
391
+ * Switches projection. 2D is the schematic reading: the layout flattens
392
+ * to the plane, the view squares up face-on, the idle spin rests, and an
393
+ * empty-space drag pans (there is no depth to orbit). 3D restores the
394
+ * sculpted stage.
395
+ *
396
+ * @param projection - The projection to show.
397
+ */
398
+ projection_set(projection: '3d' | '2d'): void;
399
+ /** @returns The active projection. */
400
+ projection_get(): '3d' | '2d';
401
+ /**
402
+ * Updates one node's look in place (its state changed on the progress
403
+ * channel) without re-laying the graph.
404
+ *
405
+ * @param nodeId - The node.
406
+ * @param look - How it looks now.
407
+ */
408
+ look_update(nodeId: string, look: NodeLook): void;
409
+ /** @returns The colours to draw with now. */
410
+ private palette_read;
411
+ /** Re-reads the palette (the THEME pill changed) and repaints. */
412
+ palette_refresh(): void;
413
+ /** Fits the renderer to the container's current box. */
414
+ size_fit(): void;
415
+ /** Tears the scene down and releases the GL context. */
416
+ dispose(): void;
417
+ /**
418
+ * Fits the camera to the placed graph: distance from the bounding sphere
419
+ * so a sprawling molecule (or a wide 2D settle) sits inside the frustum
420
+ * instead of clipping through the near plane as black voids — or leaving
421
+ * the view entirely.
422
+ */
423
+ /**
424
+ * Builds the census: one instanced member per collapsed count, on a
425
+ * fibonacci shell around its group's anchor; equal-count parent/child
426
+ * groups pair members by index, so chains of ×N groups render as
427
+ * branched filaments over the shell — the cell-surface reading.
428
+ */
429
+ private censusBuild;
430
+ private camera_fit;
431
+ /** Counts rebuilds, so a sliced settle overtaken by a newer one stops. */
432
+ private rebuildGen;
433
+ /** Whether a settle is running in slices, its readout up. */
434
+ private slicing;
435
+ /**
436
+ * Rebuilds meshes and edges from the current graph and strategy.
437
+ *
438
+ * @param fit - Frame the result.
439
+ * @param mode - How the graph settles; see {@link SettleMode}.
440
+ */
441
+ private rebuild;
442
+ /** The layout worker, made on the first big settle and kept. */
443
+ private layoutWorker;
444
+ /** How a hierarchy sits molecules around their anchor. */
445
+ private arrangement;
446
+ /** Where each arrangement's spheres stood, for a return to it. */
447
+ private arrangementMemory;
448
+ /**
449
+ * Arranges molecules as clumps or spokes. The space is laid out afresh:
450
+ * a remembered shape would keep the old arrangement.
451
+ *
452
+ * @param arrangement - The arrangement: a registered engine's name.
453
+ * @param remembered - Where its spheres stood, from a host's memory.
454
+ * @param redraw - Redraw at once; false when the host is about to hand
455
+ * in the graph the arrangement needs (constellations bring their stars).
456
+ */
457
+ arrangement_set(arrangement: SpaceArrangement, remembered?: Record<string, [number, number, number]>, redraw?: boolean): void;
458
+ /** @returns How a hierarchy sits molecules round their hubs. */
459
+ arrangement_get(): SpaceArrangement;
460
+ /**
461
+ * Settles the graph as a hierarchy in the worker, reporting progress, and
462
+ * draws the answer if no newer rebuild has overtaken it.
463
+ */
464
+ private hierarchy_run;
465
+ /** Draws placed nodes as the scene: meshes, edges, census, the frame. */
466
+ private draw;
467
+ /**
468
+ * Plays the space's history: every node with an arrival hidden until it
469
+ * arrives, then shown with a flash, at its final place, the camera
470
+ * untouched. Nodes without one stand throughout. Nothing turns solid
471
+ * while it plays; stars only.
472
+ *
473
+ * @param arrivals - When each node arrived (epoch ms for dates).
474
+ * @param speed - 1 crosses the whole history in {@link REPLAY_WALL_MS}.
475
+ */
476
+ replay_begin(arrivals: ReadonlyMap<string, number>, speed?: number): void;
477
+ /**
478
+ * Plays on (or again from the start, at the end).
479
+ *
480
+ * @param speed - A new speed, or the one it had.
481
+ */
482
+ replay_play(speed?: number): void;
483
+ /** Holds the replay where it is. */
484
+ replay_pause(): void;
485
+ /**
486
+ * Moves the replay to a moment: what had arrived by then shown, the rest hidden.
487
+ *
488
+ * @param at - The moment, in the arrivals' units.
489
+ */
490
+ replay_seek(at: number): void;
491
+ /** Ends the replay: the space redrawn whole, the hand-off back. */
492
+ replay_stop(): void;
493
+ /**
494
+ * Where the replay stands, or null when none runs.
495
+ *
496
+ * @returns Whether it plays, its moment, and its span.
497
+ */
498
+ replay_state(): {
499
+ playing: boolean;
500
+ at: number;
501
+ span: [number, number];
502
+ } | null;
503
+ /** One frame of the replay: arrivals shown, departures hidden, flashes faded. */
504
+ private replay_step;
505
+ /** Shows what arrived and hides what left, threads following. */
506
+ private replay_apply;
507
+ /** Paints every dated node as the replay has it: shown if arrived, else hidden. */
508
+ private replay_paintAll;
509
+ /**
510
+ * Steps the hand-off once a frame: a feed whose largest sphere spans
511
+ * more than a few pixels turns solid, crossfading, its threads rising
512
+ * to edges; one that shrinks back goes to stars and its spheres are let go.
513
+ */
514
+ private handoff_step;
515
+ /**
516
+ * How a placed node's sphere is drawn when its molecule turns solid.
517
+ *
518
+ * @param id - The node.
519
+ * @returns Where it stands, how large, what hue.
520
+ */
521
+ private handoffLook_of;
522
+ /**
523
+ * A placed node as the tubes read it.
524
+ *
525
+ * @param id - The node.
526
+ * @returns Where it stands, how large, what it hangs from, its state.
527
+ */
528
+ private tubeNode_of;
529
+ /**
530
+ * A cluster's handle while the scene draws stars: a soft glow at its
531
+ * anchor, facing the camera, sized as its halo would be.
532
+ */
533
+ private nebula_add;
534
+ /**
535
+ * Where a drawn node stands in the world and how big it is — a sphere,
536
+ * a star or a census member alike — for flights and framing.
537
+ *
538
+ * @param id - The node.
539
+ * @returns Its world position and radius, or null when it is not drawn.
540
+ */
541
+ private nodeWorld_of;
542
+ /** Every drawn node's id: spheres and stars. */
543
+ private drawnIds;
544
+ /** Copies simulation positions onto meshes and re-anchors every edge. */
545
+ private positions_sync;
546
+ /**
547
+ * A press the gestures could not place: when it landed on a node it
548
+ * begins a pull (the structure reacts through a live force simulation
549
+ * anchored at the grabbed node) and the press is the scene's to follow.
550
+ *
551
+ * @param event - The press.
552
+ * @returns True when a node was taken hold of.
553
+ */
554
+ private grab_begin;
555
+ /**
556
+ * Builds the reaction simulation, from the meshes' current positions with
557
+ * the grabbed node fixed. Deferred to the first real pointer movement: a
558
+ * heated simulation on a mere press would shift nodes out from under the
559
+ * click and dblclick raycasts. Links and charge only — no centering
560
+ * force, or the pull would fight a recentering spring.
561
+ */
562
+ private dragSim_begin;
563
+ /** Follows the pointer during a pull: the grabbed node tracks the drag plane. */
564
+ private drag_move;
565
+ /** Nodes easing home after a ranked peek: mesh, from, to, start time. */
566
+ private dragReturns;
567
+ /**
568
+ * Releases a pull: the grip opens and the simulation cools to rest.
569
+ *
570
+ * @returns Whether the pull had moved, so its click is swallowed.
571
+ */
572
+ private grab_end;
573
+ /**
574
+ * Draws nodes as lit spheres joined by tubes, among a census: the feed the
575
+ * operator entered, which the census's points would otherwise swallow.
576
+ *
577
+ * @param solidOnes - The nodes to draw solid.
578
+ * @param palette - The palette.
579
+ */
580
+ private solid_draw;
581
+ /**
582
+ * The pointer left the field. A finger lifting leaves at once, so its
583
+ * name stays up a moment to be read; a cursor's goes with it.
584
+ *
585
+ * @param event - The leave.
586
+ */
587
+ private leave_handle;
588
+ /** Names the node under the pointer in the hover tip, or hides it. */
589
+ private hover_handle;
590
+ /** Resolves a pointer event to a node and fires the matching handler. */
591
+ private pick_handle;
592
+ }