@kineviz/gl 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,20 +2,95 @@
2
2
 
3
3
  WebGL 3D graph visualization engine for React.
4
4
 
5
- ## Install
5
+ ---
6
+
7
+ ## Getting started from zero
8
+
9
+ This walkthrough takes you from an empty machine to a rendered graph in five steps.
10
+
11
+ ### 1. Have a React 18 app
12
+
13
+ Already have one? Skip ahead. Otherwise scaffold a fresh app (Vite shown here):
14
+
15
+ ```bash
16
+ npm create vite@latest my-graph-app -- --template react-ts
17
+ cd my-graph-app
18
+ npm install
19
+ ```
20
+
21
+ ### 2. Authenticate with npm
22
+
23
+ `@kineviz/gl` is a **private, scoped package** published with restricted access. Before installing, log in to npm with an account that has been granted access to the `@kineviz` scope:
6
24
 
7
25
  ```bash
8
- # Tarball delivery (P1):
9
- npm install ./vendor/kineviz-gl-0.2.0.tgz
10
-
11
- # Or pin in package.json:
12
- {
13
- "dependencies": {
14
- "@kineviz/gl": "file:./vendor/kineviz-gl-0.2.0.tgz"
15
- }
26
+ npm login
27
+ # then verify you can see the package:
28
+ npm view @kineviz/gl version
29
+ ```
30
+
31
+ If `npm view` errors with `404` or `403`, your account doesn't yet have access — ask your Kineviz contact to add you to the `@kineviz` org.
32
+
33
+ ### 3. Install the engine and its peer dependencies
34
+
35
+ ```bash
36
+ npm install @kineviz/gl
37
+ npm install react@^18 react-dom@^18 three@~0.121.0
38
+ ```
39
+
40
+ `react`, `react-dom`, and `three` are **peer dependencies** — you install them yourself so your app controls the versions. `three` is **strict**: it must be `~0.121.0` (r122+ silently breaks edge/arrow rendering). See the table below.
41
+
42
+ ### 4. Render your first graph
43
+
44
+ `GraphCanvas` renders into a DOM element you give it via the **`container`** prop — it does not create or own the host node, so you stay in control of layout and sizing. Create a host `<div>`, hand its element to `container`, import the CSS, and pass `data`:
45
+
46
+ ```tsx
47
+ import { useState } from "react";
48
+ import { GraphCanvas } from "@kineviz/gl";
49
+ import "@kineviz/gl/dist/index.css"; // required
50
+
51
+ const nodes = [
52
+ { id: "a", category: "Person", properties: { name: "Alice" } },
53
+ { id: "b", category: "Person", properties: { name: "Bob" } },
54
+ ];
55
+ const edges = [
56
+ { id: "e1", source: "a", target: "b", relationship: "KNOWS", properties: {} },
57
+ ];
58
+
59
+ export default function App() {
60
+ // Bind the host div with useState (NOT useRef) so the re-render mounts
61
+ // <GraphCanvas> once the element is in the DOM.
62
+ const [container, setContainer] = useState<HTMLDivElement | null>(null);
63
+
64
+ return (
65
+ <div ref={setContainer} style={{ width: "100%", height: 600 }}>
66
+ {container && (
67
+ <GraphCanvas
68
+ container={container}
69
+ data={{ nodes, edges }}
70
+ forceLayout
71
+ caption={{ visible: true, position: "bottom", property: "name", maxLength: 20 }}
72
+ />
73
+ )}
74
+ </div>
75
+ );
16
76
  }
17
77
  ```
18
78
 
79
+ Two things that trip people up here:
80
+
81
+ - **Use `useState`, not `useRef`** for the host element. A `ref` mutation doesn't trigger the re-render needed to mount `<GraphCanvas>` after the div is in the DOM, so the canvas never appears.
82
+ - **The host div must have a non-zero size.** `GraphCanvas` fills its `container`; if the div is `0×0` (e.g. no height, or `display: inline`), you get a blank canvas. Size it explicitly (`style={{ width: "100%", height: 600 }}`) or wrap it in a sized parent.
83
+
84
+ ### 5. Run it
85
+
86
+ ```bash
87
+ npm run dev
88
+ ```
89
+
90
+ You should see two labelled nodes connected by a `KNOWS` edge. If the canvas is blank, check **Common pitfalls** below — 9 times out of 10 it's the data shape or the missing CSS import.
91
+
92
+ ---
93
+
19
94
  ## Peer dependencies
20
95
 
21
96
  | Package | Required range | Notes |
@@ -51,70 +126,30 @@ interface EdgeData {
51
126
  }
52
127
  ```
53
128
 
54
- ## Quick start
55
-
56
- ```tsx
57
- import { GraphCanvas } from "@kineviz/gl";
58
- import "@kineviz/gl/dist/index.css"; // required
129
+ ## How `GraphCanvas` mounts and sizes itself
59
130
 
60
- const nodes = [
61
- { id: "a", category: "Person", properties: { name: "Alice" } },
62
- { id: "b", category: "Person", properties: { name: "Bob" } },
63
- ];
64
- const edges = [
65
- { id: "e1", source: "a", target: "b", relationship: "KNOWS", properties: {} },
66
- ];
67
-
68
- export default function App() {
69
- return (
70
- <GraphCanvas
71
- data={{ nodes, edges }}
72
- forceLayout
73
- caption={{ visible: true, position: "bottom", property: "name", maxLength: 20 }}
74
- style={{ width: "100%", height: 600 }}
75
- />
76
- );
77
- }
78
- ```
131
+ `GraphCanvas` renders into the DOM element you pass as **`container`** — your app owns that node and its styling. The engine fills the container, so the container's size *is* the canvas size. Give it a real, non-zero size (a fixed `height`, or a sized parent like `<div style={{ width: "100vw", height: "100vh" }}>`).
79
132
 
80
- That's it. `GraphCanvas` auto-creates its own host div, defaults the node and edge renderers to on, and forwards `style` / `className` to the host. The parent's sizing context determines the canvas size — use a fixed `style` (above), or wrap in a sized parent (`<div style={{ width: "100vw", height: "100vh" }}>`).
133
+ With `data` set and no custom children, `GraphCanvas` defaults the node and edge cloud renderers to on, so the [Getting started](#getting-started-from-zero) example is the whole API surface for a basic render.
81
134
 
82
135
  ## Common pitfalls
83
136
 
84
137
  - **Bad data shape = silent blank canvas.** Missing `id` on edges, missing `properties: {}` on either, or naming the edge label `category` instead of `relationship` all produce a black canvas with toolbar visible and no rendered nodes. The store accepts the data; the render pipeline rejects it. See "Data shape" above.
85
138
  - **Captions are off by default.** If you want node labels, pass `caption={{ visible: true, property: "name", position: "bottom" }}` (or whichever property you populated in `properties`).
86
139
  - **CSS import is required.** Without `import "@kineviz/gl/dist/index.css"`, the toolbar overlaps content and node-selection rings disappear.
87
- - **Parent must have non-zero size.** GraphCanvas's auto-host div defaults to `width: 100%, height: 100%`. If the parent has `display: inline` or no sizing context, the canvas is 0×0. Pass `style` to size the host explicitly, or wrap in a sized parent.
140
+ - **`container` div must have non-zero size.** `GraphCanvas` fills the element you pass as `container`. If that element is `0×0` (no height, `display: inline`, or no sizing context), the canvas is `0×0` and stays blank. Size the host div explicitly (`style={{ width: "100%", height: 600 }}`) or wrap it in a sized parent.
141
+ - **Bind the container with `useState`, not `useRef`.** A `ref` mutation doesn't re-render, so `<GraphCanvas>` never mounts and nothing draws. See [Getting started](#getting-started-from-zero) step 4.
88
142
  - **Map/geo examples need `forceLayout` (or another layout source).** Otherwise nodes pile at the origin.
89
143
  - **Three.js must be r121.x.** Newer versions silently break edge/arrow rendering due to internal API drift.
90
144
 
91
- ## Advanced: external container
92
-
93
- If your app already manages the host DOM (custom layout, non-React shell, integration with another library), pass `container` and own the styling:
94
-
95
- ```tsx
96
- import { useState } from "react";
97
- import { GraphCanvas } from "@kineviz/gl";
98
- import "@kineviz/gl/dist/index.css";
99
-
100
- export default function App() {
101
- const [container, setContainer] = useState<HTMLDivElement | null>(null);
145
+ ## More on the `container` prop
102
146
 
103
- return (
104
- <div ref={setContainer} style={{ width: "100%", height: 600 }}>
105
- {container && (
106
- <GraphCanvas
107
- container={container}
108
- data={{ nodes, edges }}
109
- forceLayout
110
- />
111
- )}
112
- </div>
113
- );
114
- }
115
- ```
147
+ The [Getting started](#getting-started-from-zero) example shows the standard pattern: create a host `<div>`, capture its element with `useState`, and pass it as `container`. Notes:
116
148
 
117
- When `container` is provided, `style` and `className` props on `<GraphCanvas>` are ignored (with a dev-mode `console.warn`). Use `useState`, not `useRef` — a ref doesn't trigger the parent re-render needed to mount `<GraphCanvas>` once the host div is in the DOM.
149
+ - **Type:** `container?: HTMLElement | null`. Pass the resolved element, not a ref object.
150
+ - **`style` / `className` are ignored when `container` is set.** Your container element owns its styling (the props emit a dev-mode `console.warn` if you pass them anyway). Style the host `<div>` directly instead.
151
+ - **`useState`, not `useRef`** — a ref mutation doesn't trigger the parent re-render that mounts `<GraphCanvas>` once the host div is in the DOM.
152
+ - **Non-React / custom shells:** because `container` takes any `HTMLElement`, you can hand it a node managed outside React (a custom layout, a different library's mount point) — render `<GraphCanvas container={el} … />` once that element exists.
118
153
 
119
154
  ## Custom children (advanced)
120
155
 
package/dist/index.d.mts CHANGED
@@ -4169,9 +4169,26 @@ interface KeepSet {
4169
4169
  interface HoverEmphasisConfig {
4170
4170
  duration: number;
4171
4171
  dimOpacity: number;
4172
- enabled: boolean;
4173
- /** Light up the kept set (edge tube glow + node halo) alongside the dim. Default true. */
4172
+ /**
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.
4177
+ */
4178
+ dimEnabled: boolean;
4179
+ /**
4180
+ * 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.
4184
+ */
4174
4185
  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;
4175
4192
  /** Edge tubeGlow strength applied to kept edges. Default 1.0. */
4176
4193
  glowStrength?: number;
4177
4194
  /** Node halo strength applied to kept nodes. Default 1.0. */
@@ -4224,6 +4241,21 @@ declare class HoverEmphasisController {
4224
4241
  get state(): HoverEmphasisState;
4225
4242
  get progress(): number;
4226
4243
  _computeKeepSet(target: HoverTarget$1 | null): KeepSet | null;
4244
+ /**
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.
4248
+ */
4249
+ _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. */
4258
+ private _wantsHover;
4227
4259
  /**
4228
4260
  * Diff writer: drives the GPU-side bit 16 (hoverDim) on nodes/edges.
4229
4261
  * - next == null → hover-leave: clear all bits, drop keep-set.
@@ -4236,8 +4268,19 @@ declare class HoverEmphasisController {
4236
4268
  */
4237
4269
  _applyKeepSet(prev: KeepSet | null, next: KeepSet | null): void;
4238
4270
  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`. */
4239
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. */
4279
+ private _reconcile;
4280
+ /** @deprecated Returns whether the DIM feature is enabled (legacy name). */
4240
4281
  isEnabled(): boolean;
4282
+ isDimEnabled(): boolean;
4283
+ isGlowEnabled(): boolean;
4241
4284
  getConfig(): HoverEmphasisConfig;
4242
4285
  onHoverEnter(target: HoverTarget$1): void;
4243
4286
  onHoverMove(target: HoverTarget$1): void;
@@ -4255,16 +4298,16 @@ declare class HoverEmphasisController {
4255
4298
  */
4256
4299
  setExternalKeepSet(keepNodes: Iterable<string>, keepEdges: Iterable<string>): void;
4257
4300
  /** Cancel the programmatic dim. Per-instance un-dim ramps fire smoothly.
4258
- * Restores the pre-external `_config.enabled` so a trace started with
4301
+ * Restores the pre-external `_config.dimEnabled` so a trace started with
4259
4302
  * hover-dim disabled stays off — even if a click happens MID-ramp.
4260
- * We set `_config.enabled` synchronously (rather than deferring to
4303
+ * We set `_config.dimEnabled` synchronously (rather than deferring to
4261
4304
  * `_enterIdle`) because `onMouseDown` unregisters the ramp frame
4262
4305
  * callback as part of Suppressed-state housekeeping; without an
4263
4306
  * immediate flip, click→mouseup leaves the controller in Idle with
4264
- * `enabled === true`, and the next hover re-triggers dim. The state
4307
+ * `dimEnabled === true`, and the next hover re-triggers dim. The state
4265
4308
  * machine still cycles through RampingDown→Idle to play the visual
4266
- * un-dim animation; `onHoverEnter`/`onHoverMove` gate on `_config.enabled`
4267
- * directly so the intermediate states don't admit hover events. */
4309
+ * un-dim animation; `onHoverEnter`/`onHoverMove` scope the kept set by
4310
+ * `dimEnabled` so the intermediate states draw the ring without dimming. */
4268
4311
  clearExternalKeepSet(): void;
4269
4312
  onMouseDown(button: number): void;
4270
4313
  onMouseUp(): void;
@@ -4550,12 +4593,21 @@ declare class InteractionCoordinator {
4550
4593
  private pickedNodeIdOnDown;
4551
4594
  private graphControlWasEnabled;
4552
4595
  private dragHandlerWasEnabled;
4596
+ private _bgGestureExternal;
4553
4597
  constructor(picker: Picker, dragHandler: DragHandler, graphControl: GraphControl, selectionManager: SelectionManager, hoverHandler: HoverHandler, config?: InteractionCoordinatorConfig);
4554
4598
  /**
4555
4599
  * Enable/disable globe mode (affects left-drag behavior on background)
4556
4600
  */
4557
4601
  setGlobeMode(enabled: boolean): void;
4558
4602
  get globeMode(): boolean;
4603
+ /**
4604
+ * When true, an external control (GlobeControl) owns background pan/rotate
4605
+ * gestures, so the coordinator skips enterPanMode/enterRotateMode on
4606
+ * background mousedown. This keeps the DragHandler enabled so node-drag still
4607
+ * works in globe mode (otherwise enterPanMode disables it). Set by GlobeLayer
4608
+ * on mount, cleared on unmount. Node/group drags are unaffected.
4609
+ */
4610
+ setBackgroundGestureExternal(enabled: boolean): void;
4559
4611
  /**
4560
4612
  * Set the PathSelectHandler for Shift+drag path selection.
4561
4613
  */
@@ -4602,6 +4654,15 @@ declare class InteractionCoordinator {
4602
4654
  private handlePotentialDragMove;
4603
4655
  private handleDragNodeMove;
4604
4656
  private resetState;
4657
+ /**
4658
+ * True when the event originated on the renderer canvas itself, not on an
4659
+ * overlay element (panel / toolbar / legend) layered inside the container.
4660
+ * Mirrors the `event.target === renderer.domElement` guard used for
4661
+ * mousedown / click / contextmenu in InteractionManager. When the canvas
4662
+ * element is unavailable we fail open (treat as over-canvas) to avoid
4663
+ * silently disabling hover.
4664
+ */
4665
+ private isEventOverCanvas;
4605
4666
  private debug;
4606
4667
  /**
4607
4668
  * Force reset to idle state (for external control)
@@ -10538,16 +10599,30 @@ declare class EmphasisApi {
10538
10599
  */
10539
10600
  stopAll(type?: EmphasisType): void;
10540
10601
  /**
10541
- * Enable or disable the hover-neighbor-highlight emphasis effect.
10602
+ * Enable or disable the hover-DIM feature (fade everything outside the
10603
+ * hovered node's 1-hop neighborhood).
10604
+ *
10605
+ * **Independent of the hover ring.** The ring/halo is governed by
10606
+ * {@link setEmphasisGlowEnabled} (on by default); this switch only controls
10607
+ * the dimming of non-neighbors. Default `false` — dim is opt-in.
10542
10608
  *
10543
- * When enabled (default), hovering a node dims all other nodes and edges
10544
- * except the hovered node, its 1-hop neighbors, and the connecting edges.
10545
- * When disabled, hover events do not trigger any dim ramp.
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.
10546
10612
  *
10547
10613
  * Not undoable. Not recorded in history.
10548
10614
  *
10549
10615
  * @param enabled - `true` to enable hover dimming, `false` to disable.
10550
10616
  */
10617
+ setHoverDimEnabled(enabled: boolean): void;
10618
+ /**
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
+ */
10551
10626
  setHoverEnabled(enabled: boolean): void;
10552
10627
  /**
10553
10628
  * Set the opacity of dimmed nodes and edges during hover emphasis.
@@ -10576,13 +10651,18 @@ declare class EmphasisApi {
10576
10651
  */
10577
10652
  setHoverDuration(ms: number): void;
10578
10653
  /**
10579
- * Enable or disable the positive emphasis (tube glow on kept edges + halo
10580
- * on kept nodes) that accompanies hover/dim. Default `true`. Does not
10581
- * affect the opacity dim controlled by {@link setHoverDimOpacity}.
10654
+ * Enable or disable the hover RING (node halo + edge tube glow). Default
10655
+ * `true` — the ring shows on hover out of the box.
10656
+ *
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}.
10582
10662
  *
10583
10663
  * Not undoable. Not recorded in history.
10584
10664
  *
10585
- * @param enabled - `true` to enable glow+halo, `false` to disable.
10665
+ * @param enabled - `true` to enable the ring, `false` to disable.
10586
10666
  */
10587
10667
  setEmphasisGlowEnabled(enabled: boolean): void;
10588
10668
  /**
@@ -10606,11 +10686,12 @@ declare class EmphasisApi {
10606
10686
  */
10607
10687
  setEmphasisHaloStrength(strength: number): void;
10608
10688
  /**
10609
- * Returns whether the hover-neighbor-highlight emphasis effect is enabled.
10689
+ * Returns whether the hover-DIM feature is enabled.
10610
10690
  *
10611
10691
  * @returns `true` if hover dimming will fire on hover-enter; `false`
10612
- * otherwise. Also returns `false` when no {@link HoverEmphasisController}
10613
- * is wired (the API was constructed without a controller).
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).
10614
10695
  */
10615
10696
  isHoverEnabled(): boolean;
10616
10697
  /**
@@ -12470,6 +12551,13 @@ interface GlobeControlConfig {
12470
12551
  * pitch and call api.map.setPitch.
12471
12552
  */
12472
12553
  onPitchDelta?: (deltaDegrees: number) => void;
12554
+ /**
12555
+ * Optional hit-test invoked on left-button mousedown. Return true to let
12556
+ * another handler (the engine's node DragHandler) own the gesture — GlobeControl
12557
+ * then skips its orbit so nodes can be dragged in globe mode instead of
12558
+ * rotating the globe. Background mousedowns (return false) still rotate.
12559
+ */
12560
+ shouldSkipDrag?: (e: MouseEvent) => boolean;
12473
12561
  }
12474
12562
  declare class GlobeControl {
12475
12563
  /** Enable/disable all interaction. */
@@ -12941,6 +13029,9 @@ declare class MapApi {
12941
13029
  private _autoFitDuration;
12942
13030
  private _autoFitDebounceMs;
12943
13031
  private _transitioning;
13032
+ private _inLayerSwap;
13033
+ private _layerSwapArmedAt;
13034
+ private static readonly LAYER_SWAP_SUPPRESS_WINDOW_MS;
12944
13035
  private _elevation;
12945
13036
  private _appliedElevation;
12946
13037
  /**
@@ -13057,6 +13148,21 @@ declare class MapApi {
13057
13148
  * Phase 1: records state and emits event. Scene wiring is Phase 2/3.
13058
13149
  */
13059
13150
  enableMap(options?: EnableMapOptions): Promise<void>;
13151
+ /**
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.
13156
+ *
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".
13162
+ *
13163
+ * @internal — used by GraphContext's auto-map-layer effect.
13164
+ */
13165
+ beginLayerSwap(): void;
13060
13166
  /**
13061
13167
  * Disable map mode and restore the scene to its pre-map state.
13062
13168
  *
@@ -13065,6 +13171,20 @@ declare class MapApi {
13065
13171
  * Emits `"map:disabled"`.
13066
13172
  */
13067
13173
  disableMap(): void;
13174
+ /**
13175
+ * Re-enable + reheat the live force layout so released nodes re-flow.
13176
+ *
13177
+ * Show Map's `stopLayout()` left the controller's `_enable=false`, and
13178
+ * `restartLayout()` early-returns while disabled — so we must RE-ENABLE
13179
+ * first. Critically we use `restartLayout()` (reheat the EXISTING sim in
13180
+ * place), NOT `startLayout()`: startLayout does a full dispose+buildSimulation
13181
+ * that re-seeds pin state from the stale `graph.layoutNodes[].pinned` mirror
13182
+ * (which is never set for geo), which would UNPIN geo and break the map
13183
+ * projection. Routed through the provider's layoutController (the WebGPU /
13184
+ * CPU-adapter wiring); falls back to the legacy `_layoutRuntime` sim handle
13185
+ * for the d3 engine.
13186
+ */
13187
+ private _reheatLayout;
13068
13188
  /**
13069
13189
  * Whether map mode is currently active.
13070
13190
  */
@@ -15045,7 +15165,7 @@ interface GraphRendererProps {
15045
15165
  */
15046
15166
  cameraZ?: number;
15047
15167
  /**
15048
- * Initial cloudScene position [x, y, z]. Default: [0, 0, -15]. Use for centering on a region.
15168
+ * Initial cloudScene position [x, y, z]. Default: [0, 0, -2]. Use for centering on a region.
15049
15169
  * @category Controlled state
15050
15170
  */
15051
15171
  initialPosition?: [number, number, number];
@@ -15198,14 +15318,14 @@ interface GraphRendererProps {
15198
15318
  */
15199
15319
  minimap?: boolean | MinimapConfig;
15200
15320
  /**
15201
- * Toolbar auto-mount configuration. The toolbar is mounted by default so
15202
- * every GraphRenderer/GraphCanvas gets a working overlay without explicit
15203
- * wiring. Set to `false` to opt out (render your own `<Toolbar>` as a
15204
- * child instead), or pass a config object to override individual Toolbar
15205
- * props (registry, locale, messages, theme, controlled state pairs).
15321
+ * Toolbar auto-mount configuration. The toolbar is **hidden by default** —
15322
+ * opt in by setting `true` (auto-mount with the built-in registry) or by
15323
+ * passing a config object to override individual Toolbar props (registry,
15324
+ * locale, messages, theme, controlled state pairs). You may also render your
15325
+ * own `<Toolbar>` as a child instead.
15206
15326
  *
15207
- * - undefined / true: auto-mount with `createDefaultRegistry()` and internal state
15208
- * - false: do not mount
15327
+ * - undefined / false: do not mount (default)
15328
+ * - true: auto-mount with `createDefaultRegistry()` and internal state
15209
15329
  * - object: auto-mount, but use the provided Toolbar props as overrides
15210
15330
  *
15211
15331
  * @category Subsystem mount toggles
@@ -15249,11 +15369,15 @@ interface GraphRendererProps {
15249
15369
  minimapVisible?: boolean;
15250
15370
  }) => void;
15251
15371
  /**
15252
- * Hover-neighbor-highlight: when true, hovering a node or edge dims all
15253
- * other instances (and their labels) to make the local neighborhood
15254
- * stand out. Default: `true`. Hovering a node/edge dims the rest AND lights up the
15255
- * focused neighborhood (edge tube glow + node halo). Pass `hoverDim={false}`
15256
- * to disable. Equivalent to `api.emphasis.setHoverEnabled(value)`.
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.
15375
+ *
15376
+ * **Independent of the hover ring.** The ring/halo on the hovered node is
15377
+ * 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)`.
15257
15381
  *
15258
15382
  * @category Global visual scalars
15259
15383
  */
@@ -16085,8 +16209,14 @@ interface NodeInfoPanelProps {
16085
16209
  manager: NodeInfoManager;
16086
16210
  store: GraphStore;
16087
16211
  container?: HTMLElement | null;
16212
+ /** Accepted for backward-compat; theme is driven by `data-gxr-theme` tokens. */
16213
+ isDark?: boolean;
16214
+ /** Show the footer "扩展邻居" button. Default false (hidden). */
16215
+ showExpandNeighbors?: boolean;
16216
+ /** Host callback invoked when the "扩展邻居" button is clicked. */
16217
+ onExpandNeighbors?: (nodeId: string) => void;
16088
16218
  }
16089
- declare function NodeInfoPanel({ manager, store, container }: NodeInfoPanelProps): react_jsx_runtime.JSX.Element;
16219
+ declare function NodeInfoPanel({ manager, store, container, showExpandNeighbors, onExpandNeighbors }: NodeInfoPanelProps): react_jsx_runtime.JSX.Element;
16090
16220
 
16091
16221
  interface GlobeLayerProps {
16092
16222
  /** Globe radius in scene units. Default: 5 */