@kineviz/gl 0.4.3 → 0.4.5

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/index.d.mts CHANGED
@@ -6,7 +6,8 @@ import * as THREE$1 from 'three';
6
6
  import { Group, Camera, Object3D, WebGLRenderer } from 'three';
7
7
  import { OntologyRegistry, ResolvedOntology } from '@kineviz/ontology';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
- import React from 'react';
9
+ import * as React from 'react';
10
+ import React__default from 'react';
10
11
  import * as _kineviz_graph_algorithms from '@kineviz/graph-algorithms';
11
12
  import { AlgorithmContext, PageRankOptions, EigenvectorOptions, HITSOptions, BetweennessOptions, ClosenessOptions, CommonAlgorithmOptions, LabelPropagationOptions, LouvainOptions, KShortestPathsOptions, NodeScalarResult, HITSResult, NodeGroupResult, ShortestPathOptions, PathResult, KPathResult, AStarOptions, BFSTraversalOptions, DFSTraversalOptions } from '@kineviz/graph-algorithms';
12
13
  import { LLMAdapter } from '@kineviz/llm-types';
@@ -59,6 +60,8 @@ interface NodeRenderState {
59
60
  breathe: Float32Array;
60
61
  /** Halo intensity [0=off, >0=intensity], per-node */
61
62
  halo: Float32Array;
63
+ /** Built-in node fill suppression [0/1, ...], per-node. Set by createNodeShaderLayer({ hideBuiltinNode: true }). */
64
+ suppressFill: Float32Array;
62
65
  }
63
66
  /** Edge shape type */
64
67
  type EdgeShape = "straight" | "curve" | "radial";
@@ -79,6 +82,20 @@ interface EdgeRenderState {
79
82
  shapes: Float32Array;
80
83
  /** Flow particle enabled [0/1], per-edge */
81
84
  flow: Float32Array;
85
+ /**
86
+ * Global flow-particle speed multiplier (1.0 = shader base speed).
87
+ * Written by EdgeFlowEffect from `EdgeFlowConfig.speed`; read each frame by
88
+ * the edge renderer into the `flowSpeed` uniform. Global because the shader
89
+ * phase is driven by one `time` uniform — concurrent flows share it (last
90
+ * started wins). `undefined` = 1.0.
91
+ */
92
+ flowSpeed?: number;
93
+ /**
94
+ * Global flow-particle color [r,g,b] in 0-1. Written by EdgeFlowEffect from
95
+ * `EdgeFlowConfig.color`; same global/last-wins semantics as `flowSpeed`.
96
+ * `undefined` = shader default green [0.2, 1.0, 0.5].
97
+ */
98
+ flowColor?: [number, number, number];
82
99
  /** Glow stream enabled [0/1], per-edge */
83
100
  glow: Float32Array;
84
101
  /** Tube glow intensity [0=off, >0=intensity], per-edge */
@@ -116,6 +133,18 @@ interface LayoutPinSink {
116
133
  */
117
134
  applyGraphDelta?(delta: unknown): void | Promise<void>;
118
135
  }
136
+ /**
137
+ * Minimal store surface a PositionProvider uses to resolve node ids into
138
+ * the canonical index space (GraphStore order) and detect structural
139
+ * staleness. GraphStore satisfies this via a thin lambda wrapper (see
140
+ * GPULayoutProviderAdapter construction in GraphContext).
141
+ * Spec: notes/specs/2026-06-10-position-coherence.md (C1/C2).
142
+ */
143
+ interface StoreIndexBridge {
144
+ getNodeIndex(id: string): number | undefined;
145
+ getNodeCount(): number;
146
+ readonly structureEpoch: number;
147
+ }
119
148
  type PositionMode = "cpu" | "gpu";
120
149
  interface PositionProvider {
121
150
  /** Position mode */
@@ -147,10 +176,20 @@ interface PositionProvider {
147
176
  * without pin side effects" path for LayoutApi tween frames and
148
177
  * MapApi.applyGeoLayout. See pin redesign spec
149
178
  * `docs/superpowers/specs/2026-05-14-pin-redesign-legacy-semantics.md`.
179
+ *
180
+ * @deprecated use writePositions
150
181
  */
151
182
  updatePositions?(ids: string[]): void;
183
+ /**
184
+ * Write world positions for the given nodes. The provider updates every
185
+ * copy it owns (CPU mirror, layoutNodes, GPU FBO) and preserves pin
186
+ * state exactly. Ids unknown to the index are skipped.
187
+ * @returns the ids actually written.
188
+ * Spec: notes/specs/2026-06-10-position-coherence.md (C4).
189
+ */
190
+ writePositions?(positions: ReadonlyMap<string, readonly [number, number, number]>): string[];
152
191
  }
153
- type DirtyFlag = "structure" | "edgeStructure" | "nodeColors" | "nodeSizes" | "nodeOpacities" | "nodeIcons" | "nodeImages" | "nodeSelection" | "nodeHighlight" | "nodeHover" | "nodePinned" | "nodeHidden" | "nodeRingColors" | "nodeCollection" | "edgeColors" | "edgeWidths" | "edgeOpacities" | "edgeSelection" | "edgeHighlight" | "edgeDashed" | "edgeShapes" | "nodeRipple" | "nodeBreathe" | "edgeFlow" | "edgeGlow" | "edgeTubeGlow" | "nodeHalo" | "badges" | "tags" | "collect" | "groups";
192
+ type DirtyFlag = "structure" | "edgeStructure" | "nodeColors" | "nodeSizes" | "nodeOpacities" | "nodeIcons" | "nodeImages" | "nodeSelection" | "nodeHighlight" | "nodeHover" | "nodePinned" | "nodeHidden" | "nodeRingColors" | "nodeCollection" | "edgeColors" | "edgeWidths" | "edgeOpacities" | "edgeSelection" | "edgeHighlight" | "edgeDashed" | "edgeShapes" | "nodeRipple" | "nodeBreathe" | "edgeFlow" | "edgeGlow" | "edgeTubeGlow" | "nodeHalo" | "nodeSuppressFill" | "badges" | "tags" | "collect" | "groups";
154
193
  interface UpdateStrategy$1 {
155
194
  /** Mark a specific attribute as dirty */
156
195
  markDirty(flag: DirtyFlag): void;
@@ -1189,6 +1228,29 @@ type Unsubscribe$1 = () => void;
1189
1228
  */
1190
1229
  declare class EventBus {
1191
1230
  private handlers;
1231
+ /** Nesting depth of suspend() calls — emissions buffer while > 0. */
1232
+ private _suspendDepth;
1233
+ /** Emissions buffered while suspended, in emission order. */
1234
+ private _buffer;
1235
+ /** True while emissions are being buffered (inside `api.batch()`). */
1236
+ get suspended(): boolean;
1237
+ /**
1238
+ * Suspend synchronous delivery: subsequent `emit` calls are buffered in
1239
+ * order until a matching {@link resume}. Nestable — only the outermost
1240
+ * `resume` flushes. Used by {@link RenderEngineApi.batch}.
1241
+ */
1242
+ suspend(): void;
1243
+ /**
1244
+ * Undo one {@link suspend}. When the outermost suspension ends, buffered
1245
+ * emissions are flushed in order.
1246
+ *
1247
+ * @param options.dedupe - When true, only the **last** buffered emission
1248
+ * per event key is delivered (coalescing for "state changed"-style
1249
+ * events). Defaults to false: every buffered emission is delivered.
1250
+ */
1251
+ resume(options?: {
1252
+ dedupe?: boolean;
1253
+ }): void;
1192
1254
  /**
1193
1255
  * Subscribe to an event and receive typed payloads on every emission.
1194
1256
  *
@@ -1227,15 +1289,22 @@ declare class EventBus {
1227
1289
  * insertion order. Handler errors are caught and logged; they do not
1228
1290
  * prevent subsequent handlers from running.
1229
1291
  *
1292
+ * While {@link suspended} (inside `api.batch()`), the emission is buffered
1293
+ * and delivered on {@link resume} instead.
1294
+ *
1230
1295
  * @param event - The event key from {@link EventMap}.
1231
1296
  * @param payload - The typed payload object for this event.
1232
1297
  */
1233
1298
  emit<K extends keyof EventMap>(event: K, payload: EventMap[K]): void;
1299
+ /** Synchronous delivery shared by emit() and resume()'s flush. */
1300
+ private _dispatch;
1234
1301
  /**
1235
1302
  * Remove all registered handlers for all events.
1236
1303
  *
1237
1304
  * Called automatically during {@link RenderEngineApi.dispose}. After this
1238
1305
  * call, previously returned {@link Unsubscribe} functions become no-ops.
1306
+ * Any buffered (suspended) emissions are dropped and the suspension
1307
+ * counter resets, so a disposed bus cannot flush into dead handlers.
1239
1308
  */
1240
1309
  removeAllListeners(): void;
1241
1310
  }
@@ -1485,6 +1554,10 @@ declare class CollectionManager {
1485
1554
  declare class GraphStore {
1486
1555
  private _version;
1487
1556
  private _iconVersion;
1557
+ private _versionChangedSubs;
1558
+ private _iconVersionChangedSubs;
1559
+ private _versionNotifyPending;
1560
+ private _iconVersionNotifyPending;
1488
1561
  private _data;
1489
1562
  private _index;
1490
1563
  private _nodeState;
@@ -1492,6 +1565,16 @@ declare class GraphStore {
1492
1565
  private _nodeCapacity;
1493
1566
  private _edgeCapacity;
1494
1567
  private _positionProvider;
1568
+ /**
1569
+ * Monotonic counter bumped whenever the node SET changes (setData /
1570
+ * addNodes / deleteNodes) — i.e. whenever the canonical id→index space
1571
+ * is rebuilt. Position caches (PositionProvider mirrors) compare this
1572
+ * against their own synced epoch to detect staleness. Edge-only and
1573
+ * style/selection/position changes do not bump it.
1574
+ * See notes/specs/2026-06-10-position-coherence.md (C2).
1575
+ */
1576
+ private _structureEpoch;
1577
+ get structureEpoch(): number;
1495
1578
  private _updateStrategy;
1496
1579
  private _queries;
1497
1580
  private _visibilityFilter;
@@ -1525,7 +1608,7 @@ declare class GraphStore {
1525
1608
  * output becomes indistinguishable from user data, and the user will be
1526
1609
  * asked to confirm overwrite on re-run.
1527
1610
  */
1528
- _algorithmPropertyKeys: Set<string>;
1611
+ private _algorithmPropertyKeys;
1529
1612
  private _defaultNodeSize;
1530
1613
  private _globalNodeSizeScale;
1531
1614
  private _edgeArrowVisible;
@@ -1540,10 +1623,12 @@ declare class GraphStore {
1540
1623
  _onBeforeRebuild?: (() => void) | null;
1541
1624
  /**
1542
1625
  * Version at which the last RenderTransaction resolved icons/renderer/picker.
1543
- * Used by NodeCloud.tsx to skip redundant icon UV resolution when a
1544
- * transaction already handled it synchronously.
1626
+ * Used by the render loop to skip redundant icon UV resolution when a
1627
+ * transaction already handled it synchronously. Accessed via
1628
+ * {@link isResolvedByTransaction} / {@link markTransactionResolved} /
1629
+ * {@link invalidateTransactionVersion}.
1545
1630
  */
1546
- _lastTransactionVersion: number;
1631
+ private _lastTransactionVersion;
1547
1632
  constructor();
1548
1633
  /**
1549
1634
  * Attach an EventBus so GraphStore can emit typed events.
@@ -1559,6 +1644,22 @@ declare class GraphStore {
1559
1644
  */
1560
1645
  setLayoutRuntime(runtime: LayoutPinSink | null): void;
1561
1646
  get version(): number;
1647
+ /**
1648
+ * True when a RenderTransaction already resolved icons/renderer/picker
1649
+ * for the current store version, so the render loop can skip redundant
1650
+ * icon UV resolution.
1651
+ */
1652
+ isResolvedByTransaction(): boolean;
1653
+ /**
1654
+ * Record that the current store version has been resolved by a
1655
+ * RenderTransaction (icons/renderer/picker are up to date).
1656
+ */
1657
+ markTransactionResolved(): void;
1658
+ /**
1659
+ * Forget the last transaction-resolved version so the render loop
1660
+ * re-resolves icon UVs on the next frame.
1661
+ */
1662
+ invalidateTransactionVersion(): void;
1562
1663
  /** Icon-specific version. Only changes when icon names or graph structure change.
1563
1664
  * Use this as a React dependency instead of `version` to avoid re-resolving
1564
1665
  * icon UVs on every hover/selection/color change. */
@@ -1568,6 +1669,27 @@ declare class GraphStore {
1568
1669
  * Call after directly mutating edgeState/nodeState arrays.
1569
1670
  */
1570
1671
  notifyChange(): void;
1672
+ /**
1673
+ * Register a callback fired (microtask-coalesced) whenever `version`
1674
+ * changes. N synchronous bumps produce at most one notification per
1675
+ * microtask checkpoint. Subscriber exceptions are isolated.
1676
+ * @returns disposer that removes the callback.
1677
+ */
1678
+ subscribeVersionChanged(fn: () => void): () => void;
1679
+ /**
1680
+ * Register a callback fired (microtask-coalesced) whenever `iconVersion`
1681
+ * changes (icon names, node structure, or icon atlas — NOT hover,
1682
+ * selection, color, size). Same coalescing/isolation semantics as
1683
+ * `subscribeVersionChanged`.
1684
+ * @returns disposer that removes the callback.
1685
+ */
1686
+ subscribeIconVersionChanged(fn: () => void): () => void;
1687
+ /** Bump `_version` and schedule a coalesced subscriber notification. */
1688
+ private _bumpVersion;
1689
+ /** Bump `_iconVersion` and schedule a coalesced subscriber notification.
1690
+ * Bumps ONLY the icon channel — every call site pairs it with its own
1691
+ * `_bumpVersion()` exactly where the previous `_version++` lived. */
1692
+ private _bumpIconVersion;
1571
1693
  get data(): GraphData;
1572
1694
  get index(): IndexManager;
1573
1695
  get nodeState(): NodeRenderState | null;
@@ -1714,16 +1836,17 @@ declare class GraphStore {
1714
1836
  * `setAllPositions`, which pushes the entire CPU array (and historically
1715
1837
  * had a pin/unpin trick that risked clobbering pre-existing pin state),
1716
1838
  * this writes only the supplied ids and calls
1717
- * `provider.updatePositions(ids)` so the GPU upload trick — when the
1839
+ * `provider.writePositions(positions)` so the GPU upload — when the
1718
1840
  * provider needs one — is restricted to the same subset.
1719
1841
  *
1720
1842
  * Pin state of nodes outside the supplied ids is untouched. Pin state of
1721
1843
  * nodes within the supplied ids is also untouched (the provider's
1722
- * `updatePositions` snapshots and restores it).
1844
+ * `writePositions` snapshots and restores it).
1723
1845
  *
1724
1846
  * Bumps `version` once. Does not record an undo command — callers that
1725
- * need history use `LayoutApi.setPositions`. See pin redesign spec
1726
- * `docs/superpowers/specs/2026-05-14-pin-redesign-legacy-semantics.md`.
1847
+ * need history use `LayoutApi.setPositions`. See position-coherence spec
1848
+ * `notes/specs/2026-06-10-position-coherence.md` for the write-path contract
1849
+ * (including pin preservation).
1727
1850
  */
1728
1851
  setPositions(positions: Map<string, [number, number, number]>): void;
1729
1852
  /**
@@ -1740,19 +1863,30 @@ declare class GraphStore {
1740
1863
  */
1741
1864
  selectNodes(nodeIds: string[]): void;
1742
1865
  /** Callback for direct renderer notification when selection changes.
1743
- * Set by GPUNodeRenderer to force-set needsUpdate on the nodeSelected attribute. */
1744
- _onSelectionChanged: (() => void) | null;
1866
+ * Set by GPUNodeRenderer to force-set needsUpdate on the nodeSelected attribute.
1867
+ * Receives the changed node indices when known (see subscribeSelectionChanged). */
1868
+ _onSelectionChanged: ((changedNodeIndices?: number[]) => void) | null;
1745
1869
  /**
1746
1870
  * Subscribers fired alongside the legacy `_onSelectionChanged` single slot.
1747
1871
  * Use `subscribeSelectionChanged()` to register; the returned function
1748
1872
  * unsubscribes. Multiple consumers (renderer, bridges) coexist safely.
1749
1873
  */
1750
- _selectionChangedSubs: Set<() => void>;
1874
+ _selectionChangedSubs: Set<(changedNodeIndices?: number[]) => void>;
1751
1875
  /**
1752
1876
  * Register a callback fired whenever selection state changes.
1877
+ *
1878
+ * The callback receives an OPTIONAL `changedNodeIndices` payload:
1879
+ * - `number[]` — the node indices whose selection state may have changed
1880
+ * (a covering superset; may contain duplicates; empty when the mutation
1881
+ * touched no node slots, e.g. edge-only selection).
1882
+ * - `undefined` — change set unknown; treat as "anything may have changed".
1883
+ *
1884
+ * Existing subscribers that ignore the argument remain fully compatible.
1753
1885
  * @returns disposer that removes the callback.
1754
1886
  */
1755
- subscribeSelectionChanged(fn: () => void): () => void;
1887
+ subscribeSelectionChanged(fn: (changedNodeIndices?: number[]) => void): () => void;
1888
+ /** Fire the legacy single-slot callback and all registered subscribers. */
1889
+ private _notifySelectionChanged;
1756
1890
  /** @deprecated No longer used — node geometry rebuild on edge structure change
1757
1891
  * is now handled in GPUNodeRenderer.update() via the "edgeStructure" dirty flag.
1758
1892
  * Kept for API compatibility but never called. */
@@ -1821,6 +1955,13 @@ declare class GraphStore {
1821
1955
  isPinned(nodeIdOrIndex: string | number): boolean;
1822
1956
  /** List node ids currently pinned. */
1823
1957
  getPinnedNodeIds(): string[];
1958
+ /**
1959
+ * Suppress (or restore) the built-in node fill for the given node ids. A
1960
+ * suppressed node still lays out, picks, selects, and connects edges — only
1961
+ * its dot/ring/icon stops drawing, so a custom layer can own its look.
1962
+ * Backs createNodeShaderLayer({ hideBuiltinNode: true }).
1963
+ */
1964
+ setNodeFillSuppressed(ids: string[], on: boolean): void;
1824
1965
  /**
1825
1966
  * Get all currently hidden node IDs. Backed by `_nodeState.hidden[]`
1826
1967
  * (0 = visible, 1 = hidden).
@@ -1937,9 +2078,35 @@ declare class GraphStore {
1937
2078
  getGroupForNode(nodeId: string): GroupState | undefined;
1938
2079
  getGroupMembers(groupId: string): string[];
1939
2080
  listGroups(): GroupState[];
2081
+ /**
2082
+ * Live read-only view of all group states keyed by group id, or `null`
2083
+ * when no group storage has been allocated. Mutations go through
2084
+ * {@link getGroupManager} (or GroupsApi) — never write to this map.
2085
+ */
2086
+ get groups(): ReadonlyMap<string, GroupState> | null;
2087
+ /**
2088
+ * Look up a single group's live state by id, or `undefined` if no such
2089
+ * group exists.
2090
+ */
2091
+ getGroupById(groupId: string): GroupState | undefined;
2092
+ /**
2093
+ * Aggregated edges synthesized while groups are collapsed.
2094
+ * Returns an empty array when no group is collapsed.
2095
+ */
2096
+ getAggregatedEdges(): ReadonlyArray<AggregatedEdge>;
1940
2097
  getGroupManager(): GroupManager;
1941
2098
  private _collectionManager?;
1942
2099
  getCollectionManager(): CollectionManager;
2100
+ /**
2101
+ * True if `key` has been written by the algorithm system this session.
2102
+ * Used to distinguish algorithm output from user data when detecting
2103
+ * property collisions (session-only — not serialized).
2104
+ */
2105
+ hasAlgorithmProperty(key: string): boolean;
2106
+ /** Record that `key` was written by the algorithm system. */
2107
+ addAlgorithmProperty(key: string): void;
2108
+ /** Forget that `key` was written by the algorithm system (undo support). */
2109
+ removeAlgorithmProperty(key: string): void;
1943
2110
  hasBadgeData(): boolean;
1944
2111
  getNodeBadge(nodeId: string): BadgeSpec | null;
1945
2112
  setNodeBadge(nodeId: string, badge: BadgeSpec | null): void;
@@ -2090,6 +2257,15 @@ declare class GraphStore {
2090
2257
  /**
2091
2258
  * Position Providers - Abstractions for CPU and GPU position sources
2092
2259
  *
2260
+ * Coherence contract (notes/specs/2026-06-10-position-coherence.md):
2261
+ * - Canonical id→index mapping is GraphStore order, resolved via an
2262
+ * injected StoreIndexBridge; adapters keep no private id maps when a
2263
+ * bridge is present.
2264
+ * - The CPU mirror is a cache: epoch-checked against the store on every
2265
+ * read/write, GPU readback at most once per layout tick.
2266
+ * - All external mutation goes through writePositions()/updatePosition();
2267
+ * arrays returned by getPositions() are READ-ONLY for callers.
2268
+ *
2093
2269
  * Provides a unified interface for accessing node positions regardless
2094
2270
  * of whether they're stored on CPU (Float32Array) or GPU (FBO texture).
2095
2271
  */
@@ -2144,6 +2320,12 @@ declare class GPULayoutProviderAdapter implements PositionProvider {
2144
2320
  private layoutController;
2145
2321
  private _positions;
2146
2322
  private _nodeIdToIndex;
2323
+ /** Canonical id→index resolver injected from the store (spec C1/C2). */
2324
+ private _bridge;
2325
+ /** Store structureEpoch our CPU mirror was last synced against. */
2326
+ private _syncedEpoch;
2327
+ /** Mirror is stale relative to the GPU FBO (layout ticked since last readback). */
2328
+ private _mirrorStale;
2147
2329
  constructor(layoutController: {
2148
2330
  getPositionTexture(): THREE$1.Texture;
2149
2331
  getTextureSize(): number;
@@ -2171,11 +2353,26 @@ declare class GPULayoutProviderAdapter implements PositionProvider {
2171
2353
  }>): void;
2172
2354
  unpinNodes?(nodeIds: string[]): void;
2173
2355
  readBackPositions?(): void;
2356
+ }, opts?: {
2357
+ bridge?: StoreIndexBridge;
2174
2358
  });
2359
+ /** Resolve a node id to its canonical index (bridge first, fallback map). */
2360
+ private _indexOf;
2361
+ /** True when the store's node set changed since our last buffer sync. */
2362
+ private _epochStale;
2363
+ private _stampEpoch;
2175
2364
  /**
2176
2365
  * Initialize CPU position array from layout nodes
2177
2366
  */
2178
2367
  private _initPositionArray;
2368
+ /**
2369
+ * True while the store's node set changed but `graph.layoutNodes` has not
2370
+ * been rebuilt to match yet (spec C2 transition window). During the window
2371
+ * layoutNodes is OLD-space and the mirror may already hold NEW-space
2372
+ * writes, so neither side may overwrite the other; `onStructureResynced()`
2373
+ * closes the window.
2374
+ */
2375
+ private _inTransitionWindow;
2179
2376
  /**
2180
2377
  * Sync positions from layout nodes to CPU array
2181
2378
  * Called when layout updates positions
@@ -2185,8 +2382,32 @@ declare class GPULayoutProviderAdapter implements PositionProvider {
2185
2382
  getTextureSize(): number;
2186
2383
  getSpaceSize(): number;
2187
2384
  /**
2188
- * Get CPU positions array for drag support
2189
- * Syncs from layout nodes on first call or when stale
2385
+ * Mark the CPU mirror stale. Called by the host render loop whenever the
2386
+ * layout simulation produced new positions (where it already observes
2387
+ * `graph.renderNeedsUpdate`). `getPositions()` also treats a raised
2388
+ * `renderNeedsUpdate` flag as stale, so wiring this is an optimization,
2389
+ * not a correctness requirement. Spec C3.
2390
+ */
2391
+ invalidateMirror(): void;
2392
+ /**
2393
+ * Called by the host after it rebuilt `graph.layoutNodes` to match the
2394
+ * store (post add/delete). Re-inits the mirror from the fresh layoutNodes
2395
+ * and stamps the current structure epoch. Spec C2 transition rule.
2396
+ */
2397
+ onStructureResynced(): void;
2398
+ /**
2399
+ * Get CPU positions array for drag support.
2400
+ *
2401
+ * Dedup (spec C3): at most one GPU→CPU readback per layout tick. The
2402
+ * readback is skipped when neither the explicit `_mirrorStale` flag nor
2403
+ * the conservative `graph.renderNeedsUpdate` fallback is raised. After
2404
+ * reading back, `_mirrorStale` is cleared so subsequent callers within
2405
+ * the same tick (picker, drag handler, store snapshot) reuse the cached
2406
+ * mirror instead of stalling the GPU pipeline again.
2407
+ *
2408
+ * IMPORTANT: this method intentionally does NOT clear `renderNeedsUpdate`.
2409
+ * That flag belongs to the render scheduler (`clearNeedsUpdate()`);
2410
+ * clearing it from a read path would suppress renders.
2190
2411
  */
2191
2412
  getPositions(): Float32Array | null;
2192
2413
  /**
@@ -2209,6 +2430,39 @@ declare class GPULayoutProviderAdapter implements PositionProvider {
2209
2430
  markNeedsUpdate(): void;
2210
2431
  get needsUpdate(): boolean;
2211
2432
  clearNeedsUpdate(): void;
2433
+ /**
2434
+ * Internal: upload a subset of node positions to the GPU FBO via the
2435
+ * pin/unpin trick. Reads positions from the CPU mirror (`_positions`).
2436
+ * Pre-existing pins within the subset are preserved.
2437
+ *
2438
+ * Includes the spec-C2 transition guard: if the bridge reports a node
2439
+ * count mismatch with layoutNodes (GraphContext structure rebuild in
2440
+ * flight), this becomes a mirror-only write.
2441
+ */
2442
+ private _uploadSubset;
2443
+ /**
2444
+ * Push positions for the given subset of node ids from the CPU mirror to
2445
+ * the GPU FBO without touching pin state outside the subset.
2446
+ *
2447
+ * Uploads via `controller.pinNodes(subset)` then unpins those in the
2448
+ * subset that weren't already pinned, leaving:
2449
+ * - subset's pre-existing pins intact
2450
+ * - non-subset's pin state untouched (only the subset participates in
2451
+ * the upload trick)
2452
+ *
2453
+ * Used by `GraphStore.setPositions` for clean partial-buffer GPU sync.
2454
+ *
2455
+ * @deprecated use writePositions
2456
+ */
2457
+ updatePositions(ids: string[]): void;
2458
+ /**
2459
+ * Write world positions for the given nodes. Updates CPU mirror,
2460
+ * layoutNodes, and GPU FBO, preserving pre-existing pin state exactly.
2461
+ * Ids unknown to the index are skipped.
2462
+ * @returns the ids actually written.
2463
+ * Spec: notes/specs/2026-06-10-position-coherence.md (C4).
2464
+ */
2465
+ writePositions(positions: ReadonlyMap<string, readonly [number, number, number]>): string[];
2212
2466
  /**
2213
2467
  * Bulk-upload all node positions to the GPU FBO.
2214
2468
  *
@@ -2230,19 +2484,6 @@ declare class GPULayoutProviderAdapter implements PositionProvider {
2230
2484
  * FBO while clearing fx/fy/fz and the pinnedTexture mask so the force
2231
2485
  * shader resumes driving those nodes.
2232
2486
  */
2233
- /**
2234
- * Push positions for the given subset of node ids from the CPU mirror to
2235
- * the GPU FBO without touching pin state outside the subset.
2236
- *
2237
- * Uploads via `controller.pinNodes(subset)` then unpins those in the
2238
- * subset that weren't already pinned, leaving:
2239
- * - subset's pre-existing pins intact
2240
- * - non-subset's pin state untouched (only the subset participates in
2241
- * the upload trick)
2242
- *
2243
- * Used by `GraphStore.setPositions` for clean partial-buffer GPU sync.
2244
- */
2245
- updatePositions(ids: string[]): void;
2246
2487
  setAllPositions(positions: Float32Array | number[], opts?: {
2247
2488
  pin?: boolean;
2248
2489
  }): void;
@@ -2286,6 +2527,7 @@ declare class CPUPositionProvider implements PositionProvider {
2286
2527
  private _positions;
2287
2528
  private _spaceSize;
2288
2529
  private _needsUpdate;
2530
+ private _indexBridge;
2289
2531
  constructor(nodeCount: number);
2290
2532
  getPositionTexture(): null;
2291
2533
  getTextureSize(): number;
@@ -2297,6 +2539,13 @@ declare class CPUPositionProvider implements PositionProvider {
2297
2539
  * Set position for a single node
2298
2540
  */
2299
2541
  setPosition(index: number, x: number, y: number, z: number): void;
2542
+ /**
2543
+ * Index-based single-node write — DragHandler hot path. Same contract as
2544
+ * the adapters' updatePosition (all copies updated; here there is only
2545
+ * the one array). All in-tree providers now implement updatePosition, so
2546
+ * DragHandler no longer needs a borrowed-array fallback.
2547
+ */
2548
+ updatePosition(index: number, x: number, y: number, z?: number): void;
2300
2549
  /**
2301
2550
  * Get position for a single node
2302
2551
  */
@@ -2333,6 +2582,15 @@ declare class CPUPositionProvider implements PositionProvider {
2333
2582
  * Set space size
2334
2583
  */
2335
2584
  setSpaceSize(size: number): void;
2585
+ setIndexBridge(bridge: StoreIndexBridge | null): void;
2586
+ /**
2587
+ * Write world positions for the given nodes by index. Sets needsUpdate so
2588
+ * the renderer re-uploads the full CPU array on the next frame.
2589
+ * Ids unknown to the bridge index are skipped.
2590
+ * @returns the ids actually written.
2591
+ * Spec: notes/specs/2026-06-10-position-coherence.md (C4).
2592
+ */
2593
+ writePositions(positions: ReadonlyMap<string, readonly [number, number, number]>): string[];
2336
2594
  }
2337
2595
  /**
2338
2596
  * @deprecated Parallel to v2 contract `LayoutRuntime.getReadback()`. Migration target:
@@ -2344,6 +2602,7 @@ declare class CPUPositionProvider implements PositionProvider {
2344
2602
  declare class CPULayoutProviderAdapter implements PositionProvider {
2345
2603
  readonly mode: PositionMode;
2346
2604
  private layoutController;
2605
+ private _indexBridge;
2347
2606
  constructor(layoutController: {
2348
2607
  sharedArray: Float32Array;
2349
2608
  getSpaceSize(): number;
@@ -2392,6 +2651,15 @@ declare class CPULayoutProviderAdapter implements PositionProvider {
2392
2651
  updatePositions(_ids: string[]): void;
2393
2652
  get needsUpdate(): boolean;
2394
2653
  clearNeedsUpdate(): void;
2654
+ setIndexBridge(bridge: StoreIndexBridge | null): void;
2655
+ /**
2656
+ * Write world positions for the given nodes. Mirrors into sharedArray and
2657
+ * graph.layoutNodes when present. Sets renderNeedsUpdate.
2658
+ * Ids unknown to the bridge index are skipped.
2659
+ * @returns the ids actually written.
2660
+ * Spec: notes/specs/2026-06-10-position-coherence.md (C4).
2661
+ */
2662
+ writePositions(positions: ReadonlyMap<string, readonly [number, number, number]>): string[];
2395
2663
  }
2396
2664
  /**
2397
2665
  * Static Position Provider
@@ -2402,6 +2670,7 @@ declare class StaticPositionProvider implements PositionProvider {
2402
2670
  private _positions;
2403
2671
  private _spaceSize;
2404
2672
  private _needsUpdate;
2673
+ private _indexBridge;
2405
2674
  constructor(positions: Float32Array | Array<{
2406
2675
  x: number;
2407
2676
  y: number;
@@ -2427,6 +2696,15 @@ declare class StaticPositionProvider implements PositionProvider {
2427
2696
  * keepIndices[newIdx] = oldIdx — maps new contiguous index to old index.
2428
2697
  */
2429
2698
  remapPositions(keepIndices: number[]): void;
2699
+ setIndexBridge(bridge: StoreIndexBridge | null): void;
2700
+ /**
2701
+ * Write world positions for the given nodes. Sets needsUpdate so the
2702
+ * renderer re-uploads the full CPU array on the next frame.
2703
+ * Ids unknown to the bridge index are skipped.
2704
+ * @returns the ids actually written.
2705
+ * Spec: notes/specs/2026-06-10-position-coherence.md (C4).
2706
+ */
2707
+ writePositions(positions: ReadonlyMap<string, readonly [number, number, number]>): string[];
2430
2708
  }
2431
2709
 
2432
2710
  /**
@@ -2565,6 +2843,7 @@ declare class GPUNodeRenderer {
2565
2843
  private _lastConsumedDirtyFlags;
2566
2844
  private lastNodeCapacity;
2567
2845
  private _unsubSelection;
2846
+ private _flagsSyncedVersion;
2568
2847
  hoverDimBits: Uint8Array;
2569
2848
  hoverDimStarts: Float32Array;
2570
2849
  constructor(scene: THREE$1.Object3D, store: GraphStore, config?: GPUNodeRendererConfig);
@@ -2614,7 +2893,16 @@ declare class GPUNodeRenderer {
2614
2893
  */
2615
2894
  private updateDirtyAttributes;
2616
2895
  /**
2617
- * Update position texture uniforms
2896
+ * Update position texture uniforms.
2897
+ *
2898
+ * CPU mode: the positions→texture copy (and GPU re-upload) is gated on
2899
+ * `provider.needsUpdate` — every in-tree CPU provider sets it on any
2900
+ * position mutation, and the render loop (RenderRuntime.update /
2901
+ * GraphContext render loop) clears it only AFTER all renderers have run in
2902
+ * the same frame, so the flag is always still set here when positions moved.
2903
+ * @param forceCopy bypass the gate — used when the provider was just
2904
+ * swapped or the node structure changed (texture content may be stale
2905
+ * even though the provider's own flag is clear).
2618
2906
  */
2619
2907
  private updatePositionUniforms;
2620
2908
  /**
@@ -4106,8 +4394,11 @@ declare class DragHandler {
4106
4394
  */
4107
4395
  private getNodeLocalPosition;
4108
4396
  /**
4109
- * Write LOCAL position directly to the positions array (no coordinate transform)
4110
- * For GPU providers with updatePosition, use that method to also update the layout controller
4397
+ * Write LOCAL position directly to the provider (no coordinate transform).
4398
+ * All in-tree providers implement updatePosition (CPUPositionProvider
4399
+ * gained it in Task 7 of the position-coherence refactor); custom or
4400
+ * out-of-tree providers without it fall back to the id-keyed
4401
+ * writePositions() contract so drag writes still land.
4111
4402
  */
4112
4403
  private writeLocalPosition;
4113
4404
  /**
@@ -4168,27 +4459,19 @@ interface KeepSet {
4168
4459
  }
4169
4460
  interface HoverEmphasisConfig {
4170
4461
  duration: number;
4171
- dimOpacity: number;
4172
4462
  /**
4173
- * Dim feature: on hover, fade out everything OUTSIDE the kept set (hovered
4174
- * node + 1-hop neighbors). Independent of {@link glowEnabled}. Default
4175
- * `false` — dim is opt-in. This is the flag the legacy `setHoverEnabled`
4176
- * maps to.
4463
+ * Opacity of dimmed elements while a PROGRAMMATIC dim (trace / dimExcept /
4464
+ * setExternalKeepSet) is active. [0, 1]. Hover itself never dims — the
4465
+ * hover-dim feature was deleted; click dim (EmphasisApi focusContext) and
4466
+ * trace are the only dim sources.
4177
4467
  */
4178
- dimEnabled: boolean;
4468
+ dimOpacity: number;
4179
4469
  /**
4180
4470
  * Glow/ring feature: on hover, draw a halo ring on the hovered node (edge
4181
- * tube glow on a hovered edge). Independent of {@link dimEnabled}. Default
4182
- * `true` — the hover ring shows by default. When dim is also on, the ring
4183
- * extends to the kept set (neighbors) the same way trace emphasis does.
4471
+ * tube glow on a hovered edge). Default `true` — the hover ring shows by
4472
+ * default and is scoped to the hovered target only.
4184
4473
  */
4185
4474
  glowEnabled?: boolean;
4186
- /**
4187
- * @deprecated Legacy single master switch that coupled dim+glow. Setting it
4188
- * now maps to {@link dimEnabled} (the glow ring is governed by
4189
- * {@link glowEnabled}). Kept so old callers / serialized config still parse.
4190
- */
4191
- enabled?: boolean;
4192
4475
  /** Edge tubeGlow strength applied to kept edges. Default 1.0. */
4193
4476
  glowStrength?: number;
4194
4477
  /** Node halo strength applied to kept nodes. Default 1.0. */
@@ -4236,25 +4519,17 @@ declare class HoverEmphasisController {
4236
4519
  private _suppressed;
4237
4520
  private _lastTickTs;
4238
4521
  private _externalKeep;
4239
- private _externalEnabledBefore;
4522
+ private _externalDimActive;
4240
4523
  constructor(deps: HoverEmphasisDeps);
4241
4524
  get state(): HoverEmphasisState;
4242
4525
  get progress(): number;
4243
- _computeKeepSet(target: HoverTarget$1 | null): KeepSet | null;
4244
4526
  /**
4245
- * Glow-only keep set: just the hovered target, no neighbors. Used when
4246
- * `dimEnabled` is false — the hover ring is drawn on the node/edge under
4247
- * the cursor and nothing else lights up or dims.
4527
+ * Hover keep set: just the hovered target, no neighbors. Hover never dims,
4528
+ * so the ring is drawn on the node/edge under the cursor and nothing else
4529
+ * lights up or fades.
4248
4530
  */
4249
4531
  _singletonKeepSet(target: HoverTarget$1 | null): KeepSet | null;
4250
- /**
4251
- * Pick the keep set for a hover target by feature mode. Dim on → the full
4252
- * 1-hop neighborhood (so neighbors stay bright); dim off (glow-only) → just
4253
- * the hovered target so the ring is scoped to that node/edge.
4254
- */
4255
- private _keepSetFor;
4256
- /** True when at least one hover feature (glow ring or dim) is active, i.e.
4257
- * hover events should be processed. */
4532
+ /** True when the glow ring is active, i.e. hover events should be processed. */
4258
4533
  private _wantsHover;
4259
4534
  /**
4260
4535
  * Diff writer: drives the GPU-side bit 16 (hoverDim) on nodes/edges.
@@ -4268,18 +4543,10 @@ declare class HoverEmphasisController {
4268
4543
  */
4269
4544
  _applyKeepSet(prev: KeepSet | null, next: KeepSet | null): void;
4270
4545
  setConfig(partial: Partial<HoverEmphasisConfig>): void;
4271
- /** Enable/disable the dim feature (fade everything outside the kept set).
4272
- * Independent of the glow ring. */
4273
- setDimEnabled(enabled: boolean): void;
4274
- /** @deprecated Legacy master switch. Maps to {@link setDimEnabled} — the
4275
- * hover ring is governed independently by `glowEnabled`. */
4276
- setEnabled(enabled: boolean): void;
4277
- /** Reconcile the Disabled state with the two feature flags: the controller
4278
- * is hard-disabled only when NEITHER glow nor dim wants to act. */
4546
+ /** Reconcile the Disabled state with the glow flag: the controller is
4547
+ * hard-disabled when the glow ring is off (hover never dims, so glow is
4548
+ * the only hover feature left). */
4279
4549
  private _reconcile;
4280
- /** @deprecated Returns whether the DIM feature is enabled (legacy name). */
4281
- isEnabled(): boolean;
4282
- isDimEnabled(): boolean;
4283
4550
  isGlowEnabled(): boolean;
4284
4551
  getConfig(): HoverEmphasisConfig;
4285
4552
  onHoverEnter(target: HoverTarget$1): void;
@@ -4298,16 +4565,10 @@ declare class HoverEmphasisController {
4298
4565
  */
4299
4566
  setExternalKeepSet(keepNodes: Iterable<string>, keepEdges: Iterable<string>): void;
4300
4567
  /** Cancel the programmatic dim. Per-instance un-dim ramps fire smoothly.
4301
- * Restores the pre-external `_config.dimEnabled` so a trace started with
4302
- * hover-dim disabled stays off — even if a click happens MID-ramp.
4303
- * We set `_config.dimEnabled` synchronously (rather than deferring to
4304
- * `_enterIdle`) because `onMouseDown` unregisters the ramp frame
4305
- * callback as part of Suppressed-state housekeeping; without an
4306
- * immediate flip, click→mouseup leaves the controller in Idle with
4307
- * `dimEnabled === true`, and the next hover re-triggers dim. The state
4308
- * machine still cycles through RampingDown→Idle to play the visual
4309
- * un-dim animation; `onHoverEnter`/`onHoverMove` scope the kept set by
4310
- * `dimEnabled` so the intermediate states draw the ring without dimming. */
4568
+ * `_externalDimActive` is dropped synchronously so a click that lands
4569
+ * MID-ramp (onMouseDown unregisters the ramp frame callback) can never
4570
+ * strand the controller with dim writes still armed — hover afterwards
4571
+ * draws only the ring, never a fade. */
4311
4572
  clearExternalKeepSet(): void;
4312
4573
  onMouseDown(button: number): void;
4313
4574
  onMouseUp(): void;
@@ -4322,14 +4583,18 @@ declare class HoverEmphasisController {
4322
4583
  /**
4323
4584
  * Hover Handler
4324
4585
  *
4325
- * Tracks mouse hover state over nodes and edges with debouncing.
4586
+ * Tracks mouse hover state over nodes and edges with rate-limited picking.
4326
4587
  * Integrates with GraphStore for hover visual feedback.
4327
4588
  */
4328
4589
 
4329
4590
  interface HoverHandlerConfig {
4330
- /** Debounce time in ms before triggering hover */
4591
+ /** Minimum interval in ms between hover-driven picks (leading+trailing throttle).
4592
+ * Defaults to HOVER_PICK_INTERVAL_MS (40 ms ≈ 25 Hz). */
4593
+ throttleMs?: number;
4594
+ /** @deprecated Use throttleMs. Kept as an alias for backward compatibility:
4595
+ * when provided (and throttleMs is not), it sets the throttle interval. */
4331
4596
  debounceMs?: number;
4332
- /** Delay before showing hover (after debounce) */
4597
+ /** Delay before showing hover (after throttle admits a pick) */
4333
4598
  delayMs?: number;
4334
4599
  /** Asymmetric hover-leave delay (ms). When the picker reports "background"
4335
4600
  * after a node/edge was hovered, wait this long before committing the
@@ -4345,7 +4610,8 @@ declare class HoverHandler {
4345
4610
  private config;
4346
4611
  private groupHitTest;
4347
4612
  private state;
4348
- private debounceTimer;
4613
+ private lastPickTime;
4614
+ private throttleTimer;
4349
4615
  private delayTimer;
4350
4616
  private leaveTimer;
4351
4617
  private pendingPosition;
@@ -4365,11 +4631,24 @@ declare class HoverHandler {
4365
4631
  get enabled(): boolean;
4366
4632
  set enabled(value: boolean);
4367
4633
  /**
4368
- * Handle mouse move - debounced hover detection
4634
+ * Handle mouse move — throttled hover detection (leading + trailing).
4635
+ *
4636
+ * Each hover pick is a GPU readback stall, so picks are capped at
4637
+ * config.throttleMs intervals:
4638
+ * - If enough time has passed since the last pick, pick immediately (leading).
4639
+ * - Otherwise, schedule exactly one trailing pick for when the interval
4640
+ * elapses; intermediate moves only refresh pendingPosition, so the
4641
+ * trailing pick always uses the LATEST coordinates.
4642
+ * The trailing pick guarantees hover state is never stale once the mouse
4643
+ * comes to rest.
4369
4644
  */
4370
4645
  onMouseMove(screenX: number, screenY: number): void;
4646
+ /** Apply the optional show-delay, then run the hover pick. */
4647
+ private runHoverCheck;
4371
4648
  /**
4372
- * Force immediate hover check (e.g., after click)
4649
+ * Force immediate hover check (e.g., after click).
4650
+ * Bypasses the throttle; counts as a pick for throttling purposes so the
4651
+ * next mousemove doesn't immediately pick again.
4373
4652
  */
4374
4653
  checkHoverImmediate(screenX: number, screenY: number): void;
4375
4654
  /**
@@ -4388,7 +4667,11 @@ declare class HoverHandler {
4388
4667
  onChange(handler: HoverChangeHandler): () => void;
4389
4668
  private emit;
4390
4669
  /**
4391
- * Update debounce configuration
4670
+ * Update the hover-pick throttle interval (ms).
4671
+ */
4672
+ setThrottleMs(ms: number): void;
4673
+ /**
4674
+ * @deprecated Use setThrottleMs. Alias kept for backward compatibility.
4392
4675
  */
4393
4676
  setDebounceMs(ms: number): void;
4394
4677
  /**
@@ -5231,6 +5514,8 @@ interface BufferTextSource {
5231
5514
  sizeResolver?: (index: number) => number;
5232
5515
  /** Return true if node at index is hidden. Default: false */
5233
5516
  hiddenResolver?: (index: number) => boolean;
5517
+ /** Return dim opacity for a node index (focusContext / click dim). Default: 1 */
5518
+ opacityResolver?: (index: number) => number;
5234
5519
  }
5235
5520
  /**
5236
5521
  * Text item to render
@@ -5352,6 +5637,23 @@ declare class TextCloud {
5352
5637
  clearAllHoverDim(): void;
5353
5638
  /** Forward hover-emphasis uniform writes (u_hoverProgress / u_hoverDimOpacity). */
5354
5639
  setHoverUniform(name: "u_hoverProgress" | "u_hoverDimOpacity", value: number): void;
5640
+ /**
5641
+ * Cull cache: skips frustum cull + distance sort + glyph re-layout when
5642
+ * neither the view nor the items changed since the last updateTexts().
5643
+ * All inputs consumed by updateTexts are covered: items via a per-field
5644
+ * value snapshot (writeTextItemSignature), everything else via the numeric
5645
+ * view signature built in _fillViewSignature().
5646
+ */
5647
+ private _cullCache;
5648
+ /** Reused buffer for the view signature (no per-frame allocation). */
5649
+ private _viewSigValues;
5650
+ /**
5651
+ * Collect every non-item input of updateTexts() into a flat numeric array:
5652
+ * scene/camera/projection matrices, renderer size & pixel ratio, the
5653
+ * store's global node size scale, label config and placement state.
5654
+ * Epsilon-compared by CullCache (1e-4) so idle-camera frames hit the cache.
5655
+ */
5656
+ private _fillViewSignature;
5355
5657
  updateTexts(items: TextItem[]): void;
5356
5658
  /**
5357
5659
  * Buffer-direct culling for large graphs (10K+ nodes).
@@ -5663,7 +5965,7 @@ type IconSpec = {
5663
5965
  name: string;
5664
5966
  } | {
5665
5967
  kind: "component";
5666
- render: React.FC<{
5968
+ render: React__default.FC<{
5667
5969
  size?: number;
5668
5970
  className?: string;
5669
5971
  }>;
@@ -7570,6 +7872,23 @@ interface SizeMappingOptions {
7570
7872
  maxSize?: number;
7571
7873
  /** Restrict to a specific category */
7572
7874
  category?: string;
7875
+ /**
7876
+ * How the raw property value is normalized before mapping into
7877
+ * `[minSize, maxSize]`. Default `"linear"`.
7878
+ *
7879
+ * - `"linear"` — value maps proportionally. On skewed / heavy-tailed data
7880
+ * (e.g. one node = 1, another = 10000) this crushes almost every node to
7881
+ * `minSize` and blows the single outlier up to `maxSize`.
7882
+ * - `"sqrt"` — maps by **area** (radius ∝ √value): a 100× value becomes a
7883
+ * 10× radius, not 100×. The perceptually-even choice for counts/weights.
7884
+ * - `"log"` — compresses wide / heavy-tailed ranges so mid-range values
7885
+ * still get a meaningful size (1 vs 10000 no longer collapses the middle).
7886
+ * Non-positive values are shifted into the positive domain first.
7887
+ *
7888
+ * The output is always clamped to `[minSize, maxSize]`, so no scale can make
7889
+ * a node larger than `maxSize`.
7890
+ */
7891
+ scale?: "linear" | "sqrt" | "log";
7573
7892
  }
7574
7893
  interface ImageMappingOptions {
7575
7894
  /** Restrict to a specific category */
@@ -7775,18 +8094,22 @@ declare class StyleApi {
7775
8094
  /**
7776
8095
  * Size nodes proportionally to the numeric value of a property.
7777
8096
  *
7778
- * The minimum observed value maps to `minSize` and the maximum to `maxSize`;
7779
- * values in between are linearly interpolated. All `SetNodeSize` commands
7780
- * are wrapped in a single labeled transaction — one undo step.
7781
- * Emits `"style:changed"`.
8097
+ * The minimum observed value maps to `minSize` and the maximum to `maxSize`.
8098
+ * Intermediate values are interpolated through the chosen `scale` curve
8099
+ * (`"linear"` by default; `"sqrt"` for area-even sizing, `"log"` for wide /
8100
+ * heavy-tailed ranges — see {@link SizeMappingOptions.scale}). The output is
8101
+ * always clamped to `[minSize, maxSize]`, so a single huge outlier can never
8102
+ * blow a node up past `maxSize`. All `SetNodeSize` commands are wrapped in a
8103
+ * single labeled transaction — one undo step. Emits `"style:changed"`.
7782
8104
  *
7783
8105
  * @param property - Name of the node property to use for size mapping.
7784
- * @param options - Output size range and optional category filter.
8106
+ * @param options - Output size range, normalization scale, optional category filter.
7785
8107
  * @returns Resolves once all nodes have been resized and the event emitted.
7786
8108
  *
7787
8109
  * @example
7788
8110
  * ```ts
7789
- * await api.style.sizeNodesByProperty("weight", { minSize: 5, maxSize: 40 });
8111
+ * // Heavy-tailed data (1 … 10000): log keeps the middle visible.
8112
+ * await api.style.sizeNodesByProperty("weight", { minSize: 5, maxSize: 40, scale: "log" });
7790
8113
  * ```
7791
8114
  */
7792
8115
  sizeNodesByProperty(property: string, options?: SizeMappingOptions): Promise<void>;
@@ -7808,7 +8131,7 @@ declare class StyleApi {
7808
8131
  * Assign or clear the icon for a single node.
7809
8132
  *
7810
8133
  * Pass `null` to remove the icon. Recorded in history as `"SetNodeIcon"`.
7811
- * Resets `store._lastTransactionVersion` to `-1` so the render loop
8134
+ * Invalidates the store's transaction version so the render loop
7812
8135
  * re-resolves icon UVs on the next frame.
7813
8136
  * Does not emit `"style:changed"`.
7814
8137
  *
@@ -7827,7 +8150,7 @@ declare class StyleApi {
7827
8150
  * Assign the same icon to all nodes belonging to the given category.
7828
8151
  *
7829
8152
  * All `SetNodeIcon` commands are wrapped in a single labeled transaction —
7830
- * one undo step. Resets `store._lastTransactionVersion` to `-1` to force
8153
+ * one undo step. Invalidates the store's transaction version to force
7831
8154
  * icon UV re-resolution on the next render frame.
7832
8155
  * Emits `"style:changed"`.
7833
8156
  *
@@ -8012,6 +8335,17 @@ declare class StyleApi {
8012
8335
  * ```
8013
8336
  */
8014
8337
  setCaptions(options: CaptionOptions): Promise<void>;
8338
+ /**
8339
+ * Mirror a setCaptions() request into the VisualMapper's per-category
8340
+ * `captionConfig` — the same surface the legend's Caption tab writes. This is
8341
+ * what actually makes captions render: TextLayer's caption build short-circuits
8342
+ * to the VisualMapper config whenever any category has config (e.g. after a
8343
+ * color-by-property), so feeding only a layer `property` prop would be ignored.
8344
+ *
8345
+ * With no `category`, applies to every node category currently in the graph.
8346
+ * With no `property`, clears the caption on the targeted categories.
8347
+ */
8348
+ private _applyCaptionsToVisualMapper;
8015
8349
  /**
8016
8350
  * Set the global scale factor applied to all caption text.
8017
8351
  *
@@ -10525,7 +10859,18 @@ declare class EmphasisApi {
10525
10859
  private effectManager;
10526
10860
  private hoverEmphasis;
10527
10861
  private nextId;
10528
- constructor(store: GraphStore, effectManager: EffectManager, hoverEmphasis?: HoverEmphasisController | null);
10862
+ private interaction;
10863
+ private _clickDimEnabled;
10864
+ private _clickDimUnsub;
10865
+ private _clickDimAnchor;
10866
+ constructor(store: GraphStore, effectManager: EffectManager, hoverEmphasis?: HoverEmphasisController | null, interaction?: InteractionManager | null);
10867
+ /**
10868
+ * Wire (or rewire) the {@link InteractionManager}. Called by
10869
+ * `RenderEngineApi.wireInteraction` once the React component mounts and the
10870
+ * real interaction manager exists. Re-installs the click-dim listener if the
10871
+ * feature is currently enabled.
10872
+ */
10873
+ wireInteraction(interaction: InteractionManager | null): void;
10529
10874
  /**
10530
10875
  * Start a path highlight effect that sequentially illuminates nodes and edges along a path.
10531
10876
  *
@@ -10599,33 +10944,41 @@ declare class EmphasisApi {
10599
10944
  */
10600
10945
  stopAll(type?: EmphasisType): void;
10601
10946
  /**
10602
- * Enable or disable the hover-DIM feature (fade everything outside the
10603
- * hovered node's 1-hop neighborhood).
10947
+ * Enable or disable **click-DIM**: the engine listens for clicks and runs a
10948
+ * focus-and-context dim so the clicked target stands out.
10949
+ *
10950
+ * - Click a **node** → keep that node + its 1-hop neighborhood (nodes AND
10951
+ * the connecting edges) bright; fade everything else.
10952
+ * - Click an **edge** → keep the edge's two endpoint nodes (and the edge)
10953
+ * bright; fade everything else — same focus treatment as a node.
10954
+ * - Click the **same target** again, or click the **background** → clear.
10604
10955
  *
10605
10956
  * **Independent of the hover ring.** The ring/halo is governed by
10606
10957
  * {@link setEmphasisGlowEnabled} (on by default); this switch only controls
10607
- * the dimming of non-neighbors. Default `false` — dim is opt-in.
10958
+ * the click-driven dim. Default `false` — opt-in.
10608
10959
  *
10609
- * When enabled, hovering a node dims all other nodes and edges except the
10610
- * hovered node, its 1-hop neighbors, and the connecting edges. When
10611
- * disabled, hovering still shows the ring (if glow is on) but fades nothing.
10960
+ * Dimming is applied with {@link focusContext} (direct opacity), which
10961
+ * renders reliably even when the force layout has settled and the render
10962
+ * loop is idle. Requires a wired {@link InteractionManager} (present once
10963
+ * the canvas is mounted); enabling before that is fine — the listener is
10964
+ * installed when interaction is wired.
10612
10965
  *
10613
10966
  * Not undoable. Not recorded in history.
10614
10967
  *
10615
- * @param enabled - `true` to enable hover dimming, `false` to disable.
10968
+ * @param enabled - `true` to enable click dimming, `false` to disable.
10616
10969
  */
10617
- setHoverDimEnabled(enabled: boolean): void;
10970
+ setClickDimEnabled(enabled: boolean): void;
10971
+ /** Returns whether click-dim is currently enabled. */
10972
+ isClickDimEnabled(): boolean;
10973
+ /** (Re)subscribe the click listener. Safe to call repeatedly. */
10974
+ private _installClickDim;
10975
+ private _uninstallClickDim;
10976
+ private _onClickDim;
10977
+ private _clearClickDim;
10618
10978
  /**
10619
- * @deprecated Legacy name for {@link setHoverDimEnabled} — historically this
10620
- * was the single master switch that coupled dim and glow. It now controls
10621
- * only the dim feature (the ring is governed by
10622
- * {@link setEmphasisGlowEnabled}). Prefer `setHoverDimEnabled`.
10623
- *
10624
- * @param enabled - `true` to enable hover dimming, `false` to disable.
10625
- */
10626
- setHoverEnabled(enabled: boolean): void;
10627
- /**
10628
- * Set the opacity of dimmed nodes and edges during hover emphasis.
10979
+ * Set the opacity of dimmed nodes and edges during a PROGRAMMATIC dim
10980
+ * (trace / {@link dimExcept} / {@link dimNeighborhood}). Hover itself never
10981
+ * dims — the hover-dim feature was deleted.
10629
10982
  *
10630
10983
  * Clamped to `[0, 1]`. Default `0.15` (i.e. dimmed elements render at 15%
10631
10984
  * of their normal opacity). A value of `0` makes non-kept elements fully
@@ -10654,11 +11007,10 @@ declare class EmphasisApi {
10654
11007
  * Enable or disable the hover RING (node halo + edge tube glow). Default
10655
11008
  * `true` — the ring shows on hover out of the box.
10656
11009
  *
10657
- * **Independent of the dim feature** ({@link setHoverDimEnabled}). In
10658
- * glow-only mode (dim off) the ring is drawn on the hovered node alone; when
10659
- * dim is also on, it extends to the kept set (1-hop neighbors), the same way
10660
- * trace emphasis lights up its whole keep set. Does not affect the dim
10661
- * opacity controlled by {@link setHoverDimOpacity}.
11010
+ * **Independent of the dim feature** ({@link setClickDimEnabled}). The ring
11011
+ * is drawn on the hovered node alone; hover never dims (the hover-dim
11012
+ * feature was deleted). Does not affect the dim opacity used by trace dim
11013
+ * ({@link setHoverDimOpacity}).
10662
11014
  *
10663
11015
  * Not undoable. Not recorded in history.
10664
11016
  *
@@ -10685,15 +11037,6 @@ declare class EmphasisApi {
10685
11037
  * default, values above `1` intensify.
10686
11038
  */
10687
11039
  setEmphasisHaloStrength(strength: number): void;
10688
- /**
10689
- * Returns whether the hover-DIM feature is enabled.
10690
- *
10691
- * @returns `true` if hover dimming will fire on hover-enter; `false`
10692
- * otherwise (the ring may still show — see {@link setEmphasisGlowEnabled}).
10693
- * Also returns `false` when no {@link HoverEmphasisController} is wired
10694
- * (the API was constructed without a controller).
10695
- */
10696
- isHoverEnabled(): boolean;
10697
11040
  /**
10698
11041
  * Programmatic dim. Apply an arbitrary keep set — every node / edge
10699
11042
  * outside it fades out via the same per-instance shader path that
@@ -12464,7 +12807,14 @@ declare class GroupsApi {
12464
12807
  * Dissolve a group: remove the group metadata while leaving its member
12465
12808
  * nodes in the graph.
12466
12809
  *
12467
- * Not undoable. Emits `"group:dissolved"`.
12810
+ * If the group is currently collapsed it is expanded first (restoring
12811
+ * member visibility, the anchor's visuals, and removing aggregated
12812
+ * virtual edges) — `GroupManager.dissolveGroup` only deletes metadata,
12813
+ * so dissolving a collapsed group directly would leave members
12814
+ * permanently hidden.
12815
+ *
12816
+ * Not undoable. Emits `"group:dissolved"` (and `"group:expanded"` first
12817
+ * when the group was collapsed).
12468
12818
  *
12469
12819
  * @param groupId - ID of the group to dissolve.
12470
12820
  */
@@ -12708,6 +13058,24 @@ interface SlippyMapGlobeConfig {
12708
13058
  minLevel?: number;
12709
13059
  maxLevel?: number;
12710
13060
  mercatorProjection?: boolean;
13061
+ /**
13062
+ * Anisotropic filtering level applied to every tile texture. Sharpens tiles
13063
+ * viewed at grazing angles (the globe's silhouette). Three.js clamps this to
13064
+ * the GPU's max, so passing a high value (e.g. 16) is safe. Default: 16.
13065
+ */
13066
+ anisotropy?: number;
13067
+ /**
13068
+ * Render a fresnel atmosphere shell around the globe (the soft rim glow).
13069
+ * Default: true.
13070
+ */
13071
+ atmosphere?: boolean;
13072
+ /** Atmosphere glow color. Default: 0x4d7fc4 (cool blue). */
13073
+ atmosphereColor?: number | string;
13074
+ /**
13075
+ * Atmosphere shell thickness as a fraction of the globe radius. The shell
13076
+ * sphere is rendered at radius * (1 + altitude). Default: 0.15.
13077
+ */
13078
+ atmosphereAltitude?: number;
12711
13079
  }
12712
13080
  declare class SlippyMapGlobe extends Group {
12713
13081
  private _radius;
@@ -12718,10 +13086,40 @@ declare class SlippyMapGlobe extends Group {
12718
13086
  private _isInView;
12719
13087
  private _camera?;
12720
13088
  private _innerBackLayer;
13089
+ private _anisotropy;
13090
+ private _atmosphere?;
13091
+ /**
13092
+ * Tiles whose texture has just loaded and are fading in (opacity 0→1). A new
13093
+ * finer-level tile cross-dissolves over the coarse tile beneath it instead of
13094
+ * hard-popping in, which removes the visible "tile switching" when zooming
13095
+ * the whole-globe view (where the entire hemisphere re-tiles at once).
13096
+ */
13097
+ private _fadingTiles;
13098
+ /** Request a re-render (so fades animate under on-demand rendering). */
13099
+ private _invalidate?;
12721
13100
  minLevel: number;
12722
13101
  maxLevel: number;
12723
13102
  thresholds: number[];
13103
+ /**
13104
+ * Degrees of arc per tile-geometry segment. Lower = finer tessellation, so
13105
+ * the per-vertex Mercator UV warp is sampled more densely and big (low-zoom)
13106
+ * tiles render coastlines at the correct latitude instead of a coarse
13107
+ * piecewise-linear approximation. 2° keeps even a 60°-tall level-2 tile
13108
+ * geodetically accurate.
13109
+ */
12724
13110
  curvatureResolution: number;
13111
+ /**
13112
+ * Bias added to the camera-distance-derived tile zoom level. Kept at 0:
13113
+ * sharpness now comes from the @2x retina tile provider (512px tiles), which
13114
+ * already gives level-N the texel density of level-(N+1) WITHOUT quadrupling
13115
+ * the tile count. A positive bias on top of retina was redundant — it loaded
13116
+ * one level finer than needed (4× more tiles, each 4× the pixels, each built
13117
+ * with a fresh SphereGeometry + Mercator UV warp on the main thread), which
13118
+ * is what caused the zoom-time loading stutter. Coastline *position* accuracy
13119
+ * (the geo-node alignment) is provided by `curvatureResolution`, not by this
13120
+ * bias, so it stays correct at 0.
13121
+ */
13122
+ lodBias: number;
12725
13123
  tileMargin: number;
12726
13124
  constructor(radius: number, config?: SlippyMapGlobeConfig);
12727
13125
  get tileUrl(): TileUrlFn | undefined;
@@ -12738,6 +13136,31 @@ declare class SlippyMapGlobe extends Group {
12738
13136
  get level(): number;
12739
13137
  set level(level: number);
12740
13138
  get radius(): number;
13139
+ /**
13140
+ * Provide a render-invalidation callback so freshly-loaded tiles can animate
13141
+ * their fade-in even when the scene is otherwise idle (on-demand rendering).
13142
+ */
13143
+ setInvalidate(fn: (() => void) | undefined): void;
13144
+ /**
13145
+ * Advance the opacity of any tiles currently fading in. Called once per frame
13146
+ * from updatePov. Self-schedules the next frame via `_invalidate` while any
13147
+ * fade is still in progress.
13148
+ */
13149
+ private _updateTileFades;
13150
+ /** Whether the atmosphere shell is currently present. */
13151
+ get hasAtmosphere(): boolean;
13152
+ /**
13153
+ * Toggle / restyle the atmosphere glow at runtime.
13154
+ * Pass `enabled: false` to remove it.
13155
+ */
13156
+ setAtmosphere(opts?: {
13157
+ enabled?: boolean;
13158
+ color?: number | string;
13159
+ altitude?: number;
13160
+ coefficient?: number;
13161
+ power?: number;
13162
+ }): void;
13163
+ private _buildAtmosphere;
12741
13164
  updatePov(camera?: Camera): void;
12742
13165
  clearTiles(): void;
12743
13166
  private _buildMetaLevel;
@@ -12804,6 +13227,19 @@ interface EnableMapOptions {
12804
13227
  /** Auto-fit view to all nodes on enable. Default: true. */
12805
13228
  autoFit?: boolean;
12806
13229
  }
13230
+ interface DisableMapOptions {
13231
+ /**
13232
+ * @internal — layer-swap confirmation token.
13233
+ *
13234
+ * When the outgoing auto map layer's unmount cleanup fires as part of a
13235
+ * 2D↔3D layer swap (FlatLayer↔GlobeLayer while the map stays active), it
13236
+ * carries the token returned by the {@link MapApi.beginLayerSwap} call that
13237
+ * armed the swap. `disableMap` suppresses its teardown only when this token
13238
+ * matches the pending one. Genuine "Hide Map" calls must NOT pass a token —
13239
+ * they always tear down.
13240
+ */
13241
+ swapToken?: number;
13242
+ }
12807
13243
  /**
12808
13244
  * How to resolve which node properties carry latitude / longitude.
12809
13245
  * - `'auto'`: search common names (`lat`, `latitude`, `lng`, `lon`, `long`,
@@ -13029,22 +13465,28 @@ declare class MapApi {
13029
13465
  private _autoFitDuration;
13030
13466
  private _autoFitDebounceMs;
13031
13467
  private _transitioning;
13032
- private _inLayerSwap;
13033
- private _layerSwapArmedAt;
13034
- private static readonly LAYER_SWAP_SUPPRESS_WINDOW_MS;
13035
- private _elevation;
13036
- private _appliedElevation;
13468
+ private _pendingSwapToken;
13469
+ private _nextSwapToken;
13037
13470
  /**
13038
- * Subsystem-owned bookkeeping: tracks the geo nodes Map ITSELF pinned
13039
- * via applyGeoLayout. Excludes nodes that were already pinned before
13040
- * applyGeoLayout ran (e.g. user pin, drag pin). Used by releaseGeoLayout
13041
- * / disableMap to only un-pin Map's own contributions, so leaving map
13042
- * mode does not clobber prior pin state.
13471
+ * Per-node map bookkeeping — the SINGLE source of truth for:
13472
+ *
13473
+ * - `elevation`: desired elevation offset above the map surface
13474
+ * (cleared on disableMap full teardown);
13475
+ * - `appliedElevation`: elevation already baked into the position buffer
13476
+ * (tracks what `_reapplyElevationFor` has written);
13477
+ * - `pinnedByMap`: subsystem-owned pin bookkeeping — true for the geo
13478
+ * nodes Map ITSELF pinned via applyGeoLayout. Excludes nodes that were
13479
+ * already pinned before applyGeoLayout ran (e.g. user pin, drag pin).
13480
+ * Used by releaseGeoLayout / disableMap to only un-pin Map's own
13481
+ * contributions, so leaving map mode does not clobber prior pin state.
13482
+ * See docs/superpowers/specs/2026-05-14-pin-redesign-legacy-semantics.md
13483
+ * for the "subsystem-owned bookkeeping" rationale.
13043
13484
  *
13044
- * See docs/superpowers/specs/2026-05-14-pin-redesign-legacy-semantics.md
13045
- * for the "subsystem-owned bookkeeping" rationale.
13485
+ * There is exactly ONE reset path: `_mapNodeState.clear()` — called from
13486
+ * disableMap's full teardown and the graph:dataReset handler, clearing all
13487
+ * three facets atomically.
13046
13488
  */
13047
- private _geoPinnedIds;
13489
+ private readonly _mapNodeState;
13048
13490
  /**
13049
13491
  * Coordinate provider. Initialized with scale=1 (raw earth meters) but
13050
13492
  * **rebuilt in {@link enableMap}** to use the active map's scale
@@ -13056,6 +13498,19 @@ declare class MapApi {
13056
13498
  */
13057
13499
  private _defaultCoordProvider;
13058
13500
  constructor(store: GraphStore, executor: CommandExecutor, events: EventBus);
13501
+ /** Get-or-create the bookkeeping record for a node. */
13502
+ private _nodeState;
13503
+ /** Drop a node's record once every facet is back to its default. */
13504
+ private _pruneNodeState;
13505
+ /** Ids with a desired elevation offset recorded. */
13506
+ private _idsWithElevation;
13507
+ /** Forget all baked-in elevation tracking (the offsets themselves stay). */
13508
+ private _clearAppliedElevation;
13509
+ /** Whether applyGeoLayout pinned at least one node that is still tracked. */
13510
+ private _hasMapPinnedNodes;
13511
+ private get _elevation();
13512
+ private get _appliedElevation();
13513
+ private get _geoPinnedIds();
13059
13514
  /**
13060
13515
  * Pre-register all built-in providers: 13 free (from FREE_PROVIDER_META)
13061
13516
  * and 3 Mapbox factory-based providers.
@@ -13149,28 +13604,39 @@ declare class MapApi {
13149
13604
  */
13150
13605
  enableMap(options?: EnableMapOptions): Promise<void>;
13151
13606
  /**
13152
- * Mark that the NEXT `disableMap()` is part of a 2D↔3D layer swap
13153
- * (FlatLayer↔GlobeLayer), not a real map-off, so that single call skips its
13154
- * teardown (and crucially its geo unpin). Call this immediately before
13155
- * swapping the auto map layer while the map stays active.
13607
+ * Arm a 2D↔3D layer swap (FlatLayer↔GlobeLayer): the `disableMap()` fired
13608
+ * by the OUTGOING layer's unmount cleanup is part of the swap, not a real
13609
+ * map-off, so it must skip its teardown (and crucially its geo unpin).
13610
+ * Call this immediately before swapping the auto map layer while the map
13611
+ * stays active, and thread the returned token into that one consuming
13612
+ * `disableMap({ swapToken })` call.
13613
+ *
13614
+ * Token confirmation makes the suppression self-limiting without any time
13615
+ * box: only a `disableMap` that carries the matching pending token is
13616
+ * suppressed (and consumes the token); `disableMap()` calls without a
13617
+ * token — every genuine user "Hide Map" — always tear down, so a pending
13618
+ * token that was armed but never consumed (layer updated in place rather
13619
+ * than unmount→remount) cannot linger to swallow one. The pending token is
13620
+ * also cleared by any `enableMap()` (the incoming layer's mount).
13156
13621
  *
13157
- * Self-limiting: the flag is consumed by the next `disableMap()`, cleared by
13158
- * any `enableMap()` (the incoming layer's mount), AND time-boxed — see
13159
- * `LAYER_SWAP_SUPPRESS_WINDOW_MS`. The time box guarantees a flag that was
13160
- * armed but never consumed (layer updated in place rather than
13161
- * unmount→remount) cannot linger to swallow a later genuine "Hide Map".
13622
+ * @returns the swap token to pass to the consuming `disableMap` call.
13162
13623
  *
13163
- * @internal — used by GraphContext's auto-map-layer effect.
13624
+ * @internal — used by GraphContext's auto-map-layer effect, threaded to
13625
+ * the layers via their `swapTokenRef` prop.
13164
13626
  */
13165
- beginLayerSwap(): void;
13627
+ beginLayerSwap(): number;
13166
13628
  /**
13167
13629
  * Disable map mode and restore the scene to its pre-map state.
13168
13630
  *
13169
13631
  * Phase 1: records state and emits event. Scene teardown is Phase 2/3.
13170
13632
  *
13171
13633
  * Emits `"map:disabled"`.
13634
+ *
13635
+ * @param options.swapToken `@internal` layer-swap confirmation token — see
13636
+ * {@link beginLayerSwap} and {@link DisableMapOptions}. Calls without a
13637
+ * token (the public "Hide Map" path) always perform the full teardown.
13172
13638
  */
13173
- disableMap(): void;
13639
+ disableMap(options?: DisableMapOptions): void;
13174
13640
  /**
13175
13641
  * Re-enable + reheat the live force layout so released nodes re-flow.
13176
13642
  *
@@ -13454,6 +13920,14 @@ declare class MapApi {
13454
13920
  * projected (e.g. beyond the sphere surface in spherical mode).
13455
13921
  */
13456
13922
  worldToLatLng(x: number, y: number, z: number, mode?: MapMode): GeoPosition | null;
13923
+ /**
13924
+ * Convert a true ground distance (km) at a given latitude into world/scene
13925
+ * units, matching how node positions are placed (Mercator meters × mapScale).
13926
+ * Web Mercator inflates ground distance by 1/cos(lat); we divide by cos(lat) so
13927
+ * a circle of this radius covers the correct ground area on the basemap.
13928
+ * With no map active, mapScale is the default-provider scale (1).
13929
+ */
13930
+ groundKmToWorld(km: number, latitudeDeg: number): number;
13457
13931
  /**
13458
13932
  * Convert lat/lng to screen pixel coordinates `{ x, y }` in the canvas.
13459
13933
  *
@@ -14113,6 +14587,404 @@ declare class HoverApi {
14113
14587
  get(): HoverTarget | null;
14114
14588
  }
14115
14589
 
14590
+ /**
14591
+ * Layer.ts — Engine Layer Standard contract for @kineviz/gl.
14592
+ *
14593
+ * A "Layer" is a pluggable rendering unit. It owns a {@link LayerRenderer}
14594
+ * (the imperative Three.js side) plus a thin React wrapper that mounts it as a
14595
+ * `<GraphCanvas>` child. Layers only ever touch the narrow {@link LayerContext}
14596
+ * surface below — never engine internals — so adding a feature is "add a layer",
14597
+ * not "edit engine core".
14598
+ *
14599
+ * See LAYER_STANDARD.md (this folder) for conventions and reference
14600
+ * implementations (GlobeLayer / FlatLayer / AxisLayer).
14601
+ */
14602
+
14603
+ /**
14604
+ * The narrow context surface handed to a layer. This is intentionally a strict
14605
+ * subset of the full GraphContext value: layers receive only what they need to
14606
+ * render, never the engine's mutable internals.
14607
+ */
14608
+ interface LayerContext {
14609
+ /** The group ALL layer objects must be added to (never `scene`). */
14610
+ cloudScene: THREE$1.Group;
14611
+ /** The (stationary) engine camera. Read-only for layers. */
14612
+ camera: THREE$1.PerspectiveCamera;
14613
+ /** Graph data + selection/visibility/position state. */
14614
+ store: GraphStore;
14615
+ /** Icon atlas manager. May be `null` early in mount — always guard. */
14616
+ iconAtlasManager: IconAtlasManager | null;
14617
+ /** Request a render. Call after any visual mutation. */
14618
+ invalidate: () => void;
14619
+ /** Whether map (inverse-zoom) mode is active. */
14620
+ isMapMode: boolean;
14621
+ /** Current globe radius in scene units. `0` = flat/planar (no sphere). */
14622
+ sphereRadius: number;
14623
+ /**
14624
+ * Compute a non-colliding `renderOrder` for one of the reserved bands.
14625
+ * See {@link renderOrderForSlot}.
14626
+ */
14627
+ renderOrder: (slot: "underlay" | "overlay" | "top", offset?: number) => number;
14628
+ /**
14629
+ * Current drawing-buffer size in device pixels. Needed by billboard layers
14630
+ * to size screen-space quads (mirrors the engine's `resolution` uniform).
14631
+ * Returns `{1,1}` before the renderer exists; read it each frame.
14632
+ */
14633
+ getDrawingBufferSize: () => {
14634
+ width: number;
14635
+ height: number;
14636
+ };
14637
+ /**
14638
+ * Current render opacity of an edge (`1` = full, `<1` = dimmed). Reflects
14639
+ * focus/context dimming (`emphasis.focusContext`), collapsed groups, etc.
14640
+ * A plug-in layer reads this each frame to follow the same dim state as the
14641
+ * core node/edge clouds — e.g. a marker travelling a dimmed edge fades with
14642
+ * it. Returns `1` for unknown edges.
14643
+ */
14644
+ getEdgeOpacity: (edgeId: string) => number;
14645
+ /**
14646
+ * Current render opacity of a node (`1` = full, `<1` = dimmed). Same dim
14647
+ * sources as {@link getEdgeOpacity}. Returns `1` for unknown nodes.
14648
+ */
14649
+ getNodeOpacity: (nodeId: string) => number;
14650
+ }
14651
+ /**
14652
+ * The imperative contract a layer's renderer must implement. `Config` is the
14653
+ * layer's domain-agnostic configuration object (no business params).
14654
+ */
14655
+ interface LayerRenderer<Config = unknown> {
14656
+ /** Create Three.js objects and add them to `ctx.cloudScene`. */
14657
+ mount(ctx: LayerContext): void;
14658
+ /**
14659
+ * Apply a new config. Called whenever the config identity changes.
14660
+ * `update` MUST be idempotent — it may be called more than once with an
14661
+ * equivalent config (e.g. the imperative `mountEngineLayer` path applies the
14662
+ * initial config right after `mount`, and a React effect may re-apply the
14663
+ * same config on first render), so it must not accumulate state or assume a
14664
+ * single invocation.
14665
+ */
14666
+ update?(config: Config): void;
14667
+ /**
14668
+ * Per-frame tick. `dt` is seconds since the previous frame.
14669
+ * Return `true` to request another frame (engine will `invalidate()`).
14670
+ */
14671
+ frame?(dt: number, ctx: LayerContext): boolean | void;
14672
+ /** Called synchronously when map mode toggles or the globe radius changes. */
14673
+ onMapMode?(enabled: boolean, sphereRadius: number): void;
14674
+ /** Remove objects and free all resources (geometry/material/textures). */
14675
+ dispose(): void;
14676
+ }
14677
+ /**
14678
+ * Reserved render-order bands. Indices `-1 / 0 / 1` are owned by the core
14679
+ * clouds (edges / arrows / nodes respectively) and are NEVER returned here.
14680
+ *
14681
+ * - `underlay` → `[-50, -10]` (behind the graph; e.g. map tiles, axis walls)
14682
+ * - `overlay` → `[2, 98]` (in front of the graph; e.g. badges, halos)
14683
+ * - `top` → `[100, +∞)` (always-on-top HUD/gizmo overlays)
14684
+ *
14685
+ * @param slot the band to target
14686
+ * @param offset intra-band offset (clamped per band; `top` is unbounded above)
14687
+ */
14688
+ declare function renderOrderForSlot(slot: "underlay" | "overlay" | "top", offset?: number): number;
14689
+
14690
+ /**
14691
+ * MarkerRenderer — a cloud of icon billboards that travel along graph edges
14692
+ * (e.g. a plane flying a route on the globe).
14693
+ *
14694
+ * Each {@link MarkerSpec} binds a marker to an edge id; every frame the marker's
14695
+ * phase advances `dt / durationMs` and its world position is interpolated along
14696
+ * the edge — great-circle `slerp` in globe mode (lifted slightly off the surface
14697
+ * so it "flies above" the tiles) or a straight `lerp` in flat mode. Markers are
14698
+ * screen-space billboards sized in device pixels, optionally rotated to face the
14699
+ * path tangent and tinted via an SDF icon atlas glyph.
14700
+ *
14701
+ * Rendering: NON-instanced. Each marker is 4 vertices (a quad); per-marker data
14702
+ * (center / size / color / rotation / iconUV) is written to all 4 of its vertices
14703
+ * as ordinary per-vertex attributes. The bundled three (r121) does not reliably
14704
+ * deliver per-instance attributes to a custom ShaderMaterial, so instancing is
14705
+ * avoided; with a few thousand markers max the per-vertex cost is negligible.
14706
+ */
14707
+
14708
+ /** Per-marker configuration. Domain-agnostic — no business params. */
14709
+ interface MarkerSpec {
14710
+ /** Edge whose endpoints the marker travels between. */
14711
+ edgeId: string;
14712
+ /**
14713
+ * Stable identity used to preserve animation phase when the markers array is
14714
+ * re-passed (adding/removing/restyling markers over time). Defaults to
14715
+ * `edgeId`. Give distinct keys if multiple markers share one edge.
14716
+ */
14717
+ key?: string;
14718
+ /** Icon name resolved via `iconAtlasManager.ensureIcon`; omitted → soft dot/triangle. */
14719
+ icon?: string;
14720
+ /** 0..1 rgb tint; default `[0.5, 0.8, 1.0]`. */
14721
+ color?: [number, number, number];
14722
+ /** Device-px diameter; default `24`. */
14723
+ size?: number;
14724
+ /** Time to traverse the edge once, ms; default `4000`. */
14725
+ durationMs?: number;
14726
+ /**
14727
+ * Initial phase 0..1 applied the FIRST time this marker (by `key`) appears —
14728
+ * lets planes start mid-route so a fleet doesn't all leave the origin at
14729
+ * once. Ignored on later updates (the live phase is preserved instead).
14730
+ */
14731
+ phaseOffset?: number;
14732
+ /** Rotate icon to the path tangent; default `false`. */
14733
+ orientToPath?: boolean;
14734
+ /** Radians added to the tangent angle (align the glyph); default `0`. */
14735
+ iconAngleOffset?: number;
14736
+ /**
14737
+ * No-icon head shape. `"dart"` (default) is the directional triangle;
14738
+ * `"comet"` is a radially symmetric glow head (white-hot core + tinted halo)
14739
+ * for meteor/threat-map styling — pair it with `trailLength`. Ignored when
14740
+ * `icon` is set.
14741
+ */
14742
+ shape?: "dart" | "comet";
14743
+ /**
14744
+ * Comet-trail length as a fraction of the full path (0..1); default `0`
14745
+ * (no trail). The trail is a tapered, fading ribbon sampled along the actual
14746
+ * path behind the head — on the globe it bends with the great-circle arc.
14747
+ * Trail width derives from `size`. At most 256 markers render trails per
14748
+ * layer (slots beyond that draw the head only).
14749
+ */
14750
+ trailLength?: number;
14751
+ }
14752
+ interface MarkerRendererConfig {
14753
+ markers: MarkerSpec[];
14754
+ }
14755
+ declare class MarkerRenderer implements LayerRenderer<MarkerRendererConfig> {
14756
+ private readonly maxMarkers;
14757
+ private ctx;
14758
+ private geometry;
14759
+ private material;
14760
+ private mesh;
14761
+ private markers;
14762
+ private positions;
14763
+ private aCenter;
14764
+ private aSize;
14765
+ private aColor;
14766
+ private aRotation;
14767
+ private aIconUV;
14768
+ private aOpacity;
14769
+ private aShape;
14770
+ private trailGeometry;
14771
+ private trailMaterial;
14772
+ private trailMesh;
14773
+ private tPos;
14774
+ private tTangent;
14775
+ private tSide;
14776
+ private tT;
14777
+ private tColor;
14778
+ private tWidth;
14779
+ private tOpacity;
14780
+ private readonly trailSamples;
14781
+ private readonly scratchSrc;
14782
+ private readonly scratchTgt;
14783
+ private readonly scratchA;
14784
+ private readonly scratchB;
14785
+ mount(ctx: LayerContext): void;
14786
+ update(config: MarkerRendererConfig): void;
14787
+ frame(dt: number, ctx: LayerContext): boolean;
14788
+ onMapMode(_enabled: boolean, _sphereRadius: number): void;
14789
+ dispose(): void;
14790
+ /** World-space point on the current marker's path at param `t` (scratchSrc/Tgt set by caller). */
14791
+ private pathPoint;
14792
+ }
14793
+
14794
+ /**
14795
+ * One scheduled traveler along an edge. Domain-neutral: a "flight" is any thing
14796
+ * that departs at `departT` and is in transit for `durFrac` of the loop.
14797
+ */
14798
+ interface FlightSpec {
14799
+ edgeId: string;
14800
+ /** Departure phase within the loop, 0..1. */
14801
+ departT: number;
14802
+ /** Fraction of the loop the traveler is in transit, 0..1. */
14803
+ durFrac: number;
14804
+ /** ms to traverse the edge once (drives MarkerRenderer phase advance). */
14805
+ durationMs?: number;
14806
+ icon?: string;
14807
+ shape?: 'dart' | 'comet';
14808
+ trailLength?: number;
14809
+ color?: [number, number, number];
14810
+ size?: number;
14811
+ orientToPath?: boolean;
14812
+ iconAngleOffset?: number;
14813
+ /** Stable identity; defaults to edgeId. */
14814
+ key?: string;
14815
+ }
14816
+ /**
14817
+ * Given all flights and the current loop phase T (0..1), return the MarkerSpecs
14818
+ * for flights currently in transit. phaseOffset places a flight already underway
14819
+ * mid-route so a fleet doesn't all leave the origin at once.
14820
+ */
14821
+ declare function computeAirborne(flights: FlightSpec[], T: number): MarkerSpec[];
14822
+
14823
+ type MarkerHandle = number;
14824
+ interface MarkersSnapshot {
14825
+ mode: 'idle' | 'static' | 'flights';
14826
+ staticMarkers: MarkerSpec[];
14827
+ flights: FlightSpec[];
14828
+ loopMs: number;
14829
+ handle: MarkerHandle;
14830
+ }
14831
+ /**
14832
+ * Data-driven markers that travel along edges (planes, packets, attack meteors).
14833
+ * Holds config only; the persistent MarkersBridge owns the per-frame clock and
14834
+ * drives the MarkerRenderer. Generic — no aviation semantics.
14835
+ */
14836
+ declare class MarkersApi {
14837
+ private snapshot;
14838
+ private listeners;
14839
+ private nextHandle;
14840
+ subscribe: (cb: () => void) => (() => void);
14841
+ getSnapshot: () => MarkersSnapshot;
14842
+ set(specs: MarkerSpec[]): void;
14843
+ flights(flights: FlightSpec[], opts?: {
14844
+ loopMs?: number;
14845
+ }): MarkerHandle;
14846
+ clear(): void;
14847
+ stop(handle: MarkerHandle): void;
14848
+ private emit;
14849
+ }
14850
+
14851
+ /**
14852
+ * Framework-agnostic host interface for mounting engine layers imperatively.
14853
+ * `useEngineLayer` builds one of these from its React hooks and delegates to
14854
+ * `mountEngineLayer`.
14855
+ */
14856
+ interface EngineLayerHost {
14857
+ cloudScene: THREE$1.Group;
14858
+ camera: THREE$1.PerspectiveCamera;
14859
+ /** Returns the live WebGLRenderer, or null before it is initialised. */
14860
+ getRenderer: () => THREE$1.WebGLRenderer | null;
14861
+ store: GraphStore;
14862
+ invalidate: () => void;
14863
+ registerMapModeCallback: (name: string, cb: ((enabled: boolean, sphereRadius?: number, damping?: number) => void) | null) => void;
14864
+ iconAtlasManager: IconAtlasManager | null;
14865
+ isMapMode: () => boolean;
14866
+ mapSphereRadius: () => number;
14867
+ }
14868
+
14869
+ /**
14870
+ * Generic runtime layer registry. Mount/update/unmount any LayerRenderer on a
14871
+ * live GraphCanvas with no JSX changes. The live engine handle is wired in by
14872
+ * <LayerHost> via _wireHost; mounts issued before wiring are queued and flushed.
14873
+ */
14874
+ declare class LayersApi {
14875
+ private hostRef;
14876
+ private mounted;
14877
+ private pending;
14878
+ mount<C>(name: string, factory: () => LayerRenderer<C>, config: C, opts?: {
14879
+ frame?: boolean;
14880
+ }): void;
14881
+ update<C>(name: string, config: C): void;
14882
+ unmount(name: string): void;
14883
+ has(name: string): boolean;
14884
+ list(): string[];
14885
+ /**
14886
+ * @internal Wired by <LayerHost> on mount; pass null on unmount to tear everything down.
14887
+ *
14888
+ * When called with a NEW non-null host (replacing a previous host), all currently-mounted
14889
+ * layers are disposed and discarded — they are NOT re-mounted under the new host (factories
14890
+ * are not retained past mount). Only mounts still in the `pending` queue (i.e. issued before
14891
+ * the first host was wired) are (re)hydrated under the new host. In the current single-
14892
+ * `<LayerHost>` topology a host is wired once and never replaced, so this path is not
14893
+ * exercised in production; callers needing layers to survive a host replacement must
14894
+ * re-mount them externally.
14895
+ */
14896
+ _wireHost(host: EngineLayerHost | null): void;
14897
+ }
14898
+
14899
+ /**
14900
+ * CoverageRenderer — flat, world-anchored coverage discs drawn in the
14901
+ * cloudScene XY plane (flat-map mode). Each item is a quad whose size is
14902
+ * determined by `radius` in world units; the vertex shader places the quad
14903
+ * centered on `aCenter` and sizes it by `aRadius`, producing a circle via
14904
+ * fragment-shader discard.
14905
+ *
14906
+ * Rendering: NON-instanced (same rationale as MarkerRenderer — r121 does not
14907
+ * reliably deliver per-instance attributes to a custom ShaderMaterial). Each
14908
+ * disc is 4 vertices; per-disc data is written to all 4 of its vertices as
14909
+ * ordinary per-vertex attributes.
14910
+ *
14911
+ * Globe mode is out of scope (Task 4 targets flat map; world-unit radii in 3D
14912
+ * require additional projection math handled at the api.coverage layer).
14913
+ */
14914
+
14915
+ /** Single coverage disc configuration. Domain-agnostic. */
14916
+ interface CoverageItem {
14917
+ /** Graph node id whose position the disc is anchored to. */
14918
+ anchorNodeId?: string;
14919
+ /** Explicit world-space position; used when anchorNodeId is absent. */
14920
+ position?: [number, number, number];
14921
+ /** Disc radius in WORLD units (km→world resolved upstream in api.coverage). */
14922
+ radius: number;
14923
+ /** RGB fill colour [0..1]. */
14924
+ fillColor: [number, number, number];
14925
+ /**
14926
+ * Interior fill opacity (0..1): the soft radial bloom inside the disc. Also
14927
+ * scales the radar pulse. Lower it to let the basemap show through. Does NOT
14928
+ * affect the boundary ring (see {@link ringOpacity}). Default 0.25.
14929
+ */
14930
+ fillOpacity?: number;
14931
+ /** Radial falloff exponent (signal weakens toward edge); default 2. */
14932
+ falloff?: number;
14933
+ /** Ring (boundary circle) colour; defaults to fillColor. */
14934
+ ringColor?: [number, number, number];
14935
+ /** Ring width as a fraction of the disc radius; default 0.04. */
14936
+ ringWidth?: number;
14937
+ /**
14938
+ * Boundary-ring opacity (0..1), independent of {@link fillOpacity} — so the
14939
+ * coverage boundary can stay crisp while the fill fades. Default 0.8.
14940
+ */
14941
+ ringOpacity?: number;
14942
+ /** Radar-ping animation; omit to disable. */
14943
+ pulse?: {
14944
+ speed?: number;
14945
+ rings?: number;
14946
+ };
14947
+ }
14948
+ interface CoverageConfig {
14949
+ items: CoverageItem[];
14950
+ }
14951
+
14952
+ /**
14953
+ * Extended coverage spec that allows specifying radius either in world units
14954
+ * (passthrough) or in km (resolved via the injected kmToWorld function).
14955
+ * Omits `radius` from CoverageItem so both radiusKm and radius can coexist.
14956
+ */
14957
+ interface CoverageSpec extends Omit<CoverageItem, "radius"> {
14958
+ /** Disc radius in world units (passthrough — skips km→world resolution). */
14959
+ radius?: number;
14960
+ /** True ground radius in km — resolved via kmToWorld(radiusKm, latitude). */
14961
+ radiusKm?: number;
14962
+ /** Latitude for Mercator correction when radiusKm is used; defaults to 0. */
14963
+ latitude?: number;
14964
+ }
14965
+ /**
14966
+ * Convenience sugar over `api.layers` for domain-agnostic coverage discs.
14967
+ * Maintains an items map keyed by nodeId, resolves radiusKm+latitude → world
14968
+ * radius, and drives the "coverage" layer in api.layers.
14969
+ */
14970
+ declare class CoverageApi {
14971
+ private layers;
14972
+ private kmToWorld;
14973
+ private items;
14974
+ constructor(layers: LayersApi, kmToWorld: (km: number, latDeg: number) => number);
14975
+ private resolve;
14976
+ /** Set (or replace) the coverage disc for a single node. */
14977
+ set(nodeId: string, spec: Omit<CoverageSpec, "anchorNodeId">): void;
14978
+ /** Set (or replace) coverage discs for multiple nodes in one call. */
14979
+ setMany(specs: CoverageSpec[]): void;
14980
+ /**
14981
+ * Remove coverage for a single node, or clear all coverage.
14982
+ * @param nodeId - When provided, removes only that node's disc. When omitted, clears all.
14983
+ */
14984
+ clear(nodeId?: string): void;
14985
+ private flush;
14986
+ }
14987
+
14116
14988
  /**
14117
14989
  * Construction options for {@link RenderEngineApi}.
14118
14990
  */
@@ -14125,10 +14997,11 @@ interface ApiOptions {
14125
14997
  /** Initial dimension at construction time. Pass 2 when the host starts in 2D mode so that
14126
14998
  * getDimensions() immediately agrees with the renderer. Defaults to 3 for backwards compat. */
14127
14999
  initialDimensions?: 2 | 3;
14128
- /** Optional: the hover-neighbor-highlight controller owned by RenderRuntime.
14129
- * When provided, exposes EmphasisApi.setHoverEnabled / setHoverDimOpacity /
14130
- * setHoverDuration / isHoverEnabled to the host. When omitted, those four
14131
- * methods no-op and `isHoverEnabled()` returns `false`. */
15000
+ /** Optional: the hover-ring controller owned by RenderRuntime. When
15001
+ * provided, exposes EmphasisApi.setHoverDimOpacity / setHoverDuration /
15002
+ * setEmphasisGlow* and the trace-dim methods to the host. When omitted,
15003
+ * those methods no-op. (Hover-dim was deleted — hover only draws the ring;
15004
+ * dim comes from click dim / trace.) */
14132
15005
  hoverEmphasis?: HoverEmphasisController | null;
14133
15006
  }
14134
15007
  /**
@@ -14218,6 +15091,12 @@ declare class RenderEngineApi$1 {
14218
15091
  readonly hover: HoverApi;
14219
15092
  /** Data-driven color and reveal overlay effects (heat diffusion, property color, cluster reveal). */
14220
15093
  readonly overlays: OverlaysApi;
15094
+ /** Data-driven markers that animate along edges (planes, packets, meteors). */
15095
+ readonly markers: MarkersApi;
15096
+ /** Generic runtime layer registry — mount/update/unmount any LayerRenderer imperatively. */
15097
+ readonly layers: LayersApi;
15098
+ /** Convenience sugar over api.layers for domain-agnostic coverage discs with km→world resolution. */
15099
+ readonly coverage: CoverageApi;
14221
15100
  /** Timeline-driven graph event playback effects. */
14222
15101
  readonly playback: PlaybackApi;
14223
15102
  /** Viewport chrome controls: minimap, theme, 2D/3D mode, and screenshot. */
@@ -14242,6 +15121,10 @@ declare class RenderEngineApi$1 {
14242
15121
  readonly debug: DebugApi;
14243
15122
  private executor;
14244
15123
  private effectManager;
15124
+ /** Filter manager owned by this API instance; disposed in dispose(). */
15125
+ private _filterManager;
15126
+ /** EventBus unsubscribe handles for the filter listeners (see constructor). */
15127
+ private _filterUnsubscribes;
14245
15128
  /** Current engine dimension (2 or 3). Initialized from ApiOptions.initialDimensions (defaults to 3).
14246
15129
  * Owned exclusively by setDimensions() after construction. */
14247
15130
  private _currentDimensions;
@@ -14266,14 +15149,28 @@ declare class RenderEngineApi$1 {
14266
15149
  */
14267
15150
  constructor(store: GraphStore, interaction: InteractionManager | null, options?: ApiOptions);
14268
15151
  /**
14269
- * §5.3. Batches a series of API calls. Phase 0: passthrough.
14270
- * Phase 1 will suspend eventBus emissions and renderer invalidation for
14271
- * the duration of fn, resuming on `.finally()` for async fns.
14272
- *
14273
- * The signature accepts sync or async fns so Phase 1 can upgrade the body
14274
- * without a breaking API change.
14275
- */
14276
- batch<T>(fn: () => T | Promise<T>): T | Promise<T>;
15152
+ * §5.3. Batches a series of API calls: event-bus emissions raised inside
15153
+ * `fn` are buffered and flushed (in emission order) after `fn` returns —
15154
+ * subscribers see one burst at the end instead of interleaved
15155
+ * notifications. For async `fn`, the flush happens after the returned
15156
+ * promise settles. The flush always runs, even when `fn` throws or the
15157
+ * promise rejects. Nested `batch()` calls coalesce into the outermost
15158
+ * flush.
15159
+ *
15160
+ * Note: this batches **event delivery** only. Store mutations and
15161
+ * renderer invalidation still happen eagerly inside `fn`; suspending
15162
+ * renderer invalidation remains future work.
15163
+ *
15164
+ * @param fn - Sync or async function performing the batched API calls.
15165
+ * @param options.dedupeEvents - When true, only the last buffered
15166
+ * emission per event key is delivered on flush (coalescing for
15167
+ * "state changed"-style events). Defaults to false — additive events
15168
+ * such as `nodes:added` carry distinct payloads per emission, so
15169
+ * dropping earlier ones loses data.
15170
+ */
15171
+ batch<T>(fn: () => T | Promise<T>, options?: {
15172
+ dedupeEvents?: boolean;
15173
+ }): T | Promise<T>;
14277
15174
  /**
14278
15175
  * Late-bind the InteractionManager to sub-APIs that need it.
14279
15176
  *
@@ -14398,7 +15295,7 @@ interface ToolItemParent extends ToolItemBase {
14398
15295
  pinnable?: boolean;
14399
15296
  /** When true, clicking child items does NOT close the popover */
14400
15297
  keepOpen?: boolean;
14401
- renderPinnedPanel?: (ctx: ToolbarContext) => React.ReactNode;
15298
+ renderPinnedPanel?: (ctx: ToolbarContext) => React__default.ReactNode;
14402
15299
  }
14403
15300
  interface ToolItemToggle extends ToolItemBase {
14404
15301
  kind: 'toggle';
@@ -14484,7 +15381,7 @@ interface ToolbarProps extends ToolbarControlledProps {
14484
15381
  api?: RenderEngineApi;
14485
15382
  theme?: 'dark' | 'light';
14486
15383
  }
14487
- declare function Toolbar(props: ToolbarProps): React.ReactElement;
15384
+ declare function Toolbar(props: ToolbarProps): React__default.ReactElement;
14488
15385
 
14489
15386
  /**
14490
15387
  * Partial Toolbar configuration. Any Toolbar prop can be overridden;
@@ -14569,6 +15466,7 @@ declare function mapboxDark(accessToken: string): TileUrlFn;
14569
15466
  declare const MapTileProviders: {
14570
15467
  readonly cartoDark: TileUrlFn;
14571
15468
  readonly cartoDarkNoLabels: TileUrlFn;
15469
+ readonly cartoDarkNoLabelsRetina: TileUrlFn;
14572
15470
  readonly cartoLight: TileUrlFn;
14573
15471
  readonly cartoLightNoLabels: TileUrlFn;
14574
15472
  readonly cartoVoyager: TileUrlFn;
@@ -14577,6 +15475,7 @@ declare const MapTileProviders: {
14577
15475
  readonly googleHybrid: TileUrlFn;
14578
15476
  readonly googleRoads: TileUrlFn;
14579
15477
  readonly googleTerrain: TileUrlFn;
15478
+ readonly vectorDark: TileUrlFn;
14580
15479
  readonly esriWorldImagery: TileUrlFn;
14581
15480
  readonly esriWorldTopo: TileUrlFn;
14582
15481
  readonly stamenToner: TileUrlFn;
@@ -14587,7 +15486,7 @@ declare const MapTileProviders: {
14587
15486
  readonly mapboxDark: typeof mapboxDark;
14588
15487
  };
14589
15488
  /** Provider names for free (no API key) providers — usable in Storybook selectors */
14590
- type FreeProviderName = "cartoDark" | "cartoDarkNoLabels" | "cartoLight" | "cartoLightNoLabels" | "cartoVoyager" | "openStreetMap" | "googleSatellite" | "googleHybrid" | "googleRoads" | "googleTerrain" | "esriWorldImagery" | "esriWorldTopo" | "stamenToner" | "stamenWatercolor" | "stadiaAlidadeDark";
15489
+ type FreeProviderName = "cartoDark" | "cartoDarkNoLabels" | "cartoDarkNoLabelsRetina" | "cartoLight" | "cartoLightNoLabels" | "cartoVoyager" | "vectorDark" | "openStreetMap" | "googleSatellite" | "googleHybrid" | "googleRoads" | "googleTerrain" | "esriWorldImagery" | "esriWorldTopo" | "stamenToner" | "stamenWatercolor" | "stadiaAlidadeDark";
14591
15490
  /** Metadata for each free provider (for UI display) */
14592
15491
  declare const FREE_PROVIDER_META: Record<FreeProviderName, {
14593
15492
  name: string;
@@ -14725,16 +15624,14 @@ interface PinnedState {
14725
15624
  }
14726
15625
 
14727
15626
  /**
14728
- * Access the `RenderEngineApi` instance from the nearest `<GraphRenderer>`
14729
- * ancestor. Throws if called outside a GraphRenderer subtree.
14730
- */
14731
- declare function useRenderEngineApi(): RenderEngineApi$1;
14732
- /**
14733
- * Same as `useRenderEngineApi` but returns `null` when called outside a
14734
- * `<GraphRenderer>` subtree. Use this in optional overlays that can degrade
14735
- * gracefully when the engine isn't mounted yet.
15627
+ * graph-context/types.ts — type and constant declarations extracted verbatim
15628
+ * from GraphContext.tsx (GraphContext split Phase 1, Task 2).
15629
+ *
15630
+ * Contains no runtime imports (all imports are type-only); the only runtime
15631
+ * values are the `GraphThemes` / `DEFAULT_THEME_TO_PROVIDER` /
15632
+ * `DEFAULT_FORCE_LAYOUT_CONFIG` constants. Must never import from
15633
+ * `../GraphContext` (no cycles).
14736
15634
  */
14737
- declare function useOptionalRenderEngineApi(): RenderEngineApi$1 | null;
14738
15635
 
14739
15636
  /** GPU Layout Controller interface for position texture integration */
14740
15637
  interface LayoutControllerInterface {
@@ -14799,9 +15696,9 @@ interface GraphContextValue {
14799
15696
  /** Container element */
14800
15697
  container: HTMLElement | null;
14801
15698
  /** Layout controller for external access */
14802
- layoutController?: LayoutControllerInterface;
15699
+ readonly layoutController?: LayoutControllerInterface;
14803
15700
  /** Layout position provider */
14804
- layoutPositionProvider?: PositionProvider;
15701
+ readonly layoutPositionProvider?: PositionProvider;
14805
15702
  /** Register a child node renderer (for render loop coordination) */
14806
15703
  registerNodeRenderer: (renderer: GPUNodeRenderer | null) => void;
14807
15704
  /** Register a child edge renderer (for render loop coordination) */
@@ -14813,11 +15710,11 @@ interface GraphContextValue {
14813
15710
  /** Register a callback invoked synchronously when map mode changes */
14814
15711
  registerMapModeCallback: (id: string, callback: ((enabled: boolean, sphereRadius?: number, damping?: number) => void) | null) => void;
14815
15712
  /** Whether map mode is active (inverse-zoom damping enabled) */
14816
- isMapMode: boolean;
15713
+ readonly isMapMode: boolean;
14817
15714
  /** Current map damping value (0=constant size, 1=full perspective). */
14818
- mapDamping: number;
15715
+ readonly mapDamping: number;
14819
15716
  /** Current sphereRadius for globe map mode (0 = flat). Tracked so picker re-sync can preserve globe state. */
14820
- mapSphereRadius: number;
15717
+ readonly mapSphereRadius: number;
14821
15718
  /** Set map mode on all renderers. sphereRadius > 0 enables globe arc edges. damping: 0=constant size, 1=full perspective. */
14822
15719
  setMapMode: (enabled: boolean, sphereRadius?: number, damping?: number) => void;
14823
15720
  /**
@@ -14842,19 +15739,19 @@ interface GraphContextValue {
14842
15739
  */
14843
15740
  registerMapMaxGrowthCallback: (id: string, cb: ((value: number) => void) | null) => void;
14844
15741
  /** Icon atlas manager (created internally from iconFonts prop) */
14845
- iconAtlasManager: IconAtlasManager | null;
15742
+ readonly iconAtlasManager: IconAtlasManager | null;
14846
15743
  /** Image atlas manager (created internally for node images) */
14847
- imageAtlasManager: ImageAtlasManager | null;
15744
+ readonly imageAtlasManager: ImageAtlasManager | null;
14848
15745
  /** Shared SDF glyph atlas manager (for BadgeCloud and TagCloud decoration text) */
14849
- glyphAtlasManager: GlyphAtlasManager | null;
15746
+ readonly glyphAtlasManager: GlyphAtlasManager | null;
14850
15747
  /** Resolved theme configuration */
14851
- theme: GraphThemeConfig;
15748
+ readonly theme: GraphThemeConfig;
14852
15749
  /** Global text scale for node labels */
14853
- textScale: number;
15750
+ readonly textScale: number;
14854
15751
  /** Global text scale for edge labels */
14855
- edgeTextScale: number;
15752
+ readonly edgeTextScale: number;
14856
15753
  /** Whether the scene is in 3D mode. When false, rotation is disabled and view is flat. */
14857
- is3D: boolean;
15754
+ readonly is3D: boolean;
14858
15755
  /** Switch between 2D and 3D mode. Disables rotation and resets view angle in 2D. */
14859
15756
  setIs3D: (is3D: boolean) => void;
14860
15757
  /**
@@ -14864,46 +15761,8 @@ interface GraphContextValue {
14864
15761
  * GlobeLayer; engine-internal code that needs the active projection
14865
15762
  * should also read from here.
14866
15763
  */
14867
- effectiveMapProjection: MapProjection;
15764
+ readonly effectiveMapProjection: MapProjection;
14868
15765
  }
14869
- declare const GraphContext: React.Context<GraphContextValue>;
14870
-
14871
- /**
14872
- * Hook to access the graph context
14873
- */
14874
- declare function useGraph(): GraphContextValue;
14875
- /**
14876
- * Hook to access the graph store
14877
- */
14878
- declare function useGraphStore(): GraphStore;
14879
- /**
14880
- * Hook that re-renders when store version changes
14881
- */
14882
- declare function useGraphVersion(): number;
14883
- /**
14884
- * Hook to access the Three.js scene
14885
- */
14886
- declare function useScene(): THREE$1.Scene;
14887
- /**
14888
- * Hook to access the camera
14889
- */
14890
- declare function useCamera(): THREE$1.PerspectiveCamera;
14891
- /**
14892
- * Hook to access the cloudScene group
14893
- * Renderers should add objects to cloudScene, not scene directly
14894
- */
14895
- declare function useCloudScene(): THREE$1.Group;
14896
- /**
14897
- * Hook to access the interaction manager
14898
- */
14899
- declare function useInteraction(): InteractionManager | null;
14900
- /**
14901
- * Hook to access 3D mode state and setter
14902
- */
14903
- declare function useIs3D(): {
14904
- is3D: boolean;
14905
- setIs3D: (is3D: boolean) => void;
14906
- };
14907
15766
  interface GraphThemeConfig {
14908
15767
  /** Canvas background color (hex number) */
14909
15768
  background: number;
@@ -15369,19 +16228,21 @@ interface GraphRendererProps {
15369
16228
  minimapVisible?: boolean;
15370
16229
  }) => void;
15371
16230
  /**
15372
- * Hover-DIM: when true, hovering a node or edge fades all OTHER instances
15373
- * (and their labels) to make the local neighborhood stand out. Default:
15374
- * `false` — dim is opt-in.
16231
+ * Click-DIM: when true, clicking a node or edge fades all OTHER instances
16232
+ * (and their labels) to make the local neighborhood stand out. Clicking a
16233
+ * node keeps it + its 1-hop neighborhood bright; clicking an edge keeps its
16234
+ * two endpoints bright; clicking the same target again, or the background,
16235
+ * clears. Default: `true` — pass `clickDim={false}` to opt out.
15375
16236
  *
15376
16237
  * **Independent of the hover ring.** The ring/halo on the hovered node is
15377
16238
  * governed separately and is on by default (see the engine's `glowEnabled`,
15378
- * `api.emphasis.setEmphasisGlowEnabled`). Setting `hoverDim` only toggles the
15379
- * dimming of non-neighbors. Equivalent to
15380
- * `api.emphasis.setHoverDimEnabled(value)`.
16239
+ * `api.emphasis.setEmphasisGlowEnabled`). Setting `clickDim` only toggles the
16240
+ * click-driven dimming of non-neighbors. Equivalent to
16241
+ * `api.emphasis.setClickDimEnabled(value)`.
15381
16242
  *
15382
16243
  * @category Global visual scalars
15383
16244
  */
15384
- hoverDim?: boolean;
16245
+ clickDim?: boolean;
15385
16246
  /**
15386
16247
  * Fired when the user clicks a node.
15387
16248
  * Payload includes nodeId, canvas pixel position, world-space [x,y,z],
@@ -15797,13 +16658,151 @@ interface EdgeCloudConfig extends Partial<GPUEdgeRendererConfig> {
15797
16658
  /** Dash ratio */
15798
16659
  dashRatio?: number;
15799
16660
  }
16661
+
16662
+ declare const GraphContext: React.Context<GraphContextValue>;
16663
+
16664
+ /**
16665
+ * ViewStateStore — external store for GraphContext's reactive view state
16666
+ * (contextValue identity redesign, see
16667
+ * notes/specs/2026-06-11-contextvalue-identity-redesign.md).
16668
+ *
16669
+ * The single source of truth for the reactive view state: consumers
16670
+ * subscribe via `useSyncExternalStore`, and the identity-stable context
16671
+ * handle's getters read it live. The snapshot is replaced immutably on
16672
+ * change (unchanged fields keep reference identity), so per-field reads
16673
+ * bail out via `Object.is`. Notification is synchronous; React 18 batching
16674
+ * coalesces same-flush patches into one re-render per subscriber.
16675
+ */
16676
+
16677
+ interface GraphViewState {
16678
+ isMapMode: boolean;
16679
+ mapDamping: number;
16680
+ mapSphereRadius: number;
16681
+ is3D: boolean;
16682
+ effectiveMapProjection: MapProjection;
16683
+ theme: GraphThemeConfig;
16684
+ textScale: number;
16685
+ edgeTextScale: number;
16686
+ iconAtlasManager: IconAtlasManager | null;
16687
+ imageAtlasManager: ImageAtlasManager | null;
16688
+ glyphAtlasManager: GlyphAtlasManager | null;
16689
+ layoutController: LayoutControllerInterface | undefined;
16690
+ layoutPositionProvider: PositionProvider | undefined;
16691
+ }
16692
+
16693
+ /**
16694
+ * graph-context/hooks.ts — the consumer hooks for GraphContext:
16695
+ * - `useGraphHandle()` — the identity-stable context handle (never re-renders
16696
+ * on view-state changes);
16697
+ * - per-field view-state hooks (`useViewStateField` and the named wrappers:
16698
+ * `useIsMapMode`, `useMapDamping`, `useTheme`, `useTextScales`,
16699
+ * `useAtlasManagers`, `useLayoutController`, …) backed by
16700
+ * `useSyncExternalStore` on the ViewStateStore;
16701
+ * - compat `useGraph()` (handle + re-render on any view-state change) and
16702
+ * the version hooks (`useGraphVersion`, `useGraphIconVersion`) plus the
16703
+ * scene/camera/interaction accessors.
16704
+ *
16705
+ * Must never import from `../GraphContext` (no cycles); the context object
16706
+ * comes from `./context` and `GraphContextValue` from `./types`.
16707
+ */
16708
+
16709
+ /**
16710
+ * Stable engine handle — identity never changes for the engine's lifetime,
16711
+ * and reading it does NOT subscribe to reactive view-state changes.
16712
+ * Use for store/scene/camera/renderer/methods-only consumers.
16713
+ */
16714
+ declare function useGraphHandle(): GraphContextValue;
16715
+ /** Subscribe to a single reactive view-state field. */
16716
+ declare function useViewStateField<K extends keyof GraphViewState>(key: K): GraphViewState[K];
16717
+ declare function useIsMapMode(): boolean;
16718
+ declare function useMapDamping(): number;
16719
+ declare function useMapSphereRadius(): number;
16720
+ declare function useTheme(): GraphThemeConfig;
16721
+ declare function useEffectiveMapProjection(): MapProjection;
16722
+ /**
16723
+ * NOTE: the returned object is a fresh allocation each render — destructure
16724
+ * the fields into effect dep arrays; never depend on the object itself.
16725
+ */
16726
+ declare function useTextScales(): {
16727
+ textScale: number;
16728
+ edgeTextScale: number;
16729
+ };
16730
+ /**
16731
+ * NOTE: the returned object is a fresh allocation each render — destructure
16732
+ * the fields into effect dep arrays; never depend on the object itself.
16733
+ */
16734
+ declare function useAtlasManagers(): {
16735
+ iconAtlasManager: IconAtlasManager | null;
16736
+ imageAtlasManager: ImageAtlasManager | null;
16737
+ glyphAtlasManager: GlyphAtlasManager | null;
16738
+ };
16739
+ declare function useLayoutController(): LayoutControllerInterface | undefined;
16740
+ declare function useLayoutPositionProvider(): PositionProvider | undefined;
16741
+ /**
16742
+ * Compat hook: returns the stable handle AND re-renders on ANY reactive
16743
+ * view-state change (subscription keyed on snapshot identity). Prefer
16744
+ * useGraphHandle() + per-field hooks in new code.
16745
+ */
16746
+ declare function useGraph(): GraphContextValue;
16747
+ /**
16748
+ * Hook to access the graph store
16749
+ * (stable field — reads the handle, no reactive re-renders)
16750
+ */
16751
+ declare function useGraphStore(): GraphStore;
16752
+ /**
16753
+ * Hook that re-renders when store version changes
16754
+ */
16755
+ declare function useGraphVersion(): number;
16756
+ /**
16757
+ * Hook to access the Three.js scene
16758
+ * (stable field — reads the handle, no reactive re-renders)
16759
+ */
16760
+ declare function useScene(): THREE$1.Scene;
16761
+ /**
16762
+ * Hook to access the camera
16763
+ * (stable field — reads the handle, no reactive re-renders)
16764
+ */
16765
+ declare function useCamera(): THREE$1.PerspectiveCamera;
16766
+ /**
16767
+ * Hook to access the cloudScene group
16768
+ * Renderers should add objects to cloudScene, not scene directly
16769
+ * (stable field — reads the handle, no reactive re-renders)
16770
+ */
16771
+ declare function useCloudScene(): THREE$1.Group;
16772
+ /**
16773
+ * Hook to access the interaction manager
16774
+ * (stable field — reads the handle, no reactive re-renders)
16775
+ */
16776
+ declare function useInteraction(): InteractionManager | null;
16777
+ /**
16778
+ * Hook to access 3D mode state and setter.
16779
+ * Re-renders only on `is3D` changes (per-field subscription); the setter is
16780
+ * the handle's stable method.
16781
+ */
16782
+ declare function useIs3D(): {
16783
+ is3D: boolean;
16784
+ setIs3D: (is3D: boolean) => void;
16785
+ };
16786
+
16787
+ /**
16788
+ * Access the `RenderEngineApi` instance from the nearest `<GraphRenderer>`
16789
+ * ancestor. Throws if called outside a GraphRenderer subtree.
16790
+ */
16791
+ declare function useRenderEngineApi(): RenderEngineApi$1;
16792
+ /**
16793
+ * Same as `useRenderEngineApi` but returns `null` when called outside a
16794
+ * `<GraphRenderer>` subtree. Use this in optional overlays that can degrade
16795
+ * gracefully when the engine isn't mounted yet.
16796
+ */
16797
+ declare function useOptionalRenderEngineApi(): RenderEngineApi$1 | null;
16798
+
15800
16799
  /**
15801
16800
  * GraphRenderer - Main container component for graph rendering
15802
16801
  *
15803
16802
  * Sets up Three.js scene, renderer, and camera.
15804
16803
  * Provides context for child components.
15805
16804
  */
15806
- declare function GraphRenderer({ container: containerProp, className, style, backgroundColor, antialias, pixelRatio, children, store: storeProp, controls: controlsProp, enableControl, drag: dragProp, enableDrag, controlConfig, cameraZ, initialPosition, onReady, apiRef, apiOptions, nodeCloud, edgeCloud, node: nodeProp, edge: edgeProp, caption: captionProp, edgeCaption: edgeCaptionProp, data: dataProp, minimap: minimapProp, map: mapProp, toolbar: toolbarProp, legend: legendProp, layoutController, forceLayout, autoStartLayout, iconFonts, theme, mapProvider, textScale: textScaleProp, edgeTextScale: edgeTextScaleProp, is3D: is3DProp, defaultDim, mapProjection: mapProjectionProp, onThemeChange, onViewChange, hoverDim, onNodeClick, onNodeDoubleClick, onEdgeClick, onEdgeDoubleClick, onBackgroundClick, onNodeContextMenu, onEdgeContextMenu, onBackgroundContextMenu, onNodeHover, onEdgeHover, onNodeDragStart, onNodeDrag, onNodeDragEnd, onDestroy, onError, onDelta, onLayoutStart, onLayoutEnd, onLayoutProgress, onAlgorithmStart, onAlgorithmEnd, onAlgorithmError, onAlgorithmProgress, onHistoryChange, onStyleChange, selection, defaultSelection, onSelectionChange, hidden, defaultHidden, onVisibilityChange, defaultIs3D, onIs3DChange, defaultTheme, defaultViewState, viewState, onViewStateChange, hoveredId, onHoverChange, pinned, defaultPinned, onPinnedChange, }: GraphRendererProps): react_jsx_runtime.JSX.Element;
16805
+ declare function GraphRenderer({ container: containerProp, className, style, backgroundColor, antialias, pixelRatio, children, store: storeProp, controls: controlsProp, enableControl, drag: dragProp, enableDrag, controlConfig, cameraZ, initialPosition, onReady, apiRef, apiOptions, nodeCloud, edgeCloud, node: nodeProp, edge: edgeProp, caption: captionProp, edgeCaption: edgeCaptionProp, data: dataProp, minimap: minimapProp, map: mapProp, toolbar: toolbarProp, legend: legendProp, layoutController, forceLayout, autoStartLayout, iconFonts, theme, mapProvider, textScale: textScaleProp, edgeTextScale: edgeTextScaleProp, is3D: is3DProp, defaultDim, mapProjection: mapProjectionProp, onThemeChange, onViewChange, clickDim, onNodeClick, onNodeDoubleClick, onEdgeClick, onEdgeDoubleClick, onBackgroundClick, onNodeContextMenu, onEdgeContextMenu, onBackgroundContextMenu, onNodeHover, onEdgeHover, onNodeDragStart, onNodeDrag, onNodeDragEnd, onDestroy, onError, onDelta, onLayoutStart, onLayoutEnd, onLayoutProgress, onAlgorithmStart, onAlgorithmEnd, onAlgorithmError, onAlgorithmProgress, onHistoryChange, onStyleChange, selection, defaultSelection, onSelectionChange, hidden, defaultHidden, onVisibilityChange, defaultIs3D, onIs3DChange, defaultTheme, defaultViewState, viewState, onViewStateChange, hoveredId, onHoverChange, pinned, defaultPinned, onPinnedChange, }: GraphRendererProps): react_jsx_runtime.JSX.Element;
15807
16806
 
15808
16807
  /** GraphCanvas — alias for GraphRenderer (used in new layer system API) */
15809
16808
  declare const GraphCanvas: typeof GraphRenderer;
@@ -16084,6 +17083,16 @@ declare class EdgeTextCloud {
16084
17083
  * 2. Calculate rotation to follow edge direction (screen-space, never upside down)
16085
17084
  * 3. Center text horizontally on the edge
16086
17085
  */
17086
+ /**
17087
+ * Cull cache: skips the per-item bezier/angle math and the glyph re-layout
17088
+ * (setEntries) when neither the view nor the items changed since the last
17089
+ * updateTexts(). See cullCache.ts and the matching gate in TextCloud.
17090
+ */
17091
+ private _cullCache;
17092
+ /** Reused buffer for the view signature (no per-frame allocation). */
17093
+ private _viewSigValues;
17094
+ /** Collect every non-item input of updateTexts() into a flat numeric array. */
17095
+ private _fillViewSignature;
16087
17096
  updateTexts(items: EdgeTextItem[]): void;
16088
17097
  /** Called each frame */
16089
17098
  update(): void;
@@ -16250,10 +17259,28 @@ interface GlobeLayerProps {
16250
17259
  visible?: boolean;
16251
17260
  /** GlobeControl config overrides (rotation speed, zoom speed, zoom range) */
16252
17261
  controlConfig?: GlobeControlConfig;
17262
+ /**
17263
+ * Render a soft fresnel atmosphere glow around the globe's silhouette.
17264
+ * Default: true.
17265
+ */
17266
+ atmosphere?: boolean;
17267
+ /** Atmosphere glow color (CSS string or hex number). Default: cool blue. */
17268
+ atmosphereColor?: number | string;
16253
17269
  /** Callback when globe is created. Receives the SlippyMapGlobe instance. */
16254
17270
  onReady?: (globe: SlippyMapGlobe) => void;
17271
+ /**
17272
+ * @internal — layer-swap confirmation token slot, set by GraphContext's
17273
+ * auto-map-layer effect (`map.beginLayerSwap()`) right before a 2D↔3D
17274
+ * FlatLayer↔GlobeLayer swap. The unmount cleanup consumes the token and
17275
+ * passes it to `disableMap({ swapToken })` so MapApi suppresses the
17276
+ * teardown (the map stays active across the swap). Hosts mounting the
17277
+ * layer manually should not set this.
17278
+ */
17279
+ swapTokenRef?: {
17280
+ current: number | null;
17281
+ };
16255
17282
  }
16256
- declare function GlobeLayer({ radius, tileUrl, tileProvider, minLevel, maxLevel, mercatorProjection, autoFit, visible, controlConfig, onReady, }: GlobeLayerProps): react_jsx_runtime.JSX.Element;
17283
+ declare function GlobeLayer({ radius, tileUrl, tileProvider, minLevel, maxLevel, mercatorProjection, autoFit, visible, controlConfig, atmosphere, atmosphereColor, onReady, swapTokenRef, }: GlobeLayerProps): react_jsx_runtime.JSX.Element;
16257
17284
 
16258
17285
  /**
16259
17286
  * SlippyMapFlat — Tiled raster map on a flat 2D plane (Web Mercator).
@@ -16395,8 +17422,19 @@ interface FlatLayerProps {
16395
17422
  visible?: boolean;
16396
17423
  /** Called once after the SlippyMapFlat instance has been created. */
16397
17424
  onReady?: (flat: SlippyMapFlat) => void;
17425
+ /**
17426
+ * @internal — layer-swap confirmation token slot, set by GraphContext's
17427
+ * auto-map-layer effect (`map.beginLayerSwap()`) right before a 2D↔3D
17428
+ * FlatLayer↔GlobeLayer swap. The unmount cleanup consumes the token and
17429
+ * passes it to `disableMap({ swapToken })` so MapApi suppresses the
17430
+ * teardown (the map stays active across the swap). Hosts mounting the
17431
+ * layer manually should not set this.
17432
+ */
17433
+ swapTokenRef?: {
17434
+ current: number | null;
17435
+ };
16398
17436
  }
16399
- declare function FlatLayer({ mapSize, tileUrl, tileProvider, minLevel, maxLevel, autoFit, visible, onReady, }: FlatLayerProps): react_jsx_runtime.JSX.Element;
17437
+ declare function FlatLayer({ mapSize, tileUrl, tileProvider, minLevel, maxLevel, autoFit, visible, onReady, swapTokenRef, }: FlatLayerProps): react_jsx_runtime.JSX.Element;
16400
17438
 
16401
17439
  /**
16402
17440
  * useInvalidate - Hook for triggering render invalidation
@@ -16468,6 +17506,55 @@ interface LayerOptions<T = any> {
16468
17506
  * @param deps Additional dependencies that trigger re-initialization
16469
17507
  */
16470
17508
  declare function useLayer<T = any>(options: LayerOptions<T>, deps?: any[]): void;
17509
+ /**
17510
+ * useEngineLayer — generic React wrapper for a {@link LayerRenderer}.
17511
+ *
17512
+ * Mirrors GlobeLayer's lifecycle (construct on mount, register frame +
17513
+ * map-mode callbacks, dispose on unmount) but is fully generic over the
17514
+ * renderer and its config. A typical layer is now ~5 lines:
17515
+ *
17516
+ * ```tsx
17517
+ * export function MyLayer(props: MyLayerProps) {
17518
+ * const config = { ...props };
17519
+ * useEngineLayer("my-layer", () => new MyRenderer(), config, [], { frame: true });
17520
+ * return null;
17521
+ * }
17522
+ * ```
17523
+ *
17524
+ * @param name stable id used for frame / map-mode callback registration
17525
+ * @param factory creates the renderer (called once per construct effect)
17526
+ * @param config domain-agnostic config; `update()` runs when its identity changes
17527
+ * @param deps construct-effect deps (re-creates the renderer when they change)
17528
+ * @param opts `{ frame: true }` to register a per-frame tick
17529
+ */
17530
+ declare function useEngineLayer<Config, R extends LayerRenderer<Config>>(name: string, factory: () => R, config: Config, deps: unknown[], opts?: {
17531
+ frame?: boolean;
17532
+ }): void;
17533
+
17534
+ /**
17535
+ * MarkerLayer — a pluggable layer that animates icon markers traveling along
17536
+ * edges (e.g. a plane flying a route on the globe, a packet on a link).
17537
+ *
17538
+ * Conforms to the Engine Layer Standard (see LAYER_STANDARD.md): it is a thin
17539
+ * React wrapper over {@link MarkerRenderer} (a {@link LayerRenderer}) mounted via
17540
+ * {@link useEngineLayer}. Config is domain-agnostic — callers map their own
17541
+ * business data (flight times, cruise speed, …) into the generic `durationMs`.
17542
+ *
17543
+ * ```tsx
17544
+ * <GraphCanvas is3D map={{ tileProvider: "cartoDarkNoLabels" }} nodeCloud edgeCloud>
17545
+ * <MarkerLayer markers={flights.map(f => ({
17546
+ * edgeId: f.id, icon: "plane", orientToPath: true,
17547
+ * durationMs: f.distanceKm / CRUISE_KMH * 3600 * 1000 / TIME_COMPRESS,
17548
+ * }))} />
17549
+ * </GraphCanvas>
17550
+ * ```
17551
+ */
17552
+
17553
+ interface MarkerLayerProps {
17554
+ /** The markers to animate. Each rides one edge from source → target. */
17555
+ markers: MarkerSpec[];
17556
+ }
17557
+ declare function MarkerLayer({ markers }: MarkerLayerProps): null;
16471
17558
 
16472
17559
  interface QuickCreatePanelProps {
16473
17560
  /** The result from EdgeCreateHandler */
@@ -16519,6 +17606,60 @@ interface MinimapLayerProps {
16519
17606
  }
16520
17607
  declare function MinimapLayer({ width, height, position, margin, defaultVisible, positionProvider: positionProviderProp, }: MinimapLayerProps): react_jsx_runtime.JSX.Element;
16521
17608
 
17609
+ type UniformValue = number | number[] | THREE$1.Color | THREE$1.Vector2 | THREE$1.Vector3 | THREE$1.Vector4 | THREE$1.Texture;
17610
+ interface NodeShaderAttribute {
17611
+ /** GLSL attribute name; exposed to the fragment shader as varying `v<Name>`. */
17612
+ name: string;
17613
+ size: 1 | 2 | 3 | 4;
17614
+ /** Per-targeted-node value(s). `node` is the engine `NodeData`; `index` is its GPU instance index. */
17615
+ value: (node: NodeData, index: number) => number | number[];
17616
+ /** Re-evaluate every frame; default false = refill only on membership change. */
17617
+ dynamic?: boolean;
17618
+ }
17619
+ interface NodeShaderLayerSpec {
17620
+ /** Full `void main(){…}` (+ helpers). Engine declares the provided varyings/uniforms — do NOT redeclare them. */
17621
+ fragmentShader: string;
17622
+ sizing?: "screen" | "world";
17623
+ sizeFactor?: number;
17624
+ size?: (node: NodeData, index: number) => number;
17625
+ filter?: (node: NodeData, index: number) => boolean;
17626
+ attributes?: NodeShaderAttribute[];
17627
+ uniforms?: Record<string, UniformValue>;
17628
+ animate?: boolean;
17629
+ band?: "underlay" | "overlay" | "top";
17630
+ bandOffset?: number;
17631
+ followDim?: boolean;
17632
+ hideBuiltinNode?: boolean;
17633
+ blending?: "additive" | "normal";
17634
+ maxNodes?: number;
17635
+ }
17636
+ /** Map a runtime uniform value to its GLSL declaration type. Throws on unsupported shapes. */
17637
+ declare function uniformGlslType(v: UniformValue): string;
17638
+ /** Pure: compose the engine-owned vertex + the preamble-wrapped user fragment. Exported for tests. */
17639
+ declare function buildShaderSources(spec: NodeShaderLayerSpec): {
17640
+ vertex: string;
17641
+ fragment: string;
17642
+ };
17643
+ declare function createNodeShaderLayer(spec: NodeShaderLayerSpec): LayerRenderer<Record<string, UniformValue>>;
17644
+
17645
+ /**
17646
+ * Props for {@link CoverageLayer}.
17647
+ *
17648
+ * @remarks
17649
+ * Updates are driven by **array identity** (`useMemo([items])`). Pass a NEW array
17650
+ * reference to trigger a re-render — mutating the array in place (e.g. `items.push(...)`)
17651
+ * will not be detected.
17652
+ */
17653
+ interface CoverageLayerProps {
17654
+ items: CoverageItem[];
17655
+ }
17656
+ /**
17657
+ * Declarative React wrapper for the CoverageRenderer.
17658
+ * Mounts a world-anchored coverage-disc layer; updates whenever `items` changes.
17659
+ * For imperative runtime use, prefer `api.coverage.set/setMany/clear`.
17660
+ */
17661
+ declare function CoverageLayer({ items }: CoverageLayerProps): null;
17662
+
16522
17663
  interface PitchToggleButtonProps {
16523
17664
  /** Portal target — must be the GraphCanvas container or another positioned ancestor. */
16524
17665
  container: HTMLElement;
@@ -16537,7 +17678,7 @@ interface PitchToggleButtonProps {
16537
17678
  *
16538
17679
  * Hidden when no RenderEngineApi is available in context.
16539
17680
  */
16540
- declare function PitchToggleButton({ container, obliqueDegrees, durationMs, }: PitchToggleButtonProps): React.ReactPortal;
17681
+ declare function PitchToggleButton({ container, obliqueDegrees, durationMs, }: PitchToggleButtonProps): React__default.ReactPortal | null;
16541
17682
 
16542
17683
  /** Minimal interface for geo-three MapView — avoids the geo-three package dependency. */
16543
17684
  interface MapViewLike$1 extends Object3D {
@@ -16783,6 +17924,42 @@ declare function cartesian2Polar({ x, y, z }: {
16783
17924
  declare function deg2Rad(deg: number): number;
16784
17925
  declare function rad2Deg(rad: number): number;
16785
17926
 
17927
+ /**
17928
+ * Vector tile provider — a self-contained, offline basemap.
17929
+ *
17930
+ * Instead of fetching raster imagery from a third-party tile server, this draws
17931
+ * each web-mercator tile's country polygons + graticule onto a canvas from a
17932
+ * world outline that is BUNDLED with the engine (`world-rings.json`), and hands
17933
+ * the globe/flat map a `data:` URL. Result: a clean flat-shaded vector earth
17934
+ * with zero network dependency. The same low-detail outline renders at every
17935
+ * zoom, so zooming in keeps the vector look (it adds no new detail) — pair it
17936
+ * with a low `maxLevel` on the map, or swap to a raster provider past a zoom.
17937
+ *
17938
+ * The returned function matches {@link TileUrlFn}, so it drops straight into the
17939
+ * map config's `tileUrl`, e.g. `map={{ tileUrl: createVectorTileProvider() }}`.
17940
+ */
17941
+
17942
+ /** Colours + graticule spacing for {@link createVectorTileProvider}. */
17943
+ interface VectorTileStyle {
17944
+ /** Ocean / background fill. Default `"#0b1a2e"`. */
17945
+ ocean?: string;
17946
+ /** Land fill. Default `"#1c3147"`. */
17947
+ land?: string;
17948
+ /** Country outline stroke. Default `"#315a80"`. Pass `""` to omit. */
17949
+ border?: string;
17950
+ /** Graticule (lat/lng grid) stroke. Default `"#1a3a55"`. Pass `""` to omit. */
17951
+ grid?: string;
17952
+ /** Graticule spacing in degrees. Default `15`. `0` disables the grid. */
17953
+ gridStepDeg?: number;
17954
+ }
17955
+ /**
17956
+ * Build a vector basemap tile function from the bundled world outline.
17957
+ * Tiles are rendered on demand and cached for the life of the function.
17958
+ */
17959
+ declare function createVectorTileProvider(style?: VectorTileStyle): TileUrlFn;
17960
+ /** Ready-made dark vector basemap (default style). Use as `tileProvider: "vectorDark"`. */
17961
+ declare const vectorDark: TileUrlFn;
17962
+
16786
17963
  /**
16787
17964
  * fitBounds — Calculate initial camera/cloudScene position to fit all data nodes in view.
16788
17965
  *
@@ -17529,8 +18706,8 @@ declare function detectDateProperty(values: PropertyValue[], sampleSize?: number
17529
18706
 
17530
18707
  declare class GroupHitTest {
17531
18708
  private groups;
17532
- constructor(groups: Map<string, GroupState> | null);
17533
- setGroups(groups: Map<string, GroupState> | null): void;
18709
+ constructor(groups: ReadonlyMap<string, GroupState> | null);
18710
+ setGroups(groups: ReadonlyMap<string, GroupState> | null): void;
17534
18711
  testPoint(worldX: number, worldY: number, worldZ: number): string | null;
17535
18712
  }
17536
18713
 
@@ -17575,7 +18752,7 @@ declare class GPUGroupRingRenderer {
17575
18752
  private strokeWidthBuffer;
17576
18753
  constructor(scene: THREE$1.Object3D);
17577
18754
  private createGeometry;
17578
- update(groups: Map<string, GroupState>): void;
18755
+ update(groups: ReadonlyMap<string, GroupState>): void;
17579
18756
  dispose(): void;
17580
18757
  }
17581
18758
 
@@ -17585,7 +18762,7 @@ declare class GroupSphereRenderer {
17585
18762
  private sharedGeo;
17586
18763
  private sharedEdgesGeo;
17587
18764
  constructor(scene: THREE$1.Object3D);
17588
- update(groups: Map<string, GroupState>): void;
18765
+ update(groups: ReadonlyMap<string, GroupState>): void;
17589
18766
  dispose(): void;
17590
18767
  }
17591
18768
 
@@ -17708,4 +18885,4 @@ declare function createDefaultRegistry(): ToolRegistry$1;
17708
18885
 
17709
18886
  declare function useToolbarState(initialState?: Partial<ToolbarState>): Required<ToolbarControlledProps>;
17710
18887
 
17711
- export { ANCHOR_OFFSETS, ANCHOR_RADIUS_PX, type ActiveTween, type AggregateConfig, type AggregateOptions, type AggregatedEdge, type AggregatedEdgeTarget, type AlgorithmInfo, type AnimateOptions, type AnimationEasingType, AnimationManager, type AnyPickResult, type GraphSnapshot as ApiGraphSnapshot, type ApiOptions, type ApiStyleRule, type ApplyGeoLayoutOptions, type ApplyGeoLayoutResult, AxisLayer, type AxisLayerProps, type BackgroundPickResult, type BackgroundPointerEvent, type BadgeSpec, type BufferTextSource, type BuildGeoPositionProviderOptions, type BuildGeoPositionProviderResult, CPULayoutProviderAdapter, CPUPositionProvider, CameraApi, type CameraPositionSource, CameraTween, type CameraTweenTarget, type CanvasEvent, type CapabilityState, type CaptionOptions, type CaptionProps, type CascadeHighlightConfig, CascadeHighlightEffect, type CategoricalFilter, type Category, type ClusterRevealConfig, ClusterRevealEffect, CollectionManager, type CollectionState, type ColorMappingOptions, type ColorValue, type ColumnMapping, type Command, type ConfigSource, type ConflictReport, ContextMenuManager, ContextMenuOverlay, type ContextMenuOverlayProps, type ContextMenuState, type CursorStyle, type CurveParams, DEFAULT_DOCK_POSITIONS, DEFAULT_FORCE_LAYOUT_CONFIG, DEFAULT_INTERACTION_CONFIG, DEFAULT_SHORTCUTS, DEFAULT_THEME_TO_PROVIDER, type DateGranularity, type DateRangeSpec, type DecorationAnchor, type DefaultMenuActions, type DegreeSpec, type DirtyFlag, type DockRegistry, type DragEndEvent, DragHandler, type DragHandlerConfig, type DragMoveEvent, DragPositionsCommand, type DragStartEvent, type DragState, EASINGS, type EasingFn, type EdgeCaptionProps, EdgeClassifier, EdgeCloud, type EdgeCloudConfig, type EdgeCloudProps, type EdgeCreateCallback, EdgeCreateHandler, type EdgeCreateHandlerConfig, type EdgeCreateResult, type EdgeDefinition, type EdgeDrawConfig, EdgeDrawEffect, type EdgeEvent, type EdgeFilter, type EdgeFilterCommonSpec, type EdgeFlowConfig, EdgeFlowEffect, type EdgeGlowConfig, EdgeGlowEffect, type EdgeInput, type EdgeLike, type EdgePickResult, type EdgePointerEvent, type EdgePredicateFn, type EdgeProps, EdgeQuery, type EdgeRenderInfo, type EdgeRenderState, type EdgeSelector, type EdgeShape, EdgeTextCloud, type EdgeTextCloudConfig, type EdgeTextItem, EdgeTextLayer, type EdgeTextLayerProps, type EdgeType, EdgesApi, type Effect, EffectManager, type ElementDefinition, type ElementState, type EnableMapOptions, type EngineCapabilities, type ErrorContext, type EventMap, type ExtractConfig, type ExtractOptions, FREE_PROVIDER_META, FilterApi, type FilterConfig, type FilterEntry, type FilterGroup, type FilterHandle, type FilterMatchCount, type FilterPreset, type FilterPublicType, type FilterResult, type FilterResultCallback, type FilterTarget, FlatLayer, type FlatLayerProps, FlowsApi, type FlyToBoundsOptions, type FlyToGeoOptions, type FlyToOptions, type FocusContextConfig, FocusContextEffect, type ForceLayoutConfig, type FreeProviderName, GPUEdgeRenderer, type GPUEdgeRendererConfig, GPUGroupRingRenderer, GPULayoutProviderAdapter, GPUNodeRenderer, type GPUNodeRendererConfig, GPUPositionProvider, type GeoBounds, type GeoPosition, type GeoSearchResult, type GeocoderDescriptor, GlobeControl, type GlobeControlConfig, GlobeLayer, type GlobeLayerProps, GraphCanvas, type GraphCanvasProps, GraphContext, type GraphContextValue, GraphControl, type GraphControlConfig, type GraphEvent, type GraphEventHandler, type GraphEventType, type GraphFilterAPI, GraphFilterManager, GraphRenderer, type GraphRendererConfig, type GraphRendererProps, GraphStore, type GraphThemeConfig, type GraphThemeKey, GraphThemes, GroupCloud, GroupHitTest, GroupManager, type GroupOptions, type GroupSnapshot, type GroupSpec, GroupSphereRenderer, type GroupState, GroupsApi, type HeatDiffusionConfig, HeatDiffusionEffect, type HiddenState, HistoryApi, type HistoryChangeInfo, type HoverChangeEvent, HoverHandler, type HoverHandlerConfig, type HoverState, type HoverTarget, type IconAtlasConfig, IconAtlasManager, type IconEntry, type IconFontConfigExt, type IconSpec, type ImageArrayConfig, ImageAtlasManager, type ImageEntry, type ImageMappingOptions, type InteractionConfig, InteractionManager, type InteractionManagerConfig, type KeyBinding, KeyboardShortcutManager, type KeyboardShortcutManagerConfig, type LabelPosition$1 as LabelPosition, type LayerOptions, LayoutApi, type LayoutControllerInterface, type LayoutEndInfo, type LayoutEngine, type LayoutReadback, type LayoutRuntime, type LayoutRuntimeEventMap, LayoutRuntimeImpl, type LayoutRuntimeSnapshot, LegendPanel, type LegendPanelProps, type LinkConfig, type LinkOptions, MAX_BADGE_TEXT_CHARS, type MSDFFont, type MSDFGlyph, MapApi, type MapConfig, MapCoordinateProvider, type MapMode, type MapTileProvider, type MapTileProviderDescriptor, MapTileProviders, MapTransition, type MapTransitionConfig, type MapTransitionMode, type MatchSpec, type MenuContext, type MenuGroup, type MenuItem, type MergeConfig, type MergeOptions, type MetricPulseConfig, MetricPulseEffect, type MinimapConfig, MinimapLayer, type MinimapLayerProps, NOMINATIM_BASE_URL, type NodeBreatheConfig, NodeBreatheEffect, NodeCloud, type NodeCloudConfig, type NodeCloudProps, type NodeDefinition, type NodeDragEvent, type NodeEntranceConfig, NodeEntranceEffect, type NodeEvent, type NodeFilter, type NodeFilterCommonSpec, NodeInfoManager, NodeInfoPanel, type NodeInfoPanelProps, type NodeInfoState, type NodeInput, type NodeLike, type NodePickResult, type NodePointerEvent, type NodePredicateFn, type NodeProps, NodeQuery, type NodeRenderState, type NodeRippleConfig, NodeRippleEffect, type NodeSelector, type NodeSizeConfig, NodeSizeService, NodesApi, type ParsedDate, type ParsedSelector, type PathHighlightConfig, PathHighlightEffect, type PickResult, type PickType, Picker, PickerUtils, type PinnedState, PitchToggleButton, type PitchToggleButtonProps, type Platform, PlatformAdapter, type PlaybackConfig, type PlaybackOptions, type PluginInstallContext, type PointerEventBase, type PointerModifiers, type PositionMode, type PositionProvider, type PredicateFilter, type PropertyColorConfig, PropertyColorEffect, PropertyTween, type PropertyTweenConfig, QuickCreatePanel, type QuickCreatePanelProps, type RGB, type RangeFilter, type RangeSpec, type RelationshipType, type RenderBackendType, RenderEngineApi$1 as RenderEngineApi, EventBus as RenderEventBus, type ResolvedMenuItem, type ResolvedMenuSection, ScaledLODRadial, type SchemaCallbacks, type Scope, type ScreenshotOptions, type SearchOptions, SelectionApi, type SelectionChangeEvent, SelectionManager, type SelectionMode$1 as SelectionMode, type SelectionState, SelfLoopCloud, type SelfLoopCloudConfig, SetPositionsCommand, type ShortcutCategory, type ShortcutCommand, type ShortcutCommandDefinition, type ShortcutConfig, type ShortcutOptions, type SizeMappingOptions, type SkillContext, type SkillDef, type SkillInput, type SkillResult, SkillsApi, SlippyMapFlat, type SlippyMapFlatConfig, SlippyMapGlobe, type SlippyMapGlobeConfig, type SnapshotDiff, StaticPositionProvider, StyleApi, StyleMapper, type StyleRule, type Stylesheet$1 as Stylesheet, Stylesheet as StylesheetEngine, type TagId, type TagSpec, type TextAlign, TextCloud, type TextCloudConfig, type TextItem, TextLayer, type TextLayerProps, type TileUrlFn, type TimelineEvent, type TimelineReplayConfig, TimelineReplayEffect, type ToolItem, type ToolItemAction, type ToolItemParent, type ToolItemToggle, type ToolPriority, ToolRegistry$1 as ToolRegistry, type ToolSeparator, Toolbar, type ToolbarAction, type ToolbarContext, type ToolbarControlledProps, type ToolbarPlugin, type ToolbarProps, type ToolbarState, type TopologyFilter, TransformApi, type TransformResult, type TransitionOptions, type TransitionPhase, type Unsubscribe$1 as Unsubscribe, type UpdateStrategy$1 as UpdateStrategy, UpdateStrategy as UpdateStrategyImpl, type UserShortcutConfig, type ViewEvent, type ViewEventHandler, type ViewEventType, type ViewInfo, type ViewRegistrationOptions, ViewRegistry, type ViewState, VisualMapper, advanceByGranularity, arrowFragmentShader, arrowVertexShader, cartesian2Polar, createDefaultItems, createDefaultRegistry, createEdgeTextCloud, createTextCloud, defaultEdgeStyles, defaultNodeStyles, defaultStylesheet, deg2Rad, detectDateProperty, dirtyFlagToAttributes, divergingColorScale, edgeFragmentShader, edgeVertexShader, findFirstImage, fitBounds, formatDate, getAttributesToUpdate, getBaseWorldRadius, getColorScheme, getEdgeClassifier, getGlobalViewRegistry, getNodeShaderSize, getNodeShaderSizeByValue, getNodeWorldRadius, getNodeWorldRadiusBySize, getProviderTileUrl, getScaleFn, hexToRgb, isImageUrl, nextGranularity, nodeFragmentShader, nodeVertexShader, nominatimGeocoder, normalizeEdgeIds, normalizeNodeIds, ordinalColorScale, parseDate, parseNominatim, pickingFragmentShader, pickingVertexShader, polar2Cartesian, prevGranularity, rad2Deg, requiresStructureRebuild, resetGlobalViewRegistry, resolveCaptionText, resolveNodeTitle, selfLoopFragmentShader, selfLoopVertexShader, sequentialColorScale, setLicenseKey, sqrtScale, thresholdColorScale, truncateToGranularity, useCamera, useCloudScene, useGraph, useGraphFilter, useGraphStore, useGraphVersion, useInteraction, useInvalidate, useIs3D, useLayer, useOptionalRenderEngineApi, useRenderEngineApi, useScene, useToolbarState };
18888
+ export { ANCHOR_OFFSETS, ANCHOR_RADIUS_PX, type ActiveTween, type AggregateConfig, type AggregateOptions, type AggregatedEdge, type AggregatedEdgeTarget, type AlgorithmInfo, type AnimateOptions, type AnimationEasingType, AnimationManager, AnimationsApi, type AnyPickResult, type GraphSnapshot as ApiGraphSnapshot, type ApiOptions, type ApiStyleRule, type ApplyGeoLayoutOptions, type ApplyGeoLayoutResult, AxisLayer, type AxisLayerProps, type BackgroundPickResult, type BackgroundPointerEvent, type BadgeSpec, type BufferTextSource, type BuildGeoPositionProviderOptions, type BuildGeoPositionProviderResult, CPULayoutProviderAdapter, CPUPositionProvider, CameraApi, type CameraPositionSource, CameraTween, type CameraTweenTarget, type CanvasEvent, type CapabilityState, type CaptionOptions, type CaptionProps, type CascadeHighlightConfig, CascadeHighlightEffect, type CategoricalFilter, type Category, type ClusterRevealConfig, ClusterRevealEffect, CollectionManager, type CollectionState, type ColorMappingOptions, type ColorValue, type ColumnMapping, type Command, type ConfigSource, type ConflictReport, ContextMenuManager, ContextMenuOverlay, type ContextMenuOverlayProps, type ContextMenuState, CoverageApi, type CoverageConfig, type CoverageItem, CoverageLayer, type CoverageLayerProps, type CoverageSpec, type CursorStyle, type CurveParams, DEFAULT_DOCK_POSITIONS, DEFAULT_FORCE_LAYOUT_CONFIG, DEFAULT_INTERACTION_CONFIG, DEFAULT_SHORTCUTS, DEFAULT_THEME_TO_PROVIDER, type DateGranularity, type DateRangeSpec, type DecorationAnchor, type DefaultMenuActions, type DegreeSpec, type DirtyFlag, type DisableMapOptions, type DockRegistry, type DragEndEvent, DragHandler, type DragHandlerConfig, type DragMoveEvent, DragPositionsCommand, type DragStartEvent, type DragState, EASINGS, type EasingFn, type EdgeCaptionProps, EdgeClassifier, EdgeCloud, type EdgeCloudConfig, type EdgeCloudProps, type EdgeCreateCallback, EdgeCreateHandler, type EdgeCreateHandlerConfig, type EdgeCreateResult, type EdgeDefinition, type EdgeDrawConfig, EdgeDrawEffect, type EdgeEvent, type EdgeFilter, type EdgeFilterCommonSpec, type EdgeFlowConfig, EdgeFlowEffect, type EdgeGlowConfig, EdgeGlowEffect, type EdgeInput, type EdgeLike, type EdgePickResult, type EdgePointerEvent, type EdgePredicateFn, type EdgeProps, EdgeQuery, type EdgeRenderInfo, type EdgeRenderState, type EdgeSelector, type EdgeShape, EdgeTextCloud, type EdgeTextCloudConfig, type EdgeTextItem, EdgeTextLayer, type EdgeTextLayerProps, type EdgeType, EdgesApi, type Effect, EffectManager, type ElementDefinition, type ElementState, EmphasisApi, type EnableMapOptions, type EngineCapabilities, type ErrorContext, type EventMap, type ExtractConfig, type ExtractOptions, FREE_PROVIDER_META, FilterApi, type FilterConfig, type FilterEntry, type FilterGroup, type FilterHandle, type FilterMatchCount, type FilterPreset, type FilterPublicType, type FilterResult, type FilterResultCallback, type FilterTarget, FlatLayer, type FlatLayerProps, type FlightSpec, FlowsApi, type FlyToBoundsOptions, type FlyToGeoOptions, type FlyToOptions, type FocusContextConfig, FocusContextEffect, type ForceLayoutConfig, type FreeProviderName, GPUEdgeRenderer, type GPUEdgeRendererConfig, GPUGroupRingRenderer, GPULayoutProviderAdapter, GPUNodeRenderer, type GPUNodeRendererConfig, GPUPositionProvider, type GeoBounds, type GeoPosition, type GeoSearchResult, type GeocoderDescriptor, GlobeControl, type GlobeControlConfig, GlobeLayer, type GlobeLayerProps, GraphCanvas, type GraphCanvasProps, GraphContext, type GraphContextValue, GraphControl, type GraphControlConfig, type GraphEvent, type GraphEventHandler, type GraphEventType, type GraphFilterAPI, GraphFilterManager, GraphRenderer, type GraphRendererConfig, type GraphRendererProps, GraphStore, type GraphThemeConfig, type GraphThemeKey, GraphThemes, type GraphViewState, GroupCloud, GroupHitTest, GroupManager, type GroupOptions, type GroupSnapshot, type GroupSpec, GroupSphereRenderer, type GroupState, GroupsApi, type HeatDiffusionConfig, HeatDiffusionEffect, type HiddenState, HistoryApi, type HistoryChangeInfo, type HoverChangeEvent, HoverHandler, type HoverHandlerConfig, type HoverState, type HoverTarget, type IconAtlasConfig, IconAtlasManager, type IconEntry, type IconFontConfigExt, type IconSpec, type ImageArrayConfig, ImageAtlasManager, type ImageEntry, type ImageMappingOptions, type InteractionConfig, InteractionManager, type InteractionManagerConfig, type KeyBinding, KeyboardShortcutManager, type KeyboardShortcutManagerConfig, type LabelPosition$1 as LabelPosition, type LayerContext, type LayerOptions, type LayerRenderer, LayersApi, LayoutApi, type LayoutControllerInterface, type LayoutEndInfo, type LayoutEngine, type LayoutReadback, type LayoutRuntime, type LayoutRuntimeEventMap, LayoutRuntimeImpl, type LayoutRuntimeSnapshot, LegendPanel, type LegendPanelProps, type LinkConfig, type LinkOptions, MAX_BADGE_TEXT_CHARS, type MSDFFont, type MSDFGlyph, MapApi, type MapConfig, MapCoordinateProvider, type MapMode, type MapTileProvider, type MapTileProviderDescriptor, MapTileProviders, MapTransition, type MapTransitionConfig, type MapTransitionMode, MarkerLayer, type MarkerLayerProps, MarkerRenderer, type MarkerRendererConfig, type MarkerSpec, MarkersApi, type MatchSpec, type MenuContext, type MenuGroup, type MenuItem, type MergeConfig, type MergeOptions, type MetricPulseConfig, MetricPulseEffect, type MinimapConfig, MinimapLayer, type MinimapLayerProps, NOMINATIM_BASE_URL, type NodeBreatheConfig, NodeBreatheEffect, NodeCloud, type NodeCloudConfig, type NodeCloudProps, type NodeDefinition, type NodeDragEvent, type NodeEntranceConfig, NodeEntranceEffect, type NodeEvent, type NodeFilter, type NodeFilterCommonSpec, NodeInfoManager, NodeInfoPanel, type NodeInfoPanelProps, type NodeInfoState, type NodeInput, type NodeLike, type NodePickResult, type NodePointerEvent, type NodePredicateFn, type NodeProps, NodeQuery, type NodeRenderState, type NodeRippleConfig, NodeRippleEffect, type NodeSelector, type NodeShaderAttribute, type NodeShaderLayerSpec, type NodeSizeConfig, NodeSizeService, NodesApi, type ParsedDate, type ParsedSelector, type PathHighlightConfig, PathHighlightEffect, type PickResult, type PickType, Picker, PickerUtils, type PinnedState, PitchToggleButton, type PitchToggleButtonProps, type Platform, PlatformAdapter, type PlaybackConfig, type PlaybackOptions, type PluginInstallContext, type PointerEventBase, type PointerModifiers, type PositionMode, type PositionProvider, type PredicateFilter, type PropertyColorConfig, PropertyColorEffect, PropertyTween, type PropertyTweenConfig, QuickCreatePanel, type QuickCreatePanelProps, type RGB, type RangeFilter, type RangeSpec, type RelationshipType, type RenderBackendType, RenderEngineApi$1 as RenderEngineApi, EventBus as RenderEventBus, type ResolvedMenuItem, type ResolvedMenuSection, ScaledLODRadial, type SchemaCallbacks, type Scope, type ScreenshotOptions, type SearchOptions, SelectionApi, type SelectionChangeEvent, SelectionManager, type SelectionMode$1 as SelectionMode, type SelectionState, SelfLoopCloud, type SelfLoopCloudConfig, SetPositionsCommand, type ShortcutCategory, type ShortcutCommand, type ShortcutCommandDefinition, type ShortcutConfig, type ShortcutOptions, type SizeMappingOptions, type SkillContext, type SkillDef, type SkillInput, type SkillResult, SkillsApi, SlippyMapFlat, type SlippyMapFlatConfig, SlippyMapGlobe, type SlippyMapGlobeConfig, type SnapshotDiff, StaticPositionProvider, StyleApi, StyleMapper, type StyleRule, type Stylesheet$1 as Stylesheet, Stylesheet as StylesheetEngine, type TagId, type TagSpec, type TextAlign, TextCloud, type TextCloudConfig, type TextItem, TextLayer, type TextLayerProps, type TileUrlFn, type TimelineEvent, type TimelineReplayConfig, TimelineReplayEffect, type ToolItem, type ToolItemAction, type ToolItemParent, type ToolItemToggle, type ToolPriority, ToolRegistry$1 as ToolRegistry, type ToolSeparator, Toolbar, type ToolbarAction, type ToolbarContext, type ToolbarControlledProps, type ToolbarPlugin, type ToolbarProps, type ToolbarState, type TopologyFilter, TransformApi, type TransformResult, type TransitionOptions, type TransitionPhase, type UniformValue, type Unsubscribe$1 as Unsubscribe, type UpdateStrategy$1 as UpdateStrategy, UpdateStrategy as UpdateStrategyImpl, type UserShortcutConfig, type VectorTileStyle, type ViewEvent, type ViewEventHandler, type ViewEventType, type ViewInfo, type ViewRegistrationOptions, ViewRegistry, type ViewState, VisualMapper, advanceByGranularity, arrowFragmentShader, arrowVertexShader, buildShaderSources, cartesian2Polar, computeAirborne, createDefaultItems, createDefaultRegistry, createEdgeTextCloud, createNodeShaderLayer, createTextCloud, createVectorTileProvider, defaultEdgeStyles, defaultNodeStyles, defaultStylesheet, deg2Rad, detectDateProperty, dirtyFlagToAttributes, divergingColorScale, edgeFragmentShader, edgeVertexShader, findFirstImage, fitBounds, formatDate, getAttributesToUpdate, getBaseWorldRadius, getColorScheme, getEdgeClassifier, getGlobalViewRegistry, getNodeShaderSize, getNodeShaderSizeByValue, getNodeWorldRadius, getNodeWorldRadiusBySize, getProviderTileUrl, getScaleFn, hexToRgb, isImageUrl, nextGranularity, nodeFragmentShader, nodeVertexShader, nominatimGeocoder, normalizeEdgeIds, normalizeNodeIds, ordinalColorScale, parseDate, parseNominatim, pickingFragmentShader, pickingVertexShader, polar2Cartesian, prevGranularity, rad2Deg, renderOrderForSlot, requiresStructureRebuild, resetGlobalViewRegistry, resolveCaptionText, resolveNodeTitle, selfLoopFragmentShader, selfLoopVertexShader, sequentialColorScale, setLicenseKey, sqrtScale, thresholdColorScale, truncateToGranularity, uniformGlslType, useAtlasManagers, useCamera, useCloudScene, useEffectiveMapProjection, useEngineLayer, useGraph, useGraphFilter, useGraphHandle, useGraphStore, useGraphVersion, useInteraction, useInvalidate, useIs3D, useIsMapMode, useLayer, useLayoutController, useLayoutPositionProvider, useMapDamping, useMapSphereRadius, useOptionalRenderEngineApi, useRenderEngineApi, useScene, useTextScales, useTheme, useToolbarState, useViewStateField, vectorDark };