@modernrelay/orbit-core 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/engine.d.ts CHANGED
@@ -1 +1 @@
1
- export { aZ as BufferPatch, a9 as EngineBufferChannel, ac as EngineCapabilities, ab as EngineCommit, a_ as EngineConfigUpdate, a$ as EngineContextEvent, aY as EngineDiagnostic, E as EngineFactory, aW as EngineHostEvents, aX as FitViewOptions, aa as GraphEngine } from './index-DvjTPb5T.js';
1
+ export { aZ as BufferPatch, a9 as EngineBufferChannel, ac as EngineCapabilities, ab as EngineCommit, a_ as EngineConfigUpdate, a$ as EngineContextEvent, aY as EngineDiagnostic, E as EngineFactory, aW as EngineHostEvents, aX as FitViewOptions, aa as GraphEngine } from './index-Bsx85b5l.js';
@@ -1519,9 +1519,14 @@ interface GraphEngine {
1519
1519
  /** Replace the full pinned set; null/[] unpins all (idempotent). */
1520
1520
  setPinnedIndices?(indices: readonly number[] | null): void;
1521
1521
  getPositions(): Float32Array | null;
1522
+ /** Optional nonblocking snapshot for bounded overlay sampling. Returns an
1523
+ * owned buffer, or null when unavailable/invalidated by engine recovery.
1524
+ * Core stamps the request against its scene and render revision. */
1525
+ getPositionsAsync?(): Promise<Float32Array | null>;
1522
1526
  destroy(): void;
1523
1527
  }
1524
1528
  /** Engine factory the host passes in; called once per instance mount. */
1525
1529
  type EngineFactory = () => GraphEngine;
1526
1530
 
1527
- export { type ThemeInput as $, type AcceptedGraph as A, type BeginIngestOptions as B, type ResolvedCluster as C, type ExpansionOptions as D, type EngineFactory as E, type NeighborhoodOptions as F, type GraphSnapshot as G, type NeighborhoodResult as H, type IngestSession as I, type JsonValue as J, type PathOptions as K, type LabelPlacement as L, type MetaEdge as M, type NodeId as N, type PathResult as O, type PathService as P, type PathOutcome as Q, type ResolvedGroup as R, type SceneFold as S, type SearchActivation as T, type CrossfilterSession as U, type ViewportState as V, type TimelinePlayback as W, type Scale as X, type MetricName as Y, type Revisions as Z, type AccessibilityConfig as _, type GraphDiagnostic as a, type EngineContextEvent as a$, type LabelConfig as a0, type IngestBatch as a1, type RevisionDimension as a2, type FilterSpec as a3, type FilterExpr as a4, type DimensionSpec as a5, type BrushState as a6, type DimensionSummary as a7, type DomainPolicy as a8, type EngineBufferChannel as a9, type GraphOperationError as aA, type HistogramBin as aB, type IngestCommitReceipt as aC, type IngestSessionState as aD, type InstanceStatus as aE, type LayoutKind as aF, type NodeEventPayload as aG, type NodeVisibility as aH, OrbitOperationError as aI, type RelationshipOptions as aJ, type ResourceAdmissionReport as aK, type ResourceDegradeStep as aL, SIMULATION_PRESETS as aM, type SearchUnavailableReason as aN, type SimulationConfig as aO, type SimulationInput as aP, type SimulationPreset as aQ, type StringColumn as aR, graphErrorToError as aS, isFatalGraphError as aT, resolveSimulation as aU, resourceLimitFatal as aV, type EngineHostEvents as aW, type FitViewOptions as aX, type EngineDiagnostic as aY, type BufferPatch as aZ, type EngineConfigUpdate as a_, type GraphEngine as aa, type EngineCommit as ab, type EngineCapabilities as ac, type MetricColumn as ad, type ColumnarGraphSnapshot as ae, type GraphSnapshotInput as af, type AppendReceipt as ag, type CategoryBin as ah, type ClusterSpec as ai, type Column as aj, type ColumnChange as ak, DIAGNOSTIC_SAMPLE_CAP as al, type DegradeEvent as am, type DegradeStep as an, type DiagnosticCode as ao, type DiagnosticSeverity as ap, type DimensionKind as aq, type ErrorPhase as ar, type ExpansionBatch as as, type ExpansionProgress as at, type ExpansionQuery as au, type ExpansionResponse as av, type FilterMode as aw, type FilterValue as ax, type GraphEdge as ay, type GraphError as az, type GraphNode as b, type AcceptedEdge as c, type GroupSpec as d, type GroupBySpec as e, type SceneGroups as f, type RenderScene as g, type SceneLinkRef as h, type ScenePointRef as i, type Accessor as j, type RevisionAwareService as k, type RequestContext as l, type SearchResult as m, type SelectionState as n, type SubgraphSpec as o, type ExpansionService as p, type ScaleLimits as q, type ExpansionPage as r, type GraphTheme as s, type GraphStoreState as t, type GraphHostUpdate as u, type GraphEventName as v, type GraphEventMap as w, type GraphListenerControl as x, type EdgeId as y, type GraphPerfSnapshot as z };
1531
+ export { OrbitOperationError as aI, SIMULATION_PRESETS as aM, graphErrorToError as aS, isFatalGraphError as aT, resolveSimulation as aU, resourceLimitFatal as aV, DIAGNOSTIC_SAMPLE_CAP as al };
1532
+ export type { ThemeInput as $, AcceptedGraph as A, BeginIngestOptions as B, ResolvedCluster as C, ExpansionOptions as D, EngineFactory as E, NeighborhoodOptions as F, GraphSnapshot as G, NeighborhoodResult as H, IngestSession as I, JsonValue as J, PathOptions as K, LabelPlacement as L, MetaEdge as M, NodeId as N, PathResult as O, PathService as P, PathOutcome as Q, ResolvedGroup as R, SceneFold as S, SearchActivation as T, CrossfilterSession as U, ViewportState as V, TimelinePlayback as W, Scale as X, MetricName as Y, Revisions as Z, AccessibilityConfig as _, GraphDiagnostic as a, EngineContextEvent as a$, LabelConfig as a0, IngestBatch as a1, RevisionDimension as a2, FilterSpec as a3, FilterExpr as a4, DimensionSpec as a5, BrushState as a6, DimensionSummary as a7, DomainPolicy as a8, EngineBufferChannel as a9, GraphOperationError as aA, HistogramBin as aB, IngestCommitReceipt as aC, IngestSessionState as aD, InstanceStatus as aE, LayoutKind as aF, NodeEventPayload as aG, NodeVisibility as aH, RelationshipOptions as aJ, ResourceAdmissionReport as aK, ResourceDegradeStep as aL, SearchUnavailableReason as aN, SimulationConfig as aO, SimulationInput as aP, SimulationPreset as aQ, StringColumn as aR, EngineHostEvents as aW, FitViewOptions as aX, EngineDiagnostic as aY, BufferPatch as aZ, EngineConfigUpdate as a_, GraphEngine as aa, EngineCommit as ab, EngineCapabilities as ac, MetricColumn as ad, ColumnarGraphSnapshot as ae, GraphSnapshotInput as af, AppendReceipt as ag, CategoryBin as ah, ClusterSpec as ai, Column as aj, ColumnChange as ak, DegradeEvent as am, DegradeStep as an, DiagnosticCode as ao, DiagnosticSeverity as ap, DimensionKind as aq, ErrorPhase as ar, ExpansionBatch as as, ExpansionProgress as at, ExpansionQuery as au, ExpansionResponse as av, FilterMode as aw, FilterValue as ax, GraphEdge as ay, GraphError as az, GraphNode as b, AcceptedEdge as c, GroupSpec as d, GroupBySpec as e, SceneGroups as f, RenderScene as g, SceneLinkRef as h, ScenePointRef as i, Accessor as j, RevisionAwareService as k, RequestContext as l, SearchResult as m, SelectionState as n, SubgraphSpec as o, ExpansionService as p, ScaleLimits as q, ExpansionPage as r, GraphTheme as s, GraphStoreState as t, GraphHostUpdate as u, GraphEventName as v, GraphEventMap as w, GraphListenerControl as x, EdgeId as y, GraphPerfSnapshot as z };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { G as GraphSnapshot, A as AcceptedGraph, R as ResolvedGroup, a as GraphDiagnostic, b as GraphNode, c as AcceptedEdge, N as NodeId, M as MetaEdge, S as SceneFold, d as GroupSpec, e as GroupBySpec, f as SceneGroups, g as RenderScene, h as SceneLinkRef, i as ScenePointRef, j as Accessor, k as RevisionAwareService, l as RequestContext, m as SearchResult, V as ViewportState, n as SelectionState, o as SubgraphSpec, J as JsonValue, E as EngineFactory, p as ExpansionService, P as PathService, q as ScaleLimits, r as ExpansionPage, s as GraphTheme, t as GraphStoreState, L as LabelPlacement, u as GraphHostUpdate, B as BeginIngestOptions, I as IngestSession, v as GraphEventName, w as GraphEventMap, x as GraphListenerControl, y as EdgeId, z as GraphPerfSnapshot, C as ResolvedCluster, D as ExpansionOptions, F as NeighborhoodOptions, H as NeighborhoodResult, K as PathOptions, O as PathResult, Q as PathOutcome, T as SearchActivation, U as CrossfilterSession, W as TimelinePlayback, X as Scale, Y as MetricName, Z as Revisions, _ as AccessibilityConfig, $ as ThemeInput, a0 as LabelConfig, a1 as IngestBatch, a2 as RevisionDimension, a3 as FilterSpec, a4 as FilterExpr, a5 as DimensionSpec, a6 as BrushState, a7 as DimensionSummary, a8 as DomainPolicy, a9 as EngineBufferChannel, aa as GraphEngine, ab as EngineCommit, ac as EngineCapabilities, ad as MetricColumn, ae as ColumnarGraphSnapshot, af as GraphSnapshotInput } from './index-DvjTPb5T.js';
2
- export { ag as AppendReceipt, ah as CategoryBin, ai as ClusterSpec, aj as Column, ak as ColumnChange, al as DIAGNOSTIC_SAMPLE_CAP, am as DegradeEvent, an as DegradeStep, ao as DiagnosticCode, ap as DiagnosticSeverity, aq as DimensionKind, ar as ErrorPhase, as as ExpansionBatch, at as ExpansionProgress, au as ExpansionQuery, av as ExpansionResponse, aw as FilterMode, ax as FilterValue, ay as GraphEdge, az as GraphError, aA as GraphOperationError, aB as HistogramBin, aC as IngestCommitReceipt, aD as IngestSessionState, aE as InstanceStatus, aF as LayoutKind, aG as NodeEventPayload, aH as NodeVisibility, aI as OrbitOperationError, aJ as RelationshipOptions, aK as ResourceAdmissionReport, aL as ResourceDegradeStep, aM as SIMULATION_PRESETS, aN as SearchUnavailableReason, aO as SimulationConfig, aP as SimulationInput, aQ as SimulationPreset, aR as StringColumn, aS as graphErrorToError, aT as isFatalGraphError, aU as resolveSimulation, aV as resourceLimitFatal } from './index-DvjTPb5T.js';
3
- import { W as WorkerFactoryOption } from './lane-DmEqBKz4.js';
4
- export { C as ClusterDerivation, D as DEFAULT_CLUSTER_CENTER_RADIUS, a as DEFAULT_LAYOUT_SEED, E as EncodedStringTable, R as RequestClass, b as WorkerEntity, c as WorkerEnvelope, d as WorkerTransport, e as clusterCentroids, f as collectTransfers, g as decodeStringTable, h as deriveClusters, i as encodeStringTable, j as generateClusterCenters, k as judgeEpoch, r as resolveClusterCenters } from './lane-DmEqBKz4.js';
1
+ import { G as GraphSnapshot, A as AcceptedGraph, R as ResolvedGroup, a as GraphDiagnostic, b as GraphNode, c as AcceptedEdge, N as NodeId, M as MetaEdge, S as SceneFold, d as GroupSpec, e as GroupBySpec, f as SceneGroups, g as RenderScene, h as SceneLinkRef, i as ScenePointRef, j as Accessor, k as RevisionAwareService, l as RequestContext, m as SearchResult, V as ViewportState, n as SelectionState, o as SubgraphSpec, J as JsonValue, p as ExpansionService, P as PathService, q as ScaleLimits, r as ExpansionPage, s as GraphTheme, t as GraphStoreState, L as LabelPlacement, u as GraphHostUpdate, B as BeginIngestOptions, I as IngestSession, v as GraphEventName, w as GraphEventMap, x as GraphListenerControl, y as EdgeId, z as GraphPerfSnapshot, C as ResolvedCluster, D as ExpansionOptions, F as NeighborhoodOptions, H as NeighborhoodResult, K as PathOptions, O as PathResult, Q as PathOutcome, T as SearchActivation, U as CrossfilterSession, W as TimelinePlayback, X as Scale, Y as MetricName, Z as Revisions, _ as AccessibilityConfig, $ as ThemeInput, a0 as LabelConfig, a1 as IngestBatch, a2 as RevisionDimension, a3 as FilterSpec, a4 as FilterExpr, a5 as DimensionSpec, a6 as BrushState, a7 as DimensionSummary, a8 as DomainPolicy, a9 as EngineBufferChannel, ad as MetricColumn, ae as ColumnarGraphSnapshot, af as GraphSnapshotInput } from './index-Bsx85b5l.js';
2
+ import { EngineFactory, GraphEngine, EngineCommit, EngineCapabilities } from './engine.js';
3
+ export { ag as AppendReceipt, ah as CategoryBin, ai as ClusterSpec, aj as Column, ak as ColumnChange, al as DIAGNOSTIC_SAMPLE_CAP, am as DegradeEvent, an as DegradeStep, ao as DiagnosticCode, ap as DiagnosticSeverity, aq as DimensionKind, ar as ErrorPhase, as as ExpansionBatch, at as ExpansionProgress, au as ExpansionQuery, av as ExpansionResponse, aw as FilterMode, ax as FilterValue, ay as GraphEdge, az as GraphError, aA as GraphOperationError, aB as HistogramBin, aC as IngestCommitReceipt, aD as IngestSessionState, aE as InstanceStatus, aF as LayoutKind, aG as NodeEventPayload, aH as NodeVisibility, aI as OrbitOperationError, aJ as RelationshipOptions, aK as ResourceAdmissionReport, aL as ResourceDegradeStep, aM as SIMULATION_PRESETS, aN as SearchUnavailableReason, aO as SimulationConfig, aP as SimulationInput, aQ as SimulationPreset, aR as StringColumn, aS as graphErrorToError, aT as isFatalGraphError, aU as resolveSimulation, aV as resourceLimitFatal } from './index-Bsx85b5l.js';
4
+ import { W as WorkerFactoryOption } from './lane-D7xtoPJy.js';
5
+ export { C as ClusterDerivation, D as DEFAULT_CLUSTER_CENTER_RADIUS, a as DEFAULT_LAYOUT_SEED, E as EncodedStringTable, R as RequestClass, b as WorkerEntity, c as WorkerEnvelope, d as WorkerTransport, e as clusterCentroids, f as collectTransfers, g as decodeStringTable, h as deriveClusters, i as encodeStringTable, j as generateClusterCenters, k as judgeEpoch, r as resolveClusterCenters } from './lane-D7xtoPJy.js';
5
6
  import { StoreApi } from 'zustand/vanilla';
6
7
 
7
8
  /**
@@ -336,6 +337,111 @@ declare function projectSizes<T>(items: readonly T[], accessor: Accessor<T, numb
336
337
  diagnostics: GraphDiagnostic[];
337
338
  };
338
339
 
340
+ /**
341
+ * minimap / overview — CPU fallback lane.
342
+ *
343
+ * v0.9 trim: no engine exposes `capabilities.overviewPass` yet (cosmos has no
344
+ * second draw pass — matrix), so this controller IS the minimap thumbnail
345
+ * path: an O(n) CPU rasterization of the position mirror into a small
346
+ * RGBA dot field. It is a pure controller — no DOM, no canvas — the React
347
+ * component blits the returned `Uint8ClampedArray` into an `ImageData`/canvas
348
+ * and draws the viewport rectangle on top (O(1) from `getViewport`, fully
349
+ * decoupled from thumbnail refresh cadence).
350
+ *
351
+ * Refresh cadence: ≤ 2 Hz while the simulation is hot (positions
352
+ * change continuously on the GPU, so the epoch is ignored), ≤ 1 Hz after a
353
+ * change while idle, and ZERO work while idle with an unchanged positions
354
+ * epoch — `shouldRefresh` is the single throttle gate and latches its clock /
355
+ * epoch only when it answers true (a `true` must be followed by one
356
+ * `rasterize`).
357
+ *
358
+ * Orientation: minimap pixel y grows DOWNWARD while world (space) y grows
359
+ * upward — the same flip cosmos applies in its space→screen scale (dist
360
+ * `scalePointY.domain([S, 0])`), so the thumbnail visually matches the main
361
+ * canvas. `worldToMinimap`/`minimapToWorld` are exact inverses over the last
362
+ * rasterized bounds.
363
+ */
364
+ /** Position mirror handed to the controller: interleaved x,y space coords. */
365
+ interface OverviewScene {
366
+ /** Interleaved `[x0, y0, x1, y1, …]`; may be longer than `count` pairs. */
367
+ positions: Float32Array;
368
+ /** Number of points (pairs) to read from `positions`. */
369
+ count: number;
370
+ }
371
+ /** Borrowed read-only view of the current scene's cached positions. The
372
+ * revision changes when the roster or positions change, including settling
373
+ * and dragging without a render revision. Do not mutate the position buffer. */
374
+ interface OverviewSnapshot extends OverviewScene {
375
+ readonly revision: number;
376
+ }
377
+ interface OverviewControllerOptions {
378
+ /** Latest scene snapshot, or null when nothing is loaded yet. */
379
+ getScene: () => OverviewScene | null;
380
+ /**
381
+ * Soft-filter visibility mask. Hidden points still rasterize (and still
382
+ * contribute to bounds — the thumbnail must not re-frame when a filter
383
+ * toggles) but at a dimmed alpha.
384
+ */
385
+ getVisible?: (index: number) => boolean;
386
+ /** Square thumbnail edge in pixels. Default {@link OVERVIEW_SIZE_DEFAULT}. */
387
+ size?: number;
388
+ }
389
+ /** World-space extent of the last rasterization (finite positions only). */
390
+ interface OverviewBounds {
391
+ minX: number;
392
+ minY: number;
393
+ maxX: number;
394
+ maxY: number;
395
+ }
396
+ interface OverviewRaster {
397
+ /** RGBA, `size * size * 4` bytes — blit via `new ImageData(bitmap, size)`. */
398
+ bitmap: Uint8ClampedArray;
399
+ bounds: OverviewBounds;
400
+ }
401
+ /** Spec the CPU fallback rasterizes into a 256² target. */
402
+ declare const OVERVIEW_SIZE_DEFAULT = 256;
403
+ /** Hot-simulation refresh floor: ≤ 2 Hz. */
404
+ declare const OVERVIEW_HOT_INTERVAL_MS = 500;
405
+ /** Idle-after-change refresh floor: ≤ 1 Hz. */
406
+ declare const OVERVIEW_IDLE_INTERVAL_MS = 1000;
407
+ declare class OverviewController {
408
+ private readonly getScene;
409
+ private readonly getVisible;
410
+ readonly size: number;
411
+ /** Transform of the LAST rasterization; null until rasterize succeeds. */
412
+ private frame;
413
+ private lastRefreshMs;
414
+ private lastEpoch;
415
+ constructor(options: OverviewControllerOptions);
416
+ /**
417
+ * The single throttle gate (see module header). Latches `nowMs`/`epoch`
418
+ * when it returns true, so each `true` accounts for exactly one refresh:
419
+ *
420
+ * - hot (`simulationRunning`): time-gated only (≤ 2 Hz) — the epoch is
421
+ * ignored because positions change continuously without epoch advances;
422
+ * - idle: refresh only when the epoch ADVANCED since the last refresh,
423
+ * time-gated at ≤ 1 Hz;
424
+ * - idle + unchanged epoch: always false — zero work, forever.
425
+ */
426
+ shouldRefresh(nowMs: number, simulationRunning: boolean, epoch: number): boolean;
427
+ /**
428
+ * Rasterizes the current scene into a fresh `size²` RGBA dot field: 1 px
429
+ * white dots whose alpha ACCUMULATES on overlap (heatmap-ish density),
430
+ * dimmed for mask-hidden points; NaN pairs are skipped.
431
+ * World bounds map into the thumbnail with a 5 % edge padding at a UNIFORM
432
+ * scale (aspect preserved, centered on the short axis) and a downward pixel
433
+ * y (see module header). Returns null when there is no scene or no point.
434
+ */
435
+ rasterize(): OverviewRaster | null;
436
+ /**
437
+ * World (space) → minimap pixel coords over the LAST rasterized frame
438
+ * (fractional; callers round for pixel work). Null before any rasterize.
439
+ */
440
+ worldToMinimap(x: number, y: number): [number, number] | null;
441
+ /** Exact inverse of {@link worldToMinimap}. Null before any rasterize. */
442
+ minimapToWorld(px: number, py: number): [number, number] | null;
443
+ }
444
+
339
445
  /**
340
446
  * search — the SearchService contract plus the built-in LOCAL indexed
341
447
  * service.
@@ -1353,6 +1459,12 @@ interface GraphInstance<N = Record<string, unknown>, E = Record<string, unknown>
1353
1459
  * null values; lazily computes the degree family on first use.
1354
1460
  */
1355
1461
  getMetricValue(metric: MetricName, id: NodeId): number | null;
1462
+ /** Latest live position cache, falling back to reconciled positions before
1463
+ * the first sample. Pure read; buffers are borrowed and must not be mutated. */
1464
+ getOverviewScene(): OverviewSnapshot | null;
1465
+ /** Observe position/roster changes and request bounded live sampling while
1466
+ * mounted. Replays once; unsubscribe removes this consumer's demand. */
1467
+ subscribeOverview(listener: () => void): () => void;
1356
1468
  getRevisions(): Revisions;
1357
1469
  getDiagnostics(): readonly GraphDiagnostic[];
1358
1470
  getNode(id: NodeId): GraphNode<N> | undefined;
@@ -1811,6 +1923,8 @@ declare class EdgePickingFacade {
1811
1923
  */
1812
1924
 
1813
1925
  type EdgePairCounters = Map<NodeId, Map<NodeId, number>>;
1926
+ /** Take and advance the next parallel-edge ordinal for an exact endpoint tuple. */
1927
+ declare function nextSynthesizedEdgeId(counters: EdgePairCounters, source: NodeId, target: NodeId): EdgeId;
1814
1928
 
1815
1929
  /**
1816
1930
  * revisioned ingestion — pure session/overlay bookkeeping plus the
@@ -3144,105 +3258,6 @@ declare class MetricStore<N = Record<string, unknown>> {
3144
3258
  private ensureDegrees;
3145
3259
  }
3146
3260
 
3147
- /**
3148
- * minimap / overview — CPU fallback lane.
3149
- *
3150
- * v0.9 trim: no engine exposes `capabilities.overviewPass` yet (cosmos has no
3151
- * second draw pass — matrix), so this controller IS the minimap thumbnail
3152
- * path: an O(n) CPU rasterization of the position mirror into a small
3153
- * RGBA dot field. It is a pure controller — no DOM, no canvas — the React
3154
- * component blits the returned `Uint8ClampedArray` into an `ImageData`/canvas
3155
- * and draws the viewport rectangle on top (O(1) from `getViewport`, fully
3156
- * decoupled from thumbnail refresh cadence).
3157
- *
3158
- * Refresh cadence: ≤ 2 Hz while the simulation is hot (positions
3159
- * change continuously on the GPU, so the epoch is ignored), ≤ 1 Hz after a
3160
- * change while idle, and ZERO work while idle with an unchanged positions
3161
- * epoch — `shouldRefresh` is the single throttle gate and latches its clock /
3162
- * epoch only when it answers true (a `true` must be followed by one
3163
- * `rasterize`).
3164
- *
3165
- * Orientation: minimap pixel y grows DOWNWARD while world (space) y grows
3166
- * upward — the same flip cosmos applies in its space→screen scale (dist
3167
- * `scalePointY.domain([S, 0])`), so the thumbnail visually matches the main
3168
- * canvas. `worldToMinimap`/`minimapToWorld` are exact inverses over the last
3169
- * rasterized bounds.
3170
- */
3171
- /** Position mirror handed to the controller: interleaved x,y space coords. */
3172
- interface OverviewScene {
3173
- /** Interleaved `[x0, y0, x1, y1, …]`; may be longer than `count` pairs. */
3174
- positions: Float32Array;
3175
- /** Number of points (pairs) to read from `positions`. */
3176
- count: number;
3177
- }
3178
- interface OverviewControllerOptions {
3179
- /** Latest scene snapshot, or null when nothing is loaded yet. */
3180
- getScene: () => OverviewScene | null;
3181
- /**
3182
- * Soft-filter visibility mask. Hidden points still rasterize (and still
3183
- * contribute to bounds — the thumbnail must not re-frame when a filter
3184
- * toggles) but at a dimmed alpha.
3185
- */
3186
- getVisible?: (index: number) => boolean;
3187
- /** Square thumbnail edge in pixels. Default {@link OVERVIEW_SIZE_DEFAULT}. */
3188
- size?: number;
3189
- }
3190
- /** World-space extent of the last rasterization (finite positions only). */
3191
- interface OverviewBounds {
3192
- minX: number;
3193
- minY: number;
3194
- maxX: number;
3195
- maxY: number;
3196
- }
3197
- interface OverviewRaster {
3198
- /** RGBA, `size * size * 4` bytes — blit via `new ImageData(bitmap, size)`. */
3199
- bitmap: Uint8ClampedArray;
3200
- bounds: OverviewBounds;
3201
- }
3202
- /** Spec the CPU fallback rasterizes into a 256² target. */
3203
- declare const OVERVIEW_SIZE_DEFAULT = 256;
3204
- /** Hot-simulation refresh floor: ≤ 2 Hz. */
3205
- declare const OVERVIEW_HOT_INTERVAL_MS = 500;
3206
- /** Idle-after-change refresh floor: ≤ 1 Hz. */
3207
- declare const OVERVIEW_IDLE_INTERVAL_MS = 1000;
3208
- declare class OverviewController {
3209
- private readonly getScene;
3210
- private readonly getVisible;
3211
- readonly size: number;
3212
- /** Transform of the LAST rasterization; null until rasterize succeeds. */
3213
- private frame;
3214
- private lastRefreshMs;
3215
- private lastEpoch;
3216
- constructor(options: OverviewControllerOptions);
3217
- /**
3218
- * The single throttle gate (see module header). Latches `nowMs`/`epoch`
3219
- * when it returns true, so each `true` accounts for exactly one refresh:
3220
- *
3221
- * - hot (`simulationRunning`): time-gated only (≤ 2 Hz) — the epoch is
3222
- * ignored because positions change continuously without epoch advances;
3223
- * - idle: refresh only when the epoch ADVANCED since the last refresh,
3224
- * time-gated at ≤ 1 Hz;
3225
- * - idle + unchanged epoch: always false — zero work, forever.
3226
- */
3227
- shouldRefresh(nowMs: number, simulationRunning: boolean, epoch: number): boolean;
3228
- /**
3229
- * Rasterizes the current scene into a fresh `size²` RGBA dot field: 1 px
3230
- * white dots whose alpha ACCUMULATES on overlap (heatmap-ish density),
3231
- * dimmed for mask-hidden points; NaN pairs are skipped.
3232
- * World bounds map into the thumbnail with a 5 % edge padding at a UNIFORM
3233
- * scale (aspect preserved, centered on the short axis) and a downward pixel
3234
- * y (see module header). Returns null when there is no scene or no point.
3235
- */
3236
- rasterize(): OverviewRaster | null;
3237
- /**
3238
- * World (space) → minimap pixel coords over the LAST rasterized frame
3239
- * (fractional; callers round for pixel work). Null before any rasterize.
3240
- */
3241
- worldToMinimap(x: number, y: number): [number, number] | null;
3242
- /** Exact inverse of {@link worldToMinimap}. Null before any rasterize. */
3243
- minimapToWorld(px: number, py: number): [number, number] | null;
3244
- }
3245
-
3246
3261
  /**
3247
3262
  * SVG export — the engine-free pure module.
3248
3263
  *
@@ -3521,4 +3536,5 @@ declare function descriptorKey(accessor: FieldAccessor<unknown, unknown>): strin
3521
3536
  */
3522
3537
  declare function evaluateFieldAccessor(accessor: FieldAccessor<unknown, unknown>, id: string, attrs: Readonly<Record<string, unknown>> | undefined): unknown;
3523
3538
 
3524
- export { ATLAS_MAX_CONCURRENT_DEFAULT, ATLAS_MAX_ENTRIES_DEFAULT, ATLAS_MAX_RETRIES_DEFAULT, AcceptanceQueue, AcceptedEdge, AcceptedGraph, AccessibilityConfig, Accessor, type Adjacency, type AdmitColumnsOptions, type AdmitColumnsResult, type AdmitServiceResultArgs, BASE_PENDING_KEY, BRUSH_HISTORY_COALESCE_MS, BeginIngestOptions, type BrushDelta, BrushState, CATEGORICAL_PALETTE, type CategoricalScale, type ColumnarAcceptance, ColumnarGraphSnapshot, type ColumnarIssue, type CompiledFilter, type CreateGraphInstanceOptions, type CreateRequestContextArgs, CrossfilterSession, type CrossfilterStats, DEFAULT_BIN_COUNT, DIM_ALPHA_DEFAULT, DIVERGING_RANGE_DEFAULT, type DescriptorIssue, DimensionSpec, DimensionSummary, type DivergingScale, DomainPolicy, DomainStore, EDGE_PICK_TOLERANCE_PX, EdgeId, type EdgePickRoute, EdgePickingFacade, type EdgePickingFacadeOptions, EngineBufferChannel, type EnginePolicy, type EnginePolicyDegradation, type ExpandNodeResult, ExpansionOptions, type ExpansionOverlayRecord, ExpansionPage, type ExpansionRecord, ExpansionService, type FetchLike, type FieldAccessor, type FilterErrorAggregate, FilterExpr, FilterSpec, GRAPH_THEME_DARK, GRAPH_THEME_LIGHT, GraphDiagnostic, GraphEventMap, GraphEventName, GraphHostUpdate, type GraphInstance, type GraphInvestigation, GraphListenerControl, GraphNode, GraphPerfSnapshot, type GraphServices, GraphSnapshot, GraphSnapshotInput, GraphStoreState, GraphTheme, type GraphViewState, type GroupByDerivation, GroupBySpec, type GroupRewrite, GroupSpec, type GroupValidationResult, HISTORY_LIMIT_DEFAULT, type HistoryCommand, type HistoryDepths, HistoryKernel, type HistoryKernelOptions, INGEST_MAX_FLUSH_LATENCY_MS_DEFAULT, INGEST_MAX_PENDING_BYTES_DEFAULT, INGEST_OVERFLOW_FACTOR, type ImageAtlasBatch, ImageAtlasPipeline, type ImageAtlasPipelineOptions, type ImageDecode, type ImageResolver, IngestBatch, IngestSession, InvestigationError, type InvestigationExpansion, type InvestigationExpansionOptions, type InvestigationSession, type InvestigationSessionOptions, type InvestigationSessionState, type InvestigationSource, JsonValue, LABEL_MAX_VISIBLE_CAP, LABEL_MAX_VISIBLE_DEFAULT, type LabelCandidate, type LabelCandidateResult, type LabelCandidateViewport, LabelConfig, LabelPlacement, type LabelSubscriptions, type LinkPickGridSnapshot, LinkPickIndex, type LinkVisibilityMask, type LocalExpansionBase, type LocalSearchBase, type LocalSearchService, META_EDGE_MAX_WIDTH, type MaskDrain, type MaskSource, type MergeBase, type MergeResult, MetaEdge, type MetaEdgeRecord, MetricColumn, type MetricModelInput, MetricName, MetricStore, NeighborhoodOptions, NeighborhoodResult, NodeId, OVERVIEW_HOT_INTERVAL_MS, OVERVIEW_IDLE_INTERVAL_MS, OVERVIEW_SIZE_DEFAULT, type OverviewBounds, OverviewController, type OverviewControllerOptions, type OverviewRaster, type OverviewScene, PHYSICAL_DEFAULT_LINK_WIDTH, PHYSICAL_DEFAULT_POINT_SIZE, PathOptions, PathOutcome, PathResult, PathService, PendingExpansions, type ReconcileResult, Reconciler, type RegisterExpansionResult, RenderScene, type RenderSvgOptions, RequestContext, type RequestContextHandle, type RequestedEngineFeatures, type ResolveDomainArgs, ResolvedCluster, ResolvedGroup, type ResolvedScope, RevisionAwareService, RevisionDimension, type RevisionSnapshot, Revisions, type RowTally, SEARCH_CACHE_LIMIT, SEARCH_LIMIT_DEFAULT, SEARCH_SCAN_CHUNK, SEARCH_SCORE_EXACT_ID, SEARCH_SCORE_ID_PREFIX, SEARCH_SCORE_SUBSTRING, SEARCH_SCORE_TOKEN_START_BONUS, SEQUENTIAL_RANGE_DEFAULT, SUPER_NODE_MAX_SIZE, SVG_MAX_ELEMENTS_DEFAULT, type SavedInvestigationPath, Scale, type ScaleChannelInfo, type ScaleInfoRow, ScaleLimits, SceneGroups, SceneLinkRef, ScenePointRef, SearchActivation, SearchResult, type SearchService, type SelectLabelCandidatesArgs, SelectionState, type SequentialScale, type SerializableScale, type SerializableTransform, type ServiceCacheKeyArgs, type SessionContribution, type SetViewStateResult, SoftMask, type StageResult, type StagingTallies, type StampedEdge, type StampedNode, SubgraphSpec, type SuperNodeRecord, SvgBudgetError, type SvgScene, type SvgSceneEdge, type SvgSceneLabel, type SvgSceneNode, TIMELINE_STEP_DEFAULT, TIMELINE_TICK_MS_DEFAULT, ThemeInput, TimelinePlayback, TypedColumnCrossfilter, type TypedFieldPath, VIEW_STATE_VERSION, type ViewBrushState, type ViewLayoutSpec, type ViewStateVerdict, type ViewStyling, ViewportState, WorkerFactoryOption, acceptColumnar, admitServiceResult, assertCapabilityMethodParity, baseFromAccepted, baseFromContribution, buildAcceptedAdjacency, buildAcceptedFromColumnar, buildAdjacency, canonicalFilterKey, canonicalJson, canonicalScaleKey, cascadeEdges, categoricalIndex, categoricalRows, coerceNumeric, coerceNumericInto, collapseParallelEdges, columnarArrayBuffers, compileEdgeFilter, compileNodeFilter, computeNumericDomain, createGraphInstance, createInvestigationSession, createLocalExpansionService, createLocalSearchService, createRequestContext, deriveGroupsByKey, descriptorKey, detachColumnarBuffers, divergingColor, escapeXml, estimateBatchBytes, evaluateFieldAccessor, evaluateFilterExpr, field, groupByDerivedId, groupSceneKey, interpolateColor, isColumnarSnapshot, isFieldAccessor, materializeColumnarSnapshot, medianLinkWidthPx, mergeDiagnostics, mergeModel, metaEdgePublicId, metaEdgeSceneKey, metaEdgeWidthFor, neighborsOf, newContribution, newStagingTallies, nextRequestId, normalizeCommitForCapabilities, parseColor, parseInvestigation, pointSegmentDistanceSquared, projectColors, projectSizes, renderSvg, resolveEnginePolicy, resolveFilterField, resolveManualGroups, resolveScope, resolveTheme, rewriteGroups, sameDataRef, sameGroupBySpec, sameGroupSpecArrays, sceneGroupsOf, sceneLinkRefAt, scenePointRefAt, selectLabelCandidates, sequentialColor, sequentialSize, serializeInvestigation, serviceCacheKey, sessionCommitDiagnostics, stageBatch, superNodeSizeFor, validateColumnarStructure, validateFieldAccessor, validateFilterExpr, validateGroupBySpec, validateGroupSpecs, validateSnapshot, validateViewState };
3539
+ export { ATLAS_MAX_CONCURRENT_DEFAULT, ATLAS_MAX_ENTRIES_DEFAULT, ATLAS_MAX_RETRIES_DEFAULT, AcceptanceQueue, AcceptedEdge, AcceptedGraph, AccessibilityConfig, Accessor, BASE_PENDING_KEY, BRUSH_HISTORY_COALESCE_MS, BeginIngestOptions, BrushState, CATEGORICAL_PALETTE, ColumnarGraphSnapshot, CrossfilterSession, DEFAULT_BIN_COUNT, DIM_ALPHA_DEFAULT, DIVERGING_RANGE_DEFAULT, DimensionSpec, DimensionSummary, DomainPolicy, DomainStore, EDGE_PICK_TOLERANCE_PX, EdgeId, EdgePickingFacade, EngineBufferChannel, ExpansionOptions, ExpansionPage, ExpansionService, FilterExpr, FilterSpec, GRAPH_THEME_DARK, GRAPH_THEME_LIGHT, GraphDiagnostic, GraphEventMap, GraphEventName, GraphHostUpdate, GraphListenerControl, GraphNode, GraphPerfSnapshot, GraphSnapshot, GraphSnapshotInput, GraphStoreState, GraphTheme, GroupBySpec, GroupSpec, HISTORY_LIMIT_DEFAULT, HistoryKernel, INGEST_MAX_FLUSH_LATENCY_MS_DEFAULT, INGEST_MAX_PENDING_BYTES_DEFAULT, INGEST_OVERFLOW_FACTOR, ImageAtlasPipeline, IngestBatch, IngestSession, InvestigationError, JsonValue, LABEL_MAX_VISIBLE_CAP, LABEL_MAX_VISIBLE_DEFAULT, LabelConfig, LabelPlacement, LinkPickIndex, META_EDGE_MAX_WIDTH, MetaEdge, MetricColumn, MetricName, MetricStore, NeighborhoodOptions, NeighborhoodResult, NodeId, OVERVIEW_HOT_INTERVAL_MS, OVERVIEW_IDLE_INTERVAL_MS, OVERVIEW_SIZE_DEFAULT, OverviewController, PHYSICAL_DEFAULT_LINK_WIDTH, PHYSICAL_DEFAULT_POINT_SIZE, PathOptions, PathOutcome, PathResult, PathService, PendingExpansions, Reconciler, RenderScene, RequestContext, ResolvedCluster, ResolvedGroup, RevisionAwareService, RevisionDimension, Revisions, SEARCH_CACHE_LIMIT, SEARCH_LIMIT_DEFAULT, SEARCH_SCAN_CHUNK, SEARCH_SCORE_EXACT_ID, SEARCH_SCORE_ID_PREFIX, SEARCH_SCORE_SUBSTRING, SEARCH_SCORE_TOKEN_START_BONUS, SEQUENTIAL_RANGE_DEFAULT, SUPER_NODE_MAX_SIZE, SVG_MAX_ELEMENTS_DEFAULT, Scale, ScaleLimits, SceneFold, SceneGroups, SceneLinkRef, ScenePointRef, SearchActivation, SearchResult, SelectionState, SoftMask, SubgraphSpec, SvgBudgetError, TIMELINE_STEP_DEFAULT, TIMELINE_TICK_MS_DEFAULT, ThemeInput, TimelinePlayback, TypedColumnCrossfilter, VIEW_STATE_VERSION, ViewportState, WorkerFactoryOption, acceptColumnar, admitServiceResult, assertCapabilityMethodParity, baseFromAccepted, baseFromContribution, buildAcceptedAdjacency, buildAcceptedFromColumnar, buildAdjacency, canonicalFilterKey, canonicalJson, canonicalScaleKey, cascadeEdges, categoricalIndex, categoricalRows, coerceNumeric, coerceNumericInto, collapseParallelEdges, columnarArrayBuffers, compileEdgeFilter, compileNodeFilter, computeNumericDomain, createGraphInstance, createInvestigationSession, createLocalExpansionService, createLocalSearchService, createRequestContext, deriveGroupsByKey, descriptorKey, detachColumnarBuffers, divergingColor, escapeXml, estimateBatchBytes, evaluateFieldAccessor, evaluateFilterExpr, field, groupByDerivedId, groupSceneKey, interpolateColor, isColumnarSnapshot, isFieldAccessor, materializeColumnarSnapshot, medianLinkWidthPx, mergeDiagnostics, mergeModel, metaEdgePublicId, metaEdgeSceneKey, metaEdgeWidthFor, neighborsOf, newContribution, newStagingTallies, nextRequestId, nextSynthesizedEdgeId, normalizeCommitForCapabilities, parseColor, parseInvestigation, pointSegmentDistanceSquared, projectColors, projectSizes, renderSvg, resolveEnginePolicy, resolveFilterField, resolveManualGroups, resolveScope, resolveTheme, rewriteGroups, sameDataRef, sameGroupBySpec, sameGroupSpecArrays, sceneGroupsOf, sceneLinkRefAt, scenePointRefAt, selectLabelCandidates, sequentialColor, sequentialSize, serializeInvestigation, serviceCacheKey, sessionCommitDiagnostics, stageBatch, superNodeSizeFor, validateColumnarStructure, validateFieldAccessor, validateFilterExpr, validateGroupBySpec, validateGroupSpecs, validateSnapshot, validateViewState };
3540
+ export type { Adjacency, AdmitColumnsOptions, AdmitColumnsResult, AdmitServiceResultArgs, BrushDelta, CategoricalScale, ColumnarAcceptance, ColumnarIssue, CompiledFilter, CreateGraphInstanceOptions, CreateRequestContextArgs, CrossfilterStats, DescriptorIssue, DivergingScale, EdgePairCounters, EdgePickRoute, EdgePickingFacadeOptions, EnginePolicy, EnginePolicyDegradation, ExpandNodeResult, ExpansionOverlayRecord, ExpansionRecord, FetchLike, FieldAccessor, FilterErrorAggregate, GraphInstance, GraphInvestigation, GraphServices, GraphViewState, GroupByDerivation, GroupRewrite, GroupValidationResult, HistoryCommand, HistoryDepths, HistoryKernelOptions, ImageAtlasBatch, ImageAtlasPipelineOptions, ImageDecode, ImageResolver, InvestigationExpansion, InvestigationExpansionOptions, InvestigationSession, InvestigationSessionOptions, InvestigationSessionState, InvestigationSource, LabelCandidate, LabelCandidateResult, LabelCandidateViewport, LabelSubscriptions, LinkPickGridSnapshot, LinkVisibilityMask, LocalExpansionBase, LocalSearchBase, LocalSearchService, MaskDrain, MaskSource, MergeBase, MergeResult, MetaEdgeRecord, MetricModelInput, OverviewBounds, OverviewControllerOptions, OverviewRaster, OverviewScene, OverviewSnapshot, ReconcileResult, RegisterExpansionResult, RenderSvgOptions, RequestContextHandle, RequestedEngineFeatures, ResolveDomainArgs, ResolvedScope, RevisionSnapshot, RowTally, SavedInvestigationPath, ScaleChannelInfo, ScaleInfoRow, SearchService, SelectLabelCandidatesArgs, SequentialScale, SerializableScale, SerializableTransform, ServiceCacheKeyArgs, SessionContribution, SetViewStateResult, StageResult, StagingTallies, StampedEdge, StampedNode, SuperNodeRecord, SvgScene, SvgSceneEdge, SvgSceneLabel, SvgSceneNode, TypedFieldPath, ViewBrushState, ViewLayoutSpec, ViewStateVerdict, ViewStyling };
package/dist/index.js CHANGED
@@ -6630,6 +6630,8 @@ var FRAME_PRESSURE_ENGAGE_MS = 40;
6630
6630
  var FRAME_PRESSURE_CLEAR_MS = 28;
6631
6631
  var LABEL_RERANK_THROTTLE_MS = 100;
6632
6632
  var SIM_HOT_REFRESH_MS = 500;
6633
+ var ASYNC_POSITION_REFRESH_MS = 100;
6634
+ var ASYNC_POSITION_MAX_NODES = 1e4;
6633
6635
  function sameIds(a, b) {
6634
6636
  if (a === b) return true;
6635
6637
  if (a.length !== b.length) return false;
@@ -6866,6 +6868,15 @@ function createGraphInstance(opts) {
6866
6868
  const positionSubs = /* @__PURE__ */ new Set();
6867
6869
  let currentPlacements = [];
6868
6870
  let labelPositionCache = null;
6871
+ const overviewSubs = /* @__PURE__ */ new Set();
6872
+ let overviewSnapshot = null;
6873
+ let overviewScene = null;
6874
+ let overviewRevision = 0;
6875
+ let notifiedOverviewSnapshot;
6876
+ let overviewNotificationQueued = false;
6877
+ let positionGeneration = 0;
6878
+ let positionFlight = null;
6879
+ let positionClockMs = 0;
6869
6880
  let frameCadence = 0;
6870
6881
  let quiescenceAsserted = false;
6871
6882
  let quiescenceTimer = null;
@@ -7063,6 +7074,7 @@ function createGraphInstance(opts) {
7063
7074
  }
7064
7075
  pendingHistoryDepths = null;
7065
7076
  store.setState((prev) => ({ ...prev, ...patch }));
7077
+ scheduleOverviewNotification();
7066
7078
  if (patch.visible !== void 0 || patch.nodeCount !== void 0) {
7067
7079
  evaluateLadderCounts();
7068
7080
  }
@@ -8461,7 +8473,7 @@ function createGraphInstance(opts) {
8461
8473
  }
8462
8474
  scopedAccepted = computeScopedAccepted();
8463
8475
  const result = reconcileScene(scopedAccepted ?? accepted);
8464
- labelPositionCache = null;
8476
+ invalidatePositionCache();
8465
8477
  adjacency = null;
8466
8478
  sceneIncidence = null;
8467
8479
  structuralChange = result.structuralChange;
@@ -9337,7 +9349,92 @@ function createGraphInstance(opts) {
9337
9349
  ...lastPointImageIndex !== null ? { pointImageIndex: lastPointImageIndex } : {}
9338
9350
  };
9339
9351
  }
9352
+ function invalidatePositionCache() {
9353
+ positionGeneration += 1;
9354
+ labelPositionCache = null;
9355
+ }
9356
+ function getOverviewScene() {
9357
+ if (destroyed || scene === null || scene.count === 0) {
9358
+ overviewSnapshot = null;
9359
+ overviewScene = scene;
9360
+ return null;
9361
+ }
9362
+ const positions = labelPositionCache ?? scene.positions;
9363
+ if (overviewScene !== scene || overviewSnapshot?.positions !== positions) {
9364
+ overviewScene = scene;
9365
+ overviewSnapshot = { positions, count: scene.count, revision: ++overviewRevision };
9366
+ }
9367
+ return overviewSnapshot;
9368
+ }
9369
+ function scheduleOverviewNotification() {
9370
+ if (destroyed || overviewSubs.size === 0 || overviewNotificationQueued) return;
9371
+ overviewNotificationQueued = true;
9372
+ queueMicrotask(() => {
9373
+ overviewNotificationQueued = false;
9374
+ if (destroyed) return;
9375
+ const next = getOverviewScene();
9376
+ if (notifiedOverviewSnapshot === next) return;
9377
+ notifiedOverviewSnapshot = next;
9378
+ for (const cb of Array.from(overviewSubs)) {
9379
+ try {
9380
+ cb();
9381
+ } catch {
9382
+ }
9383
+ }
9384
+ });
9385
+ }
9386
+ function subscribeOverview(cb) {
9387
+ if (destroyed) return () => {
9388
+ };
9389
+ overviewSubs.add(cb);
9390
+ try {
9391
+ cb();
9392
+ } catch {
9393
+ }
9394
+ sampleOverlayPositions(positionClockMs);
9395
+ return () => {
9396
+ overviewSubs.delete(cb);
9397
+ };
9398
+ }
9399
+ function sampleOverlayPositions(timeMs) {
9400
+ const s = session;
9401
+ const labelsActive = labelsEnabled();
9402
+ if (destroyed || s === null || !s.alive || scene === null || scene.count === 0 || layout !== "force" || store.getState().status !== "ready" || overviewSubs.size === 0 && !labelsActive) return;
9403
+ const issuedRender = store.getState().revisions.render;
9404
+ if (s.engine.appliedRevision() !== issuedRender) return;
9405
+ const asyncRead = scene.count <= ASYNC_POSITION_MAX_NODES ? s.engine.getPositionsAsync : void 0;
9406
+ const interval = asyncRead === void 0 || !labelsActive ? SIM_HOT_REFRESH_MS : ASYNC_POSITION_REFRESH_MS;
9407
+ if (positionFlight !== null || lastHotRefreshMs !== null && timeMs >= lastHotRefreshMs && timeMs - lastHotRefreshMs < interval) return;
9408
+ lastHotRefreshMs = timeMs;
9409
+ if (asyncRead === void 0) {
9410
+ const pos = s.engine.getPositions();
9411
+ if (pos !== null && pos.length === scene.count * 2) bankEnginePositions(pos);
9412
+ return;
9413
+ }
9414
+ const flight = {};
9415
+ positionFlight = flight;
9416
+ const issuedScene = scene;
9417
+ const issuedPins = store.getState().pins;
9418
+ const issuedGeneration = positionGeneration;
9419
+ let read;
9420
+ try {
9421
+ read = asyncRead.call(s.engine);
9422
+ } catch {
9423
+ positionFlight = null;
9424
+ return;
9425
+ }
9426
+ void read.then((pos) => {
9427
+ if (destroyed || session !== s || !s.alive || store.getState().status !== "ready" || scene !== issuedScene || store.getState().revisions.render !== issuedRender || s.engine.appliedRevision() !== issuedRender || store.getState().pins !== issuedPins || positionGeneration !== issuedGeneration || overviewSubs.size === 0 && !labelsEnabled() || pos === null || pos.length !== issuedScene.count * 2) return;
9428
+ bankEnginePositions(pos);
9429
+ projectPlacements(s.engine);
9430
+ notifyLabelSubs(positionSubs);
9431
+ }).catch(() => {
9432
+ }).finally(() => {
9433
+ if (positionFlight === flight) positionFlight = null;
9434
+ });
9435
+ }
9340
9436
  function bankEnginePositions(pos) {
9437
+ positionGeneration += 1;
9341
9438
  const pins = store.getState().pins;
9342
9439
  if (pins.size > 0 && scene !== null) {
9343
9440
  for (const [id, xy] of pins) {
@@ -9350,6 +9447,7 @@ function createGraphInstance(opts) {
9350
9447
  }
9351
9448
  reconciler.noteEnginePositions(pos);
9352
9449
  labelPositionCache = pos;
9450
+ scheduleOverviewNotification();
9353
9451
  }
9354
9452
  function pushSelectionToEngine(eng, ids) {
9355
9453
  const groupIds = store.getState().selection.groupIds;
@@ -10207,7 +10305,7 @@ function createGraphInstance(opts) {
10207
10305
  const groupsResolutionChanged = refreshGroupsResolution();
10208
10306
  const result = reconcileScene(scopedAccepted ?? p.merged);
10209
10307
  const ingestScene = scene;
10210
- labelPositionCache = null;
10308
+ invalidatePositionCache();
10211
10309
  const structuralChange = result.structuralChange;
10212
10310
  const positionChange = result.positionChange;
10213
10311
  dataDiags = p.merged.diagnostics;
@@ -11226,7 +11324,7 @@ function createGraphInstance(opts) {
11226
11324
  }
11227
11325
  scopedAccepted = computeScopedAccepted();
11228
11326
  const result = reconcileScene(scopedAccepted ?? accepted);
11229
- labelPositionCache = null;
11327
+ invalidatePositionCache();
11230
11328
  adjacency = null;
11231
11329
  sceneIncidence = null;
11232
11330
  hardScopeGen += 1;
@@ -11881,7 +11979,7 @@ function createGraphInstance(opts) {
11881
11979
  }
11882
11980
  if (dataChanged || scopeChanged) scopedAccepted = computeScopedAccepted();
11883
11981
  const result = reconcileScene(scopedAccepted ?? accepted);
11884
- labelPositionCache = null;
11982
+ invalidatePositionCache();
11885
11983
  adjacency = null;
11886
11984
  sceneIncidence = null;
11887
11985
  structuralChange = result.structuralChange;
@@ -11895,7 +11993,7 @@ function createGraphInstance(opts) {
11895
11993
  if (!dataChanged && !scopeChanged && !groupsSceneDirty && !parallelSceneDirty && accepted !== null) {
11896
11994
  bankReadyEnginePositions();
11897
11995
  const result = reconcileScene(scopedAccepted ?? accepted);
11898
- labelPositionCache = null;
11996
+ invalidatePositionCache();
11899
11997
  adjacency = null;
11900
11998
  sceneIncidence = null;
11901
11999
  structuralChange = structuralChange || result.structuralChange;
@@ -12575,6 +12673,14 @@ function createGraphInstance(opts) {
12575
12673
  if (node === void 0) return;
12576
12674
  const prevented = emit("nodeDragEnd", { node, x, y });
12577
12675
  if (!prevented) writePin(node.id, [x, y]);
12676
+ else if (overviewSubs.size > 0 || labelsEnabled()) {
12677
+ const pos = s.engine.getPositions();
12678
+ if (pos !== null) {
12679
+ pos[2 * index] = x;
12680
+ pos[2 * index + 1] = y;
12681
+ bankEnginePositions(pos);
12682
+ }
12683
+ }
12578
12684
  },
12579
12685
  // Right-click or long-press → typed 'contextMenu' event. The
12580
12686
  // core adds NO built-in follow-up — components own the menu.
@@ -12591,10 +12697,8 @@ function createGraphInstance(opts) {
12591
12697
  },
12592
12698
  /**
12593
12699
  * Overlay scheduler tick (adapter activity clock). Per tick:
12594
- * (1) sim-hot degradation — while the simulation runs, ONE getPositions
12595
- * readback refreshes the CPU cache at a capped >=500ms cadence (M0:
12596
- * tracked readback stalls ~18ms, so the lane NEVER reads back per
12597
- * frame); (2) O(k) projection of the CURRENT candidate set through
12700
+ * (1) the shared position cache samples at most 10 Hz asynchronously
12701
+ * (2 Hz synchronous fallback), with one copy in flight; (2) O(k) projection of the CURRENT candidate set through
12598
12702
  * spaceToScreen for the positions channel. No re-rank ever happens here.
12599
12703
  */
12600
12704
  onFrame(timeMs) {
@@ -12633,13 +12737,8 @@ function createGraphInstance(opts) {
12633
12737
  }
12634
12738
  pressureSampler.resetCounters();
12635
12739
  }
12636
- if (store.getState().simulationRunning && labelsEnabled()) {
12637
- if (lastHotRefreshMs === null || timeMs - lastHotRefreshMs >= SIM_HOT_REFRESH_MS || timeMs < lastHotRefreshMs) {
12638
- lastHotRefreshMs = timeMs;
12639
- const pos = s.engine.getPositions();
12640
- if (pos !== null) bankEnginePositions(pos);
12641
- }
12642
- }
12740
+ positionClockMs = timeMs;
12741
+ if (store.getState().simulationRunning) sampleOverlayPositions(timeMs);
12643
12742
  if (positionSubs.size > 0 && currentPlacements.length > 0) {
12644
12743
  projectPlacements(s.engine);
12645
12744
  notifyLabelSubs(positionSubs);
@@ -12713,6 +12812,9 @@ function createGraphInstance(opts) {
12713
12812
  if (!active()) return;
12714
12813
  const status = store.getState().status;
12715
12814
  if (ev.type === "lost") {
12815
+ positionGeneration += 1;
12816
+ positionFlight = null;
12817
+ lastHotRefreshMs = null;
12716
12818
  if (status !== "ready") return;
12717
12819
  engineDiags = [
12718
12820
  ...engineDiags,
@@ -12770,6 +12872,7 @@ function createGraphInstance(opts) {
12770
12872
  const replayModel = renderModel();
12771
12873
  if (replayModel !== null) {
12772
12874
  reconcileScene(replayModel);
12875
+ invalidatePositionCache();
12773
12876
  const replayScene = scene;
12774
12877
  const phaseProjectStart = performance.now();
12775
12878
  const commit = {
@@ -12868,6 +12971,9 @@ function createGraphInstance(opts) {
12868
12971
  };
12869
12972
  session = s;
12870
12973
  const ownsMount = () => s.alive && !destroyed && session === s;
12974
+ positionGeneration += 1;
12975
+ positionFlight = null;
12976
+ positionClockMs = 0;
12871
12977
  lastHotRefreshMs = null;
12872
12978
  publish({ status: "mounting" });
12873
12979
  mountPromise = s.engine.mount(container, createHostEvents(s)).then(() => {
@@ -12998,6 +13104,13 @@ function createGraphInstance(opts) {
12998
13104
  cancelRerankTimer();
12999
13105
  candidateSubs.clear();
13000
13106
  positionSubs.clear();
13107
+ overviewSubs.clear();
13108
+ overviewSnapshot = null;
13109
+ notifiedOverviewSnapshot = null;
13110
+ overviewScene = null;
13111
+ labelPositionCache = null;
13112
+ positionGeneration += 1;
13113
+ positionFlight = null;
13001
13114
  listeners.clear();
13002
13115
  publish({ status: "destroyed" });
13003
13116
  }
@@ -13396,7 +13509,7 @@ function createGraphInstance(opts) {
13396
13509
  if (touched > 0) {
13397
13510
  reconciler.noteEnginePositions(next);
13398
13511
  scene = { ...scene, positions: next };
13399
- labelPositionCache = null;
13512
+ invalidatePositionCache();
13400
13513
  const prevState = store.getState();
13401
13514
  const nextRevisions = {
13402
13515
  ...prevState.revisions,
@@ -13982,7 +14095,17 @@ function createGraphInstance(opts) {
13982
14095
  if (destroyed) return;
13983
14096
  const eng = engineIfReady();
13984
14097
  if (eng === null) return;
14098
+ const wasRunning = store.getState().simulationRunning;
14099
+ cancelSettleFollow();
13985
14100
  eng.pause();
14101
+ if (wasRunning && layout === "force" && eng.appliedRevision() === store.getState().revisions.render && (overviewSubs.size > 0 || labelsEnabled())) {
14102
+ const pos = eng.getPositions();
14103
+ if (pos !== null) {
14104
+ bankEnginePositions(pos);
14105
+ projectPlacements(eng);
14106
+ notifyLabelSubs(positionSubs);
14107
+ }
14108
+ }
13986
14109
  if (store.getState().simulationRunning) publish({ simulationRunning: false });
13987
14110
  },
13988
14111
  resumeSimulation: () => {
@@ -14011,6 +14134,8 @@ function createGraphInstance(opts) {
14011
14134
  redo,
14012
14135
  getScaleInfo,
14013
14136
  getMetricValue,
14137
+ getOverviewScene,
14138
+ subscribeOverview,
14014
14139
  getRevisions: () => store.getState().revisions,
14015
14140
  getDiagnostics: () => store.getState().diagnostics,
14016
14141
  getNode,
@@ -14609,7 +14734,10 @@ var OverviewController = class {
14609
14734
  */
14610
14735
  rasterize() {
14611
14736
  const scene = this.getScene();
14612
- if (!scene || scene.count <= 0) return null;
14737
+ if (!scene || scene.count <= 0) {
14738
+ this.frame = null;
14739
+ return null;
14740
+ }
14613
14741
  const { positions, count } = scene;
14614
14742
  const pairs = Math.min(count, Math.floor(positions.length / 2));
14615
14743
  let minX = Infinity;
@@ -14625,7 +14753,10 @@ var OverviewController = class {
14625
14753
  if (y < minY) minY = y;
14626
14754
  if (y > maxY) maxY = y;
14627
14755
  }
14628
- if (!Number.isFinite(minX) || !Number.isFinite(minY)) return null;
14756
+ if (!Number.isFinite(minX) || !Number.isFinite(minY)) {
14757
+ this.frame = null;
14758
+ return null;
14759
+ }
14629
14760
  const size = this.size;
14630
14761
  const pad = size * PADDING_FRACTION;
14631
14762
  const inner = size - 2 * pad;
@@ -14744,6 +14875,6 @@ function evaluateFieldAccessor(accessor, id, attrs) {
14744
14875
  }
14745
14876
  }
14746
14877
 
14747
- export { ATLAS_MAX_CONCURRENT_DEFAULT, ATLAS_MAX_ENTRIES_DEFAULT, ATLAS_MAX_RETRIES_DEFAULT, AcceptanceQueue, BASE_PENDING_KEY, BRUSH_HISTORY_COALESCE_MS, CATEGORICAL_PALETTE, DEFAULT_BIN_COUNT, DIM_ALPHA_DEFAULT, DIVERGING_RANGE_DEFAULT, DomainStore, EDGE_PICK_TOLERANCE_PX, EdgePickingFacade, GRAPH_THEME_DARK, GRAPH_THEME_LIGHT, HISTORY_LIMIT_DEFAULT, HistoryKernel, INGEST_MAX_FLUSH_LATENCY_MS_DEFAULT, INGEST_MAX_PENDING_BYTES_DEFAULT, INGEST_OVERFLOW_FACTOR, ImageAtlasPipeline, InvestigationError, LABEL_MAX_VISIBLE_CAP, LABEL_MAX_VISIBLE_DEFAULT, LinkPickIndex, META_EDGE_MAX_WIDTH, MetricStore, OVERVIEW_HOT_INTERVAL_MS, OVERVIEW_IDLE_INTERVAL_MS, OVERVIEW_SIZE_DEFAULT, OrbitOperationError, OverviewController, PHYSICAL_DEFAULT_LINK_WIDTH, PHYSICAL_DEFAULT_POINT_SIZE, PendingExpansions, Reconciler, SEARCH_CACHE_LIMIT, SEARCH_LIMIT_DEFAULT, SEARCH_SCAN_CHUNK, SEARCH_SCORE_EXACT_ID, SEARCH_SCORE_ID_PREFIX, SEARCH_SCORE_SUBSTRING, SEARCH_SCORE_TOKEN_START_BONUS, SEQUENTIAL_RANGE_DEFAULT, SUPER_NODE_MAX_SIZE, SVG_MAX_ELEMENTS_DEFAULT, SoftMask, SvgBudgetError, TIMELINE_STEP_DEFAULT, TIMELINE_TICK_MS_DEFAULT, TypedColumnCrossfilter, VIEW_STATE_VERSION, admitServiceResult, assertCapabilityMethodParity, baseFromAccepted, baseFromContribution, buildAcceptedAdjacency, buildAcceptedFromColumnar, buildAdjacency, canonicalFilterKey, canonicalJson2 as canonicalJson, canonicalScaleKey, cascadeEdges, categoricalIndex, categoricalRows, coerceNumeric, coerceNumericInto, collapseParallelEdges, columnarArrayBuffers, compileEdgeFilter, compileNodeFilter, computeNumericDomain, createGraphInstance, createInvestigationSession, createLocalExpansionService, createLocalSearchService, createRequestContext, deriveGroupsByKey, descriptorKey, detachColumnarBuffers, divergingColor, escapeXml, estimateBatchBytes, evaluateFieldAccessor, evaluateFilterExpr, field, graphErrorToError, groupByDerivedId, groupSceneKey, interpolateColor, isColumnarSnapshot, isFatalGraphError, isFieldAccessor, materializeColumnarSnapshot, medianLinkWidthPx, mergeDiagnostics, mergeModel, metaEdgePublicId, metaEdgeSceneKey, metaEdgeWidthFor, neighborsOf, newContribution, newStagingTallies, nextRequestId, normalizeCommitForCapabilities, parseColor, parseInvestigation, pointSegmentDistanceSquared, projectColors, projectSizes, renderSvg, resolveEnginePolicy, resolveFilterField, resolveManualGroups, resolveScope, resolveTheme, resourceLimitFatal, rewriteGroups, sameDataRef, sameGroupBySpec, sameGroupSpecArrays, sceneGroupsOf, sceneLinkRefAt, scenePointRefAt, selectLabelCandidates, sequentialColor, sequentialSize, serializeInvestigation, serviceCacheKey, sessionCommitDiagnostics, stageBatch, superNodeSizeFor, validateColumnarStructure, validateFieldAccessor, validateFilterExpr, validateGroupBySpec, validateGroupSpecs, validateSnapshot, validateViewState };
14878
+ export { ATLAS_MAX_CONCURRENT_DEFAULT, ATLAS_MAX_ENTRIES_DEFAULT, ATLAS_MAX_RETRIES_DEFAULT, AcceptanceQueue, BASE_PENDING_KEY, BRUSH_HISTORY_COALESCE_MS, CATEGORICAL_PALETTE, DEFAULT_BIN_COUNT, DIM_ALPHA_DEFAULT, DIVERGING_RANGE_DEFAULT, DomainStore, EDGE_PICK_TOLERANCE_PX, EdgePickingFacade, GRAPH_THEME_DARK, GRAPH_THEME_LIGHT, HISTORY_LIMIT_DEFAULT, HistoryKernel, INGEST_MAX_FLUSH_LATENCY_MS_DEFAULT, INGEST_MAX_PENDING_BYTES_DEFAULT, INGEST_OVERFLOW_FACTOR, ImageAtlasPipeline, InvestigationError, LABEL_MAX_VISIBLE_CAP, LABEL_MAX_VISIBLE_DEFAULT, LinkPickIndex, META_EDGE_MAX_WIDTH, MetricStore, OVERVIEW_HOT_INTERVAL_MS, OVERVIEW_IDLE_INTERVAL_MS, OVERVIEW_SIZE_DEFAULT, OrbitOperationError, OverviewController, PHYSICAL_DEFAULT_LINK_WIDTH, PHYSICAL_DEFAULT_POINT_SIZE, PendingExpansions, Reconciler, SEARCH_CACHE_LIMIT, SEARCH_LIMIT_DEFAULT, SEARCH_SCAN_CHUNK, SEARCH_SCORE_EXACT_ID, SEARCH_SCORE_ID_PREFIX, SEARCH_SCORE_SUBSTRING, SEARCH_SCORE_TOKEN_START_BONUS, SEQUENTIAL_RANGE_DEFAULT, SUPER_NODE_MAX_SIZE, SVG_MAX_ELEMENTS_DEFAULT, SoftMask, SvgBudgetError, TIMELINE_STEP_DEFAULT, TIMELINE_TICK_MS_DEFAULT, TypedColumnCrossfilter, VIEW_STATE_VERSION, admitServiceResult, assertCapabilityMethodParity, baseFromAccepted, baseFromContribution, buildAcceptedAdjacency, buildAcceptedFromColumnar, buildAdjacency, canonicalFilterKey, canonicalJson2 as canonicalJson, canonicalScaleKey, cascadeEdges, categoricalIndex, categoricalRows, coerceNumeric, coerceNumericInto, collapseParallelEdges, columnarArrayBuffers, compileEdgeFilter, compileNodeFilter, computeNumericDomain, createGraphInstance, createInvestigationSession, createLocalExpansionService, createLocalSearchService, createRequestContext, deriveGroupsByKey, descriptorKey, detachColumnarBuffers, divergingColor, escapeXml, estimateBatchBytes, evaluateFieldAccessor, evaluateFilterExpr, field, graphErrorToError, groupByDerivedId, groupSceneKey, interpolateColor, isColumnarSnapshot, isFatalGraphError, isFieldAccessor, materializeColumnarSnapshot, medianLinkWidthPx, mergeDiagnostics, mergeModel, metaEdgePublicId, metaEdgeSceneKey, metaEdgeWidthFor, neighborsOf, newContribution, newStagingTallies, nextRequestId, nextSynthesizedEdgeId, normalizeCommitForCapabilities, parseColor, parseInvestigation, pointSegmentDistanceSquared, projectColors, projectSizes, renderSvg, resolveEnginePolicy, resolveFilterField, resolveManualGroups, resolveScope, resolveTheme, resourceLimitFatal, rewriteGroups, sameDataRef, sameGroupBySpec, sameGroupSpecArrays, sceneGroupsOf, sceneLinkRefAt, scenePointRefAt, selectLabelCandidates, sequentialColor, sequentialSize, serializeInvestigation, serviceCacheKey, sessionCommitDiagnostics, stageBatch, superNodeSizeFor, validateColumnarStructure, validateFieldAccessor, validateFilterExpr, validateGroupBySpec, validateGroupSpecs, validateSnapshot, validateViewState };
14748
14879
  //# sourceMappingURL=index.js.map
14749
14880
  //# sourceMappingURL=index.js.map