@fusefactory/fuse-three-forcegraph 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/dist/index.d.mts +1489 -1467
  2. package/dist/index.mjs +4243 -4212
  3. package/package.json +46 -47
  4. package/index.ts +0 -34
package/dist/index.d.mts CHANGED
@@ -1,1468 +1,1490 @@
1
- import CameraControls from "camera-controls";
2
- import * as THREE from "three";
3
-
4
- //#region types/iCameraMode.d.ts
5
- declare enum CameraMode {
6
- Orbit = "orbit",
7
- Map = "map",
8
- }
9
- //#endregion
10
- //#region rendering/CameraController.d.ts
11
- interface CameraConfig {
12
- fov?: number;
13
- aspect?: number;
14
- near?: number;
15
- far?: number;
16
- position?: THREE.Vector3;
17
- target?: THREE.Vector3;
18
- minDistance?: number;
19
- maxDistance?: number;
20
- }
21
- interface ControlsConfig {
22
- smoothTime?: number;
23
- dollyToCursor?: boolean;
24
- infinityDolly?: boolean;
25
- enableZoom?: boolean;
26
- enableRotation?: boolean;
27
- enablePan?: boolean;
28
- minDistance?: number;
29
- maxDistance?: number;
30
- maxPolarAngle?: number;
31
- minPolarAngle?: number;
32
- minAzimuthAngle?: number;
33
- maxAzimuthAngle?: number;
34
- }
35
- declare class CameraController {
36
- camera: THREE.PerspectiveCamera;
37
- controls: CameraControls;
38
- private sceneBounds;
39
- private autorotateEnabled;
40
- private autorotateSpeed;
41
- private userIsActive;
42
- constructor(domelement: HTMLElement, config?: CameraConfig);
43
- private setupDefaultControls;
44
- /**
45
- * Set camera control mode
46
- */
47
- setMode(mode: CameraMode): void;
48
- /**
49
- * Set camera boundary
50
- */
51
- setBoundary(box: THREE.Box3): void;
52
- /**
53
- * Update camera controls (should be called in render loop)
54
- * Only autorotate if enabled and user is inactive
55
- */
56
- update(delta: number): boolean;
57
- /**
58
- * Set autorotate enabled/disabled
59
- */
60
- setAutorotate(enabled: boolean, speed?: number): void;
61
- /**
62
- * Set user activity state
63
- */
64
- setUserIsActive(isActive: boolean): void;
65
- /**
66
- * Configure camera controls
67
- */
68
- configureControls(config: ControlsConfig): void;
69
- /**
70
- * Resize camera when window resizes
71
- */
72
- resize(width: number, height: number): void;
73
- /**
74
- * Animate camera to look at a specific target from a specific position
75
- */
76
- setLookAt(position: THREE.Vector3, target: THREE.Vector3, enableTransition?: boolean): Promise<void>;
77
- /**
78
- * Reset camera to default position
79
- */
80
- reset(enableTransition?: boolean): Promise<void>;
81
- /**
82
- * Enable/disable controls
83
- */
84
- setEnabled(enabled: boolean): void;
85
- /**
86
- * Get current camera target (look-at point)
87
- */
88
- getTarget(out?: THREE.Vector3): THREE.Vector3;
89
- /**
90
- * Dispose camera manager and clean up
91
- */
92
- dispose(): void;
93
- /**
94
- * Clear camera bounds (remove boundary restrictions)
95
- */
96
- clearBounds(): void;
97
- /**
98
- * Get current scene bounds
99
- */
100
- getSceneBounds(): THREE.Box3 | null;
101
- /**
102
- * Update scene bounds used by the camera manager.
103
- * Stores the bounds for future use (e.g. constraining controls).
104
- */
105
- updateBounds(box: THREE.Box3): void;
106
- /**
107
- * Unified configuration method
108
- */
109
- setOptions(options: {
110
- controls?: ControlsConfig;
111
- autoRotate?: boolean;
112
- autoRotateSpeed?: number;
113
- }): void;
114
- }
115
- //#endregion
116
- //#region types/iGraphLink.d.ts
117
- interface GraphLink {
118
- source: string;
119
- target: string;
120
- }
121
- //#endregion
122
- //#region types/iGraphNode.d.ts
123
- interface GraphNode {
124
- id: string;
125
- label?: string;
126
- description?: string;
127
- thumbnailUrl?: string;
128
- category?: string;
129
- x?: number;
130
- y?: number;
131
- z?: number;
132
- fx?: number;
133
- fy?: number;
134
- fz?: number;
135
- state?: NodeState;
136
- metadata?: any;
137
- }
138
- declare enum NodeState {
139
- Hidden = 0,
140
- // = 0 not rendered
141
- Passive = 1,
142
- // = 1 rendered, not influencing simulation,
143
- Fixed = 2,
144
- // = 2 rendered, influencing simulation, but not moving
145
- Active = 3,
146
- }
147
- //#endregion
148
- //#region types/iGraphData.d.ts
149
- interface GraphData {
150
- nodes: GraphNode[];
151
- links: GraphLink[];
152
- metadata?: any;
153
- }
154
- //#endregion
155
- //#region types/iForceConfig.d.ts
156
- interface ForceConfig {
157
- collisionStrength: number;
158
- collisionRadius: number;
159
- collisionMaxDistance: number;
160
- enableCollision: boolean;
161
- manyBodyStrength: number;
162
- manyBodyMinDistance: number;
163
- manyBodyMaxDistance: number;
164
- enableManyBody: boolean;
165
- springStrength: number;
166
- springLength: number;
167
- springDamping: number;
168
- maxLinks: number;
169
- enableLinks: boolean;
170
- gravity: number;
171
- enableGravity: boolean;
172
- attractorStrength: number;
173
- enableAttractors: boolean;
174
- elasticStrength: number;
175
- enableElastic: boolean;
176
- dragStrength: number;
177
- damping: number;
178
- alpha: number;
179
- alphaDecay: number;
180
- deltaTime: number;
181
- spaceSize: number;
182
- is3D: boolean;
183
- }
184
- //#endregion
185
- //#region types/iGraphPreset.d.ts
186
- interface GraphPreset {
187
- name: string;
188
- force?: Partial<ForceConfig>;
189
- camera?: {
190
- mode?: CameraMode;
191
- position?: {
192
- x: number;
193
- y: number;
194
- z: number;
195
- };
196
- target?: {
197
- x: number;
198
- y: number;
199
- z: number;
200
- };
201
- zoom?: number;
202
- transitionDuration?: number;
203
- minDistance?: number;
204
- maxDistance?: number;
205
- boundary?: {
206
- min: {
207
- x: number;
208
- y: number;
209
- z: number;
210
- };
211
- max: {
212
- x: number;
213
- y: number;
214
- z: number;
215
- };
216
- } | null;
217
- };
218
- nodes?: {
219
- state?: (node: GraphNode) => NodeState;
220
- };
221
- links?: {
222
- opacity?: number;
223
- };
224
- }
225
- //#endregion
226
- //#region ui/Tooltips.d.ts
227
- /**
228
- * Renderer function type for custom tooltip rendering
229
- * Can mount React, Vue, or any other framework component
230
- */
231
- type TooltipRenderer = (container: HTMLElement, node: GraphNode, type: 'preview' | 'full', x: number, y: number) => void | (() => void);
232
- /**
233
- * Cursor handler for custom cursor behavior
234
- */
235
- type CursorHandler = (canvas: HTMLCanvasElement | null, state: 'default' | 'pointer' | 'grab') => void;
236
- interface TooltipConfig {
237
- /** Custom renderer for tooltips (React, Vue, etc.) */
238
- renderer?: TooltipRenderer;
239
- /** Custom cursor handler */
240
- cursorHandler?: CursorHandler;
241
- }
242
- //#endregion
243
- //#region core/EventEmitter.d.ts
244
- declare class EventEmitter {
245
- private listeners;
246
- protected listenerCount(event: string): number;
247
- on(event: string, listener: Function): () => void;
248
- off(event: string, listener: Function): void;
249
- emit(event: string, ...args: any[]): void;
250
- }
251
- //#endregion
252
- //#region controls/InputProcessor.d.ts
253
- /**
254
- * Manages pointer/mouse input and emits interaction events
255
- * Uses GPU picking for efficient node detection
256
- */
257
- declare class InputProcessor extends EventEmitter {
258
- private pickFn;
259
- private canvas;
260
- private viewport;
261
- private readonly CLICK_THRESHOLD;
262
- private readonly HOVER_TO_POP_MS;
263
- private pointer;
264
- private canvasPointer;
265
- private isPointerDown;
266
- private isDragging;
267
- private mouseDownTime;
268
- private draggedIndex;
269
- private currentHoverIndex;
270
- private hoverStartTime;
271
- private hoverProgress;
272
- private hasPopped;
273
- private lastClientX;
274
- private lastClientY;
275
- constructor(pickFn: (x: number, y: number) => number, // Injected
276
- canvas: HTMLCanvasElement, viewport: {
277
- width: number;
278
- height: number;
279
- });
280
- private setupEventListeners;
281
- private handlePointerMove;
282
- private handlePointerDown;
283
- private handlePointerUp;
284
- private handlePointerLeave;
285
- private updateHover;
286
- /**
287
- * Update hover state even when pointer is stationary
288
- * Called from render loop
289
- */
290
- update(): void;
291
- private updatePointer;
292
- /**
293
- * Update viewport dimensions on resize
294
- */
295
- resize(width: number, height: number): void;
296
- dispose(): void;
297
- }
298
- //#endregion
299
- //#region controls/handlers/HoverHandler.d.ts
300
- declare class HoverHandler extends EventEmitter {
301
- private getNodeByIndex;
302
- constructor(getNodeByIndex: (index: number) => GraphNode | null);
303
- private handleHoverStart;
304
- private handleHover;
305
- private handlePop;
306
- private handleHoverEnd;
307
- dispose(): void;
308
- }
309
- //#endregion
310
- //#region controls/handlers/ClickHandler.d.ts
311
- declare class ClickHandler extends EventEmitter {
312
- private getNodeByIndex;
313
- constructor(getNodeByIndex: (index: number) => GraphNode | null);
314
- private handleClick;
315
- dispose(): void;
316
- }
317
- //#endregion
318
- //#region textures/SimulationBuffers.d.ts
319
- /**
320
- * Manages dynamic render targets updated by force simulation
321
- * Uses ping-pong technique for GPU computation
322
- * Buffers are created lazily when data is initialized
323
- */
324
- declare class SimulationBuffers {
325
- private renderer;
326
- private textureSize;
327
- private positionBuffers;
328
- private velocityBuffers;
329
- private isInitialized;
330
- constructor(renderer: THREE.WebGLRenderer);
331
- /**
332
- * Check if buffers are initialized
333
- */
334
- isReady(): boolean;
335
- /**
336
- * Initialize buffers with point count and initial positions
337
- */
338
- init(pointsCount: number, initialPositions?: Float32Array): void;
339
- /**
340
- * Resize buffers (re-initializes with new size)
341
- */
342
- resize(pointsCount: number, preserveData?: boolean): void;
343
- private calculateTextureSize;
344
- private createDynamicBuffer;
345
- /**
346
- * Initialize position buffers from initial data
347
- */
348
- setInitialPositions(positionArray: Float32Array): void;
349
- /**
350
- * Update current and previous positions, but keep original positions intact
351
- */
352
- updateCurrentPositions(positionArray: Float32Array): void;
353
- /**
354
- * Set original positions (anchors) separately from current positions
355
- */
356
- setOriginalPositions(positionArray: Float32Array): void;
357
- /**
358
- * Initialize velocity buffers (usually to zero)
359
- */
360
- initVelocities(): void;
361
- /**
362
- * Swap position buffers (ping-pong)
363
- */
364
- swapPositions(): void;
365
- /**
366
- * Swap velocity buffers (ping-pong)
367
- */
368
- swapVelocities(): void;
369
- /**
370
- * Reset positions to original state
371
- */
372
- resetPositions(): void;
373
- /**
374
- * Read current positions back from GPU (expensive operation)
375
- * Returns RGBA float array (x, y, z, state)
376
- */
377
- readPositions(): Float32Array;
378
- getCurrentPositionTarget(): THREE.WebGLRenderTarget | null;
379
- getPreviousPositionTarget(): THREE.WebGLRenderTarget | null;
380
- getCurrentPositionTexture(): THREE.Texture<unknown>;
381
- getPreviousPositionTexture(): THREE.Texture | null;
382
- getOriginalPositionTexture(): THREE.Texture | null;
383
- getCurrentVelocityTarget(): THREE.WebGLRenderTarget | null;
384
- getPreviousVelocityTarget(): THREE.WebGLRenderTarget | null;
385
- getCurrentVelocityTexture(): THREE.Texture | null;
386
- getPreviousVelocityTexture(): THREE.Texture | null;
387
- getTextureSize(): number;
388
- private arrayToTextureData;
389
- private createDataTexture;
390
- private copyTextureToBuffer;
391
- private copyBufferToBuffer;
392
- dispose(): void;
393
- }
394
- //#endregion
395
- //#region types/iAttractor.d.ts
396
- /**
397
- * Simple 3D vector type
398
- */
399
- interface Vec3 {
400
- x: number;
401
- y: number;
402
- z: number;
403
- }
404
- /**
405
- * Attractor - A point in space that attracts nodes of specific groups
406
- */
407
- interface Attractor {
408
- /** Unique identifier */
409
- id: string;
410
- /** Position in world space */
411
- position: Vec3;
412
- /** Radius of attraction (default: 0.0) - nodes within this radius are not pulled further */
413
- radius?: number;
414
- /** Groups of nodes attracted to this attractor (empty = attracts all) */
415
- groups: string[];
416
- /** Strength of attraction (default: 1.0) */
417
- strength?: number;
418
- }
419
- /**
420
- * Resolved attractor with defaults applied
421
- */
422
- interface ResolvedAttractor {
423
- id: string;
424
- position: Vec3;
425
- groups: string[];
426
- strength: number;
427
- radius: number;
428
- }
429
- //#endregion
430
- //#region textures/StaticAssets.d.ts
431
- /**
432
- * Manages read-only GPU textures created at initialization
433
- * These never change during simulation (except for mode changes)
434
- *
435
- * Node data: radii, colors
436
- * Link data: source/target indices, properties
437
- */
438
- declare class StaticAssets {
439
- private nodeRadiiTexture;
440
- private nodeColorsTexture;
441
- private linkIndicesTexture;
442
- private linkPropertiesTexture;
443
- private nodeLinkMapTexture;
444
- private nodeTextureSize;
445
- private linkTextureSize;
446
- constructor();
447
- /**
448
- * Set/update node radii texture
449
- */
450
- setNodeRadii(radii: Float32Array, textureSize: number): void;
451
- /**
452
- * Set/update node colors texture
453
- */
454
- setNodeColors(colors: Float32Array, textureSize: number): void;
455
- /**
456
- * Set link indices (source/target pairs)
457
- * Format: [sourceX, sourceY, targetX, targetY] per link
458
- */
459
- setLinkIndices(linkIndices: Float32Array, textureSize: number): void;
460
- /**
461
- * Set link properties (strength, distance, etc.)
462
- */
463
- setLinkProperties(linkProperties: Float32Array, textureSize: number): void;
464
- setNodeLinkMap(linkMap: Float32Array, textureSize: number): void;
465
- /**
466
- * Create a data texture with proper settings for GPU compute
467
- */
468
- private createTexture;
469
- getNodeRadiiTexture(): THREE.DataTexture | null;
470
- getNodeColorsTexture(): THREE.DataTexture | null;
471
- getLinkIndicesTexture(): THREE.DataTexture | null;
472
- getLinkPropertiesTexture(): THREE.DataTexture | null;
473
- getLinkMapTexture(): THREE.DataTexture | null;
474
- getNodeTextureSize(): number;
475
- getLinkTextureSize(): number;
476
- /**
477
- * Check if assets are ready
478
- */
479
- hasNodeAssets(): boolean;
480
- hasLinkAssets(): boolean;
481
- /**
482
- * Cleanup
483
- */
484
- dispose(): void;
485
- }
486
- declare const staticAssets: StaticAssets;
487
- //#endregion
488
- //#region simulation/BasePass.d.ts
489
- interface PassContext {
490
- scene: THREE.Scene;
491
- camera: THREE.Camera;
492
- quad: THREE.BufferGeometry;
493
- simBuffers: SimulationBuffers;
494
- assets: StaticAssets;
495
- renderer: THREE.WebGLRenderer;
496
- config: ForceConfig;
497
- textureSize: number;
498
- }
499
- /**
500
- * Base class for GPU force simulation passes
501
- * Each pass operates on simulation buffers and can read from static assets
502
- */
503
- declare abstract class BasePass {
504
- protected material: THREE.ShaderMaterial | null;
505
- protected enabled: boolean;
506
- /**
507
- * Get the name/identifier for this pass
508
- */
509
- abstract getName(): string;
510
- /**
511
- * Initialize the shader material for this pass
512
- */
513
- abstract initMaterial(context: PassContext): void;
514
- /**
515
- * Update uniforms before executing the pass
516
- */
517
- abstract updateUniforms(context: PassContext): void;
518
- /**
519
- * Execute the pass (renders to current velocity target)
520
- */
521
- execute(context: PassContext): void;
522
- /**
523
- * Render the compute shader
524
- */
525
- protected render(context: PassContext): void;
526
- /**
527
- * Create a shader material helper
528
- */
529
- protected createMaterial(vertexShader: string, fragmentShader: string, uniforms: {
530
- [uniform: string]: THREE.IUniform;
531
- }): THREE.ShaderMaterial;
532
- /**
533
- * Safe uniform setter - avoids TypeScript strict null check issues
534
- */
535
- protected setUniform(name: string, value: unknown): void;
536
- /**
537
- * Enable or disable this pass
538
- */
539
- setEnabled(enabled: boolean): void;
540
- /**
541
- * Check if pass is enabled
542
- */
543
- isEnabled(): boolean;
544
- /**
545
- * Get the material for external access
546
- */
547
- getMaterial(): THREE.ShaderMaterial | null;
548
- /**
549
- * Cleanup resources
550
- */
551
- dispose(): void;
552
- }
553
- //#endregion
554
- //#region simulation/passes/AttractorPass.d.ts
555
- /**
556
- * Attractor force pass - attracts nodes to attractor points based on group membership
557
- *
558
- * Usage:
559
- * attractorPass.setAttractors([
560
- * { id: 'center', position: { x: 0, y: 0, z: 0 }, categories: ['root'] }, // categories acts as groups
561
- * { id: 'left', position: { x: -100, y: 0, z: 0 }, categories: ['artwork', 'series'] }
562
- * ])
563
- */
564
- declare class AttractorPass extends BasePass {
565
- private attractors;
566
- private groupMap;
567
- private attractorsTexture;
568
- private attractorGroupsTexture;
569
- private attractorParamsTexture;
570
- private nodeGroupsTexture;
571
- getName(): string;
572
- initMaterial(context: PassContext): void;
573
- updateUniforms(context: PassContext): void;
574
- /**
575
- * Set attractors for the simulation
576
- */
577
- setAttractors(attractors: Attractor[]): void;
578
- /**
579
- * Add a single attractor
580
- */
581
- addAttractor(attractor: Attractor): void;
582
- /**
583
- * Remove an attractor by ID
584
- */
585
- removeAttractor(id: string): void;
586
- /**
587
- * Update an existing attractor's position
588
- */
589
- updateAttractorPosition(id: string, position: Vec3): void;
590
- /**
591
- * Get current attractors
592
- */
593
- getAttractors(): ResolvedAttractor[];
594
- /**
595
- * Set node groups from graph data
596
- * Call this when graph data changes or grouping criteria changes
597
- */
598
- setNodeGroups(groups: string[][], textureSize: number): void;
599
- /**
600
- * Get the group map (group name -> index)
601
- */
602
- getGroupMap(): Map<string, number>;
603
- private createAttractorTextures;
604
- private updateAttractorTextures;
605
- dispose(): void;
606
- }
607
- //#endregion
608
- //#region simulation/ForceSimulation.d.ts
609
- /**
610
- * ForceSimulation - GPU-based force simulation
611
- *
612
- * Simple architecture:
613
- * - Single shared config object (ForceConfig)
614
- * - All passes read directly from config via PassContext
615
- * - Enable flags control which passes execute
616
- * - No manual syncing required
617
- */
618
- declare class ForceSimulation {
619
- private renderer;
620
- private simulationBuffers;
621
- private computeScene;
622
- private computeCamera;
623
- private computeQuad;
624
- private velocityCarryPass;
625
- private collisionPass;
626
- private manyBodyPass;
627
- private gravityPass;
628
- private linkPass;
629
- private elasticPass;
630
- private attractorPass;
631
- private dragPass;
632
- private integratePass;
633
- private forcePasses;
634
- readonly config: ForceConfig;
635
- private isInitialized;
636
- private iterationCount;
637
- constructor(renderer: THREE.WebGLRenderer);
638
- private createComputeQuad;
639
- /**
640
- * Initialize simulation with buffers
641
- */
642
- initialize(simulationBuffers: SimulationBuffers): void;
643
- private createContext;
644
- /**
645
- * Check if a pass should execute based on config
646
- */
647
- private shouldExecutePass;
648
- /**
649
- * Run one simulation step
650
- */
651
- step(deltaTime?: number): void;
652
- /**
653
- * Get config for GUI binding
654
- * Modify this object directly - changes take effect on next step()
655
- */
656
- getConfig(): ForceConfig;
657
- /**
658
- * Re-heat the simulation (set alpha to 1)
659
- */
660
- reheat(amt?: number): void;
661
- startDrag(index: number, targetWorldPos: THREE.Vector3): void;
662
- updateDrag(targetWorldPos: THREE.Vector3): void;
663
- endDrag(): void;
664
- /**
665
- * Set attractors for category-based attraction
666
- * @param attractors Array of attractor definitions
667
- */
668
- setAttractors(attractors: Attractor[]): void;
669
- /**
670
- * Add a single attractor
671
- */
672
- addAttractor(attractor: Attractor): void;
673
- /**
674
- * Remove an attractor by ID
675
- */
676
- removeAttractor(id: string): void;
677
- /**
678
- * Update an attractor's position (useful for animated attractors)
679
- */
680
- updateAttractorPosition(id: string, position: Vec3): void;
681
- /**
682
- * Get current attractors
683
- */
684
- getAttractors(): Attractor[];
685
- /**
686
- * Set node logic for attractor matching
687
- * Call this when graph data changes
688
- */
689
- setNodeGroups(groups: (string | string[])[]): void;
690
- setNodeGroupsFromData<T>(data: T[], accessor: (item: T, index: number) => string | string[] | undefined): void;
691
- /**
692
- * Get the attractor pass for direct access
693
- */
694
- getAttractorPass(): AttractorPass;
695
- getAlpha(): number;
696
- getIterationCount(): number;
697
- reset(): void;
698
- dispose(): void;
699
- }
700
- //#endregion
701
- //#region controls/handlers/DragHandler.d.ts
702
- declare class DragHandler extends EventEmitter {
703
- private getNodeByIndex;
704
- private cameraController?;
705
- private forceSimulation?;
706
- private viewport?;
707
- private isDragging;
708
- private raycaster;
709
- private dragPlane;
710
- private pointer;
711
- constructor(getNodeByIndex: (index: number) => GraphNode | null, cameraController?: CameraController, forceSimulation?: ForceSimulation, viewport?: {
712
- width: number;
713
- height: number;
714
- });
715
- /**
716
- * Set up drag plane perpendicular to camera, passing through a world point
717
- */
718
- private setupDragPlane;
719
- private handleDragStart;
720
- private handleDrag;
721
- private handleDragEnd;
722
- /**
723
- * Convert screen coordinates to world position on drag plane
724
- */
725
- private screenToWorld;
726
- /**
727
- * Update viewport dimensions on resize
728
- */
729
- resize(width: number, height: number): void;
730
- dispose(): void;
731
- }
732
- //#endregion
733
- //#region textures/PickBuffer.d.ts
734
- /**
735
- * Manages GPU picking buffer for mouse interaction
736
- * Separate from simulation buffers as it has different lifecycle
737
- */
738
- declare class PickBuffer {
739
- private renderer;
740
- private pickTarget;
741
- constructor(renderer: THREE.WebGLRenderer);
742
- /**
743
- * Ensure pick buffer matches viewport size
744
- */
745
- resize(width: number, height: number): void;
746
- private createPickBuffer;
747
- /**
748
- * Read node ID at pixel coordinates
749
- */
750
- readIdAt(x: number, y: number): number;
751
- /**
752
- * Render scene to pick buffer
753
- */
754
- render(scene: THREE.Scene, camera: THREE.Camera): void;
755
- getTarget(): THREE.WebGLRenderTarget | null;
756
- dispose(): void;
757
- }
758
- //#endregion
759
- //#region rendering/links/LinksRenderer.d.ts
760
- /**
761
- * LinksRenderer - Renders links as line segments
762
- * Uses shared SimulationBuffers for node positions
763
- * Manages link-specific opacity and highlighting
764
- */
765
- declare class LinksRenderer {
766
- private scene;
767
- private renderer;
768
- private lines;
769
- private links;
770
- private nodeIndexMap;
771
- private linkIndexMap;
772
- private interpolationSteps;
773
- params: {
774
- noiseStrength: number;
775
- defaultAlpha: number;
776
- highlightAlpha: number;
777
- dimmedAlpha: number;
778
- is2D: boolean;
779
- };
780
- private linkOpacity;
781
- private simulationBuffers;
782
- constructor(scene: THREE.Scene, renderer: THREE.WebGLRenderer);
783
- /**
784
- * Create link geometry and materials
785
- * Receives shared buffers as dependencies
786
- */
787
- create(links: GraphLink[], nodes: GraphNode[], simulationBuffers: SimulationBuffers): void;
788
- /**
789
- * Update position texture from simulation
790
- * This is the SHARED texture used by both nodes and links
791
- */
792
- setPositionTexture(positionTexture: THREE.Texture): void;
793
- /**
794
- * Update shader uniforms (called each frame)
795
- */
796
- update(time: number): void;
797
- /**
798
- * Update link opacity (called every frame)
799
- */
800
- updateOpacity(): void;
801
- /**
802
- * Highlight links connected to a specific node
803
- */
804
- highlightConnectedLinks(nodeId: string, step?: number): void;
805
- /**
806
- * Clear all highlights (return to defaultAlpha)
807
- */
808
- clearHighlights(step?: number): void;
809
- /**
810
- * Update noise strength parameter
811
- */
812
- setNoiseStrength(strength: number): void;
813
- /**
814
- * Update alpha parameters
815
- */
816
- setAlphaParams(params: {
817
- defaultAlpha?: number;
818
- highlightAlpha?: number;
819
- dimmedAlpha?: number;
820
- }): void;
821
- /**
822
- * Unified configuration method
823
- */
824
- setOptions(options: LinkOptions): void;
825
- /**
826
- * Refresh shader uniforms when params change
827
- */
828
- refreshUniforms(): void;
829
- /**
830
- * Handle window resize
831
- */
832
- resize(width: number, height: number): void;
833
- /**
834
- * Set visibility of links
835
- */
836
- setVisible(visible: boolean): void;
837
- /**
838
- * Check if links are visible
839
- */
840
- isVisible(): boolean;
841
- /**
842
- * Cleanup
843
- */
844
- dispose(): void;
845
- /**
846
- * Build node index mapping
847
- */
848
- private buildNodeMapping;
849
- /**
850
- * Create link geometry with interpolated segments
851
- */
852
- private createLinkGeometry;
853
- /**
854
- * Build all link-related textures for simulation
855
- * - linkIndicesData: parent node INDEX per link entry (organized by child)
856
- * - linkPropertiesData: strength/distance per link entry
857
- * - nodeLinkMapData: per-node metadata (startX, startY, count, hasLinks)
858
- */
859
- private buildLinkTextures;
860
- /**
861
- * Create render material with all uniforms
862
- */
863
- private createRenderMaterial;
864
- }
865
- interface LinkOptions {
866
- visible?: boolean;
867
- noiseStrength?: number;
868
- alpha?: {
869
- default?: number;
870
- highlight?: number;
871
- dimmed?: number;
872
- };
873
- }
874
- //#endregion
875
- //#region rendering/nodes/NodesRenderer.d.ts
876
- declare class NodesRenderer {
877
- private scene;
878
- private renderer;
879
- private points;
880
- private pickMaterial;
881
- private nodeIndexMap;
882
- private idArray;
883
- private nodeOpacity;
884
- private targets;
885
- params: {
886
- defaultAlpha: number;
887
- highlightAlpha: number;
888
- dimmedAlpha: number;
889
- };
890
- private simulationBuffers;
891
- private pickBuffer;
892
- constructor(scene: THREE.Scene, renderer: THREE.WebGLRenderer);
893
- create(nodes: GraphNode[], simulationBuffers: SimulationBuffers, pickBuffer: PickBuffer): void;
894
- setPositionTexture(positionTexture: THREE.Texture): void;
895
- pick(pixelX: number, pixelY: number, camera: THREE.Camera): number;
896
- highlight(nodeIds: string[], step?: number): void;
897
- clearHighlights(step?: number): void;
898
- /**
899
- * Update node opacity (called every frame)
900
- */
901
- updateOpacity(): void;
902
- resize(width: number, height: number): void;
903
- dispose(): void;
904
- private buildNodeMapping;
905
- /**
906
- * Create all node data in one pass
907
- * Returns: colors, sizes, radii, nodeIds, pointIndices, alphaIndex
908
- */
909
- private createNodeData;
910
- private createGeometry;
911
- private createRenderMaterial;
912
- private createPickMaterial;
913
- }
914
- //#endregion
915
- //#region rendering/GraphScene.d.ts
916
- /**
917
- * GraphScene - Manages the 3D scene, camera, and renderers
918
- * Responsibilities:
919
- * - Scene setup and lifecycle
920
- * - Node and link rendering
921
- * - Camera control
922
- * - Tooltip management
923
- * - Mode application (visual changes)
924
- */
925
- declare class GraphScene {
926
- readonly scene: THREE.Scene;
927
- readonly renderer: THREE.WebGLRenderer;
928
- readonly camera: CameraController;
929
- private nodeRenderer;
930
- private clock;
931
- private linkRenderer;
932
- constructor(canvas: HTMLCanvasElement, cameraConfig?: CameraConfig);
933
- /**
934
- * Initialize scene with nodes and links
935
- */
936
- create(nodes: GraphNode[], links: GraphLink[], simulationBuffers: SimulationBuffers, pickBuffer: PickBuffer, groupOrder?: string[]): void;
937
- /**
938
- * Apply visual mode (colors, sizes, camera position)
939
- */
940
- applyMode(mode: string, options?: {
941
- transitionDuration?: number;
942
- cameraTransitionDuration?: number;
943
- }): void;
944
- /**
945
- * Update position textures from simulation
946
- */
947
- updatePositions(positionTexture: THREE.Texture): void;
948
- /**
949
- * Update time-based uniforms (called each frame with elapsed time)
950
- */
951
- update(elapsedTime: number): void;
952
- /**
953
- * GPU picking at canvas coordinates
954
- */
955
- pick(pixelX: number, pixelY: number): number;
956
- /**
957
- * Render the scene
958
- */
959
- render(): void;
960
- /**
961
- * Handle window resize
962
- */
963
- resize(width: number, height: number): void;
964
- /**
965
- * Cleanup all resources
966
- */
967
- dispose(): void;
968
- private applyDefaultMode;
969
- getCamera(): CameraController;
970
- getNodeRenderer(): NodesRenderer | null;
971
- getLinkRenderer(): LinksRenderer | null;
972
- }
973
- //#endregion
974
- //#region ui/TooltipManager.d.ts
975
- declare class TooltipManager {
976
- private container;
977
- private canvas;
978
- private mainTooltip;
979
- private previewTooltip;
980
- private chainTooltips;
981
- private config;
982
- private closeButton;
983
- private onCloseCallback?;
984
- constructor(container: HTMLElement, canvas: HTMLCanvasElement, config?: TooltipConfig);
985
- /**
986
- * Show grab cursor when hovering over a node
987
- */
988
- showGrabIcon(x: number, y: number, progress: number): void;
989
- hideGrabIcon(): void;
990
- /**
991
- * Show preview tooltip (triggered by pop event when hover reaches 1.0)
992
- */
993
- showPreview(node: GraphNode, x: number, y: number): void;
994
- hidePreview(): void;
995
- /**
996
- * Show full tooltip (triggered by click)
997
- */
998
- showFull(node: GraphNode, x: number, y: number): void;
999
- hideFull(): void;
1000
- /**
1001
- * Set callback for when tooltip is closed
1002
- */
1003
- setOnCloseCallback(callback: () => void): void;
1004
- /**
1005
- * Add close button to tooltip
1006
- */
1007
- private addCloseButton;
1008
- /**
1009
- * Remove close button from tooltip
1010
- */
1011
- private removeCloseButton;
1012
- /**
1013
- * Hide all tooltips
1014
- */
1015
- hideAll(): void;
1016
- /**
1017
- * Generate preview content (subset of fields)
1018
- */
1019
- private generatePreviewContent;
1020
- /**
1021
- * Generate full tooltip content (all fields)
1022
- */
1023
- private generateFullContent;
1024
- private escapeHtml;
1025
- showMainTooltip(content: string, x: number, y: number): void;
1026
- hideMainTooltip(): void;
1027
- showChainTooltip(nodeId: string, content: string, x: number, y: number): void;
1028
- hideChainTooltips(): void;
1029
- updateMainTooltipPos(x: number, y: number): void;
1030
- dispose(): void;
1031
- }
1032
- //#endregion
1033
- //#region controls/InteractionManager.d.ts
1034
- declare class InteractionManager {
1035
- private graphScene?;
1036
- private getConnectedNodeIds?;
1037
- private pointerInput;
1038
- private hoverHandler;
1039
- private clickHandler;
1040
- private dragHandler;
1041
- tooltipManager: TooltipManager;
1042
- private isDragging;
1043
- isTooltipSticky: boolean;
1044
- stickyNodeId: string | null;
1045
- searchHighlightIds: string[];
1046
- constructor(pickFunction: (x: number, y: number) => number, canvas: HTMLCanvasElement, viewport: {
1047
- width: number;
1048
- height: number;
1049
- }, getNodeByIndex: (index: number) => GraphNode | null, cameraController?: CameraController, forceSimulation?: ForceSimulation, tooltipConfig?: TooltipConfig, graphScene?: GraphScene, getConnectedNodeIds?: (nodeId: string) => string[]);
1050
- private wireEvents;
1051
- private wireTooltipEvents;
1052
- /**
1053
- * Wire visual feedback events (opacity, highlighting)
1054
- * Centralized control of visual responses to interactions
1055
- */
1056
- private wireVisualFeedbackEvents;
1057
- getPointerInput(): InputProcessor;
1058
- getHoverHandler(): HoverHandler;
1059
- getClickHandler(): ClickHandler;
1060
- getDragHandler(): DragHandler;
1061
- getTooltipManager(): TooltipManager;
1062
- isTooltipStickyOpen(): boolean;
1063
- /**
1064
- * Update viewport dimensions on resize
1065
- */
1066
- resize(width: number, height: number): void;
1067
- cleanup(): void;
1068
- dispose(): void;
1069
- }
1070
- //#endregion
1071
- //#region core/Clock.d.ts
1072
- /**
1073
- * Clock - Unified timing for the force graph package
1074
- */
1075
- declare class Clock {
1076
- private previousTime;
1077
- private elapsedTime;
1078
- private deltaTime;
1079
- private isRunning;
1080
- private maxDeltaTime;
1081
- constructor();
1082
- /**
1083
- * Start the clock
1084
- */
1085
- start(): void;
1086
- /**
1087
- * Stop the clock
1088
- */
1089
- stop(): void;
1090
- /**
1091
- * Update the clock - call once per frame
1092
- * @returns delta time in seconds
1093
- */
1094
- update(): number;
1095
- /**
1096
- * Get delta time in seconds
1097
- */
1098
- getDeltaTime(): number;
1099
- /**
1100
- * Get total elapsed time in seconds
1101
- */
1102
- getElapsedTime(): number;
1103
- /**
1104
- * Check if clock is running
1105
- */
1106
- getIsRunning(): boolean;
1107
- }
1108
- //#endregion
1109
- //#region core/GraphStore.d.ts
1110
- /**
1111
- * GraphStore - Central data management
1112
- * Responsibilities:
1113
- * - Store raw graph data (nodes, links)
1114
- * - Node/Link CRUD operations
1115
- * - ID mapping and lookups
1116
- * - Data validation
1117
- * - Change notifications
1118
- */
1119
- declare class GraphStore {
1120
- private nodes;
1121
- private links;
1122
- private nodeArray;
1123
- private linkArray;
1124
- private nodeIdToIndex;
1125
- private linkIdToIndex;
1126
- private nodeToLinks;
1127
- constructor();
1128
- /**
1129
- * Set graph data (replaces all)
1130
- */
1131
- setData(data: GraphData): void;
1132
- /**
1133
- * Add nodes
1134
- */
1135
- addNodes(nodes: GraphNode[]): void;
1136
- /**
1137
- * Remove nodes (and connected links)
1138
- */
1139
- removeNodes(nodeIds: string[]): void;
1140
- /**
1141
- * Add links
1142
- */
1143
- addLinks(links: GraphLink[]): void;
1144
- /**
1145
- * Remove links
1146
- */
1147
- removeLinks(linkIds: string[]): void;
1148
- /**
1149
- * Get all nodes as array
1150
- */
1151
- getNodes(): GraphNode[];
1152
- /**
1153
- * Get all links as array
1154
- */
1155
- getLinks(): GraphLink[];
1156
- /**
1157
- * Get connected node IDs for a given node
1158
- */
1159
- getConnectedNodeIds(nodeId: string): string[];
1160
- /**
1161
- * Get node by ID
1162
- */
1163
- getNodeById(id: string): GraphNode | null;
1164
- /**
1165
- * Get node by index
1166
- */
1167
- getNodeByIndex(index: number): GraphNode | null;
1168
- /**
1169
- * Get node index
1170
- */
1171
- getNodeIndex(id: string): number;
1172
- /**
1173
- * Get link by ID
1174
- */
1175
- getLinkById(id: string): GraphLink | null;
1176
- /**
1177
- * Get links connected to node
1178
- */
1179
- getNodeLinks(nodeId: string): GraphLink[];
1180
- /**
1181
- * Get node count
1182
- */
1183
- getNodeCount(): number;
1184
- /**
1185
- * Get link count
1186
- */
1187
- getLinkCount(): number;
1188
- /**
1189
- * Clear all data
1190
- */
1191
- clear(): void;
1192
- private getLinkId;
1193
- private addLinkConnectivity;
1194
- private removeLinkConnectivity;
1195
- private rebuildNodeArrays;
1196
- private rebuildLinkArrays;
1197
- }
1198
- //#endregion
1199
- //#region core/Engine.d.ts
1200
- interface EngineOptions {
1201
- width?: number;
1202
- height?: number;
1203
- backgroundColor?: string;
1204
- tooltipConfig?: TooltipConfig;
1205
- groupOrder?: string[];
1206
- }
1207
- /**
1208
- * Engine - Main orchestrator
1209
- * Responsibilities:
1210
- * - Owns all shared buffers (StaticAssets, SimulationBuffers, PickBuffer)
1211
- * - Coordinates GraphStore, GraphScene, ForceSimulation
1212
- * - Manages render loop
1213
- * - Handles user interaction
1214
- */
1215
- declare class Engine {
1216
- readonly canvas: HTMLCanvasElement;
1217
- readonly graphStore: GraphStore;
1218
- private graphScene;
1219
- private forceSimulation;
1220
- interactionManager: InteractionManager;
1221
- private clock;
1222
- private simulationBuffers;
1223
- private pickBuffer;
1224
- private animationFrameId;
1225
- private isRunning;
1226
- private boundResizeHandler;
1227
- private groupOrder?;
1228
- constructor(canvas: HTMLCanvasElement, options?: EngineOptions);
1229
- /**
1230
- * Handle window resize event
1231
- */
1232
- private handleWindowResize;
1233
- /**
1234
- * Set graph data
1235
- */
1236
- setData(data: GraphData): void;
1237
- /**
1238
- * Update node states based on a callback
1239
- * This allows changing visibility/behavior without resetting the simulation
1240
- */
1241
- updateNodeStates(callback: (node: GraphNode) => NodeState): void;
1242
- /**
1243
- * Reheat the simulation
1244
- */
1245
- reheat(alpha?: number): void;
1246
- /**
1247
- * Set alpha decay
1248
- */
1249
- setAlphaDecay(decay: number): void;
1250
- /**
1251
- * Get current alpha
1252
- */
1253
- getAlpha(): number;
1254
- /**Apply a preset to the graph
1255
- */
1256
- applyPreset(preset: GraphPreset): void;
1257
- /**
1258
- *
1259
- * Start render loop
1260
- */
1261
- start(): void;
1262
- /**
1263
- * Stop render loop
1264
- */
1265
- stop(): void;
1266
- /**
1267
- * Render loop
1268
- */
1269
- private animate;
1270
- /**
1271
- * GPU pick node at canvas coordinates
1272
- */
1273
- pickNode(x: number, y: number): string | null;
1274
- /**
1275
- * Get node by ID
1276
- */
1277
- getNodeById(id: string): GraphNode | null;
1278
- /**
1279
- * Highlight nodes
1280
- */
1281
- highlightNodes(nodeIds: string[]): void;
1282
- /**
1283
- * Clear highlights
1284
- */
1285
- clearHighlights(): void;
1286
- /**
1287
- * Get node position in 3D space
1288
- */
1289
- getNodePosition(nodeId: string): THREE.Vector3 | null;
1290
- /**
1291
- * Programmatically select a node (highlight + tooltip)
1292
- */
1293
- selectNode(nodeId: string): void;
1294
- /**
1295
- * Resize canvas and all dependent components
1296
- */
1297
- resize(width: number, height: number): void;
1298
- /**
1299
- * Get the unified clock for timing information
1300
- */
1301
- getClock(): Clock;
1302
- /**
1303
- * Get all nodes
1304
- */
1305
- get nodes(): GraphNode[];
1306
- /**
1307
- * Get all links
1308
- */
1309
- get links(): GraphLink[];
1310
- /**
1311
- * Get force simulation for external configuration (GUI binding)
1312
- */
1313
- get simulation(): ForceSimulation;
1314
- /**
1315
- * Get camera controller for external configuration
1316
- */
1317
- get camera(): CameraController;
1318
- /**
1319
- * Set camera mode (Orbit, Map, Fly)
1320
- */
1321
- setCameraMode(mode: CameraMode): void;
1322
- /**
1323
- * Animate camera to look at a specific target from a specific position
1324
- */
1325
- setCameraLookAt(position: {
1326
- x: number;
1327
- y: number;
1328
- z: number;
1329
- }, target: {
1330
- x: number;
1331
- y: number;
1332
- z: number;
1333
- }, transitionDuration?: number): Promise<void>;
1334
- /**
1335
- * Focus camera on a specific target node
1336
- */
1337
- setCameraFocus(target: {
1338
- x: number;
1339
- y: number;
1340
- z: number;
1341
- }, distance: number, transitionDuration?: number): Promise<void>;
1342
- /**
1343
- * Cleanup
1344
- */
1345
- dispose(): void;
1346
- private calculateTextureSize;
1347
- }
1348
- //#endregion
1349
- //#region core/StyleRegistry.d.ts
1350
- /** Color input - can be THREE.Color, hex number, or CSS color string */
1351
- type ColorInput = THREE.Color | number | string;
1352
- /**
1353
- * Visual properties for a node category (input)
1354
- */
1355
- interface NodeStyle {
1356
- color: ColorInput;
1357
- size: number;
1358
- }
1359
- /**
1360
- * Visual properties for a link category (input)
1361
- */
1362
- interface LinkStyle {
1363
- color: ColorInput;
1364
- }
1365
- /**
1366
- * Resolved node style with THREE.Color
1367
- */
1368
- interface ResolvedNodeStyle {
1369
- color: THREE.Color;
1370
- size: number;
1371
- }
1372
- /**
1373
- * Resolved link style with THREE.Color
1374
- */
1375
- interface ResolvedLinkStyle {
1376
- color: THREE.Color;
1377
- }
1378
- /**
1379
- * StyleRegistry - Manages visual styles for node and link categories
1380
- *
1381
- * Usage:
1382
- * styleRegistry.setNodeStyle('person', { color: 0xff0000, size: 20 })
1383
- * styleRegistry.setLinkStyle('friendship', { color: '#00ff00', width: 2 })
1384
- *
1385
- * const style = styleRegistry.getNodeStyle('person')
1386
- */
1387
- declare class StyleRegistry {
1388
- private nodeStyles;
1389
- private linkStyles;
1390
- private defaultNodeStyle;
1391
- private defaultLinkStyle;
1392
- /**
1393
- * Convert color input to THREE.Color
1394
- */
1395
- private toColor;
1396
- /**
1397
- * Set the default style for nodes without a category
1398
- */
1399
- setDefaultNodeStyle(style: Partial<NodeStyle>): void;
1400
- /**
1401
- * Set the default style for links without a category
1402
- */
1403
- setDefaultLinkStyle(style: Partial<LinkStyle>): void;
1404
- /**
1405
- * Register a style for a node category
1406
- */
1407
- setNodeStyle(category: string, style: NodeStyle): void;
1408
- /**
1409
- * Register multiple node styles at once
1410
- */
1411
- setNodeStyles(styles: Record<string, NodeStyle>): void;
1412
- /**
1413
- * Register a style for a link category
1414
- */
1415
- setLinkStyle(category: string, style: LinkStyle): void;
1416
- /**
1417
- * Register multiple link styles at once
1418
- */
1419
- setLinkStyles(styles: Record<string, LinkStyle>): void;
1420
- /**
1421
- * Get the resolved style for a node category
1422
- */
1423
- getNodeStyle(category?: string): ResolvedNodeStyle;
1424
- /**
1425
- * Get the resolved style for a link category
1426
- */
1427
- getLinkStyle(category?: string): ResolvedLinkStyle;
1428
- /**
1429
- * Check if a node category exists
1430
- */
1431
- hasNodeStyle(category: string): boolean;
1432
- /**
1433
- * Check if a link category exists
1434
- */
1435
- hasLinkStyle(category: string): boolean;
1436
- /**
1437
- * Remove a node style
1438
- */
1439
- removeNodeStyle(category: string): void;
1440
- /**
1441
- * Remove a link style
1442
- */
1443
- removeLinkStyle(category: string): void;
1444
- /**
1445
- * Clear all styles
1446
- */
1447
- clear(): void;
1448
- /**
1449
- * Get all registered node categories
1450
- */
1451
- getNodeCategories(): string[];
1452
- /**
1453
- * Get all registered link categories
1454
- */
1455
- getLinkCategories(): string[];
1456
- }
1457
- declare const styleRegistry: StyleRegistry;
1458
- //#endregion
1459
- //#region types/iEngineConfig.d.ts
1460
- interface EngineConfig {
1461
- container: HTMLElement;
1462
- width?: number;
1463
- height?: number;
1464
- antialias?: boolean;
1465
- alpha?: boolean;
1466
- }
1467
- //#endregion
1
+ import CameraControls from "camera-controls";
2
+ import * as THREE from "three";
3
+
4
+ //#region types/iCameraMode.d.ts
5
+ declare enum CameraMode {
6
+ Orbit = "orbit",
7
+ Map = "map"
8
+ }
9
+ //#endregion
10
+ //#region rendering/CameraController.d.ts
11
+ interface CameraConfig {
12
+ fov?: number;
13
+ aspect?: number;
14
+ near?: number;
15
+ far?: number;
16
+ position?: THREE.Vector3;
17
+ target?: THREE.Vector3;
18
+ minDistance?: number;
19
+ maxDistance?: number;
20
+ }
21
+ interface ControlsConfig {
22
+ smoothTime?: number;
23
+ dollyToCursor?: boolean;
24
+ infinityDolly?: boolean;
25
+ enableZoom?: boolean;
26
+ enableRotation?: boolean;
27
+ enablePan?: boolean;
28
+ minDistance?: number;
29
+ maxDistance?: number;
30
+ maxPolarAngle?: number;
31
+ minPolarAngle?: number;
32
+ minAzimuthAngle?: number;
33
+ maxAzimuthAngle?: number;
34
+ }
35
+ declare class CameraController {
36
+ camera: THREE.PerspectiveCamera;
37
+ controls: CameraControls;
38
+ private sceneBounds;
39
+ private autorotateEnabled;
40
+ private autorotateSpeed;
41
+ private userIsActive;
42
+ constructor(domelement: HTMLElement, config?: CameraConfig);
43
+ private setupDefaultControls;
44
+ /**
45
+ * Set camera control mode
46
+ */
47
+ setMode(mode: CameraMode): void;
48
+ /**
49
+ * Set camera boundary
50
+ */
51
+ setBoundary(box: THREE.Box3): void;
52
+ /**
53
+ * Update camera controls (should be called in render loop)
54
+ * Only autorotate if enabled and user is inactive
55
+ */
56
+ update(delta: number): boolean;
57
+ /**
58
+ * Set autorotate enabled/disabled
59
+ */
60
+ setAutorotate(enabled: boolean, speed?: number): void;
61
+ /**
62
+ * Set user activity state
63
+ */
64
+ setUserIsActive(isActive: boolean): void;
65
+ /**
66
+ * Configure camera controls
67
+ */
68
+ configureControls(config: ControlsConfig): void;
69
+ /**
70
+ * Resize camera when window resizes
71
+ */
72
+ resize(width: number, height: number): void;
73
+ /**
74
+ * Animate camera to look at a specific target from a specific position
75
+ */
76
+ setLookAt(position: THREE.Vector3, target: THREE.Vector3, enableTransition?: boolean): Promise<void>;
77
+ /**
78
+ * Reset camera to default position
79
+ */
80
+ reset(enableTransition?: boolean): Promise<void>;
81
+ /**
82
+ * Enable/disable controls
83
+ */
84
+ setEnabled(enabled: boolean): void;
85
+ /**
86
+ * Get current camera target (look-at point)
87
+ */
88
+ getTarget(out?: THREE.Vector3): THREE.Vector3;
89
+ /**
90
+ * Dispose camera manager and clean up
91
+ */
92
+ dispose(): void;
93
+ /**
94
+ * Clear camera bounds (remove boundary restrictions)
95
+ */
96
+ clearBounds(): void;
97
+ /**
98
+ * Get current scene bounds
99
+ */
100
+ getSceneBounds(): THREE.Box3 | null;
101
+ /**
102
+ * Update scene bounds used by the camera manager.
103
+ * Stores the bounds for future use (e.g. constraining controls).
104
+ */
105
+ updateBounds(box: THREE.Box3): void;
106
+ /**
107
+ * Unified configuration method
108
+ */
109
+ setOptions(options: {
110
+ controls?: ControlsConfig;
111
+ autoRotate?: boolean;
112
+ autoRotateSpeed?: number;
113
+ }): void;
114
+ }
115
+ //#endregion
116
+ //#region types/iGraphLink.d.ts
117
+ interface GraphLink {
118
+ source: string;
119
+ target: string;
120
+ }
121
+ //#endregion
122
+ //#region types/iGraphNode.d.ts
123
+ interface GraphNode {
124
+ id: string;
125
+ label?: string;
126
+ description?: string;
127
+ thumbnailUrl?: string;
128
+ category?: string;
129
+ x?: number;
130
+ y?: number;
131
+ z?: number;
132
+ fx?: number;
133
+ fy?: number;
134
+ fz?: number;
135
+ state?: NodeState;
136
+ metadata?: any;
137
+ }
138
+ declare enum NodeState {
139
+ Hidden = 0,
140
+ // = 0 not rendered
141
+ Passive = 1,
142
+ // = 1 rendered, not influencing simulation,
143
+ Fixed = 2,
144
+ // = 2 rendered, influencing simulation, but not moving
145
+ Active = 3
146
+ }
147
+ //#endregion
148
+ //#region types/iGraphData.d.ts
149
+ interface GraphData {
150
+ nodes: GraphNode[];
151
+ links: GraphLink[];
152
+ metadata?: any;
153
+ }
154
+ //#endregion
155
+ //#region types/iForceConfig.d.ts
156
+ interface ForceConfig {
157
+ collisionStrength: number;
158
+ collisionRadius: number;
159
+ collisionMaxDistance: number;
160
+ enableCollision: boolean;
161
+ manyBodyStrength: number;
162
+ manyBodyMinDistance: number;
163
+ manyBodyMaxDistance: number;
164
+ enableManyBody: boolean;
165
+ springStrength: number;
166
+ springLength: number;
167
+ springDamping: number;
168
+ maxLinks: number;
169
+ enableLinks: boolean;
170
+ gravity: number;
171
+ enableGravity: boolean;
172
+ attractorStrength: number;
173
+ enableAttractors: boolean;
174
+ elasticStrength: number;
175
+ enableElastic: boolean;
176
+ dragStrength: number;
177
+ damping: number;
178
+ alpha: number;
179
+ alphaDecay: number;
180
+ deltaTime: number;
181
+ spaceSize: number;
182
+ is3D: boolean;
183
+ }
184
+ //#endregion
185
+ //#region types/iGraphPreset.d.ts
186
+ interface GraphPreset {
187
+ name: string;
188
+ force?: Partial<ForceConfig>;
189
+ camera?: {
190
+ mode?: CameraMode;
191
+ position?: {
192
+ x: number;
193
+ y: number;
194
+ z: number;
195
+ };
196
+ target?: {
197
+ x: number;
198
+ y: number;
199
+ z: number;
200
+ };
201
+ zoom?: number;
202
+ transitionDuration?: number;
203
+ minDistance?: number;
204
+ maxDistance?: number;
205
+ boundary?: {
206
+ min: {
207
+ x: number;
208
+ y: number;
209
+ z: number;
210
+ };
211
+ max: {
212
+ x: number;
213
+ y: number;
214
+ z: number;
215
+ };
216
+ } | null;
217
+ };
218
+ nodes?: {
219
+ state?: (node: GraphNode) => NodeState;
220
+ };
221
+ links?: {
222
+ opacity?: number;
223
+ noiseStrength?: number;
224
+ };
225
+ }
226
+ //#endregion
227
+ //#region ui/Tooltips.d.ts
228
+ /**
229
+ * Renderer function type for custom tooltip rendering
230
+ * Can mount React, Vue, or any other framework component
231
+ */
232
+ type TooltipRenderer = (container: HTMLElement, node: GraphNode, type: 'preview' | 'full', x: number, y: number, onPositionUpdate?: (callback: (x: number, y: number) => void) => void) => void | (() => void);
233
+ /**
234
+ * Cursor handler for custom cursor behavior
235
+ */
236
+ type CursorHandler = (canvas: HTMLCanvasElement | null, state: 'default' | 'pointer' | 'grab') => void;
237
+ interface TooltipConfig {
238
+ /** Custom renderer for tooltips (React, Vue, etc.) */
239
+ renderer?: TooltipRenderer;
240
+ /** Custom cursor handler */
241
+ cursorHandler?: CursorHandler;
242
+ }
243
+ //#endregion
244
+ //#region core/EventEmitter.d.ts
245
+ declare class EventEmitter {
246
+ private listeners;
247
+ protected listenerCount(event: string): number;
248
+ on(event: string, listener: Function): () => void;
249
+ off(event: string, listener: Function): void;
250
+ emit(event: string, ...args: any[]): void;
251
+ }
252
+ //#endregion
253
+ //#region controls/InputProcessor.d.ts
254
+ /**
255
+ * Manages pointer/mouse input and emits interaction events
256
+ * Uses GPU picking for efficient node detection
257
+ */
258
+ declare class InputProcessor extends EventEmitter {
259
+ private pickFn;
260
+ private canvas;
261
+ private viewport;
262
+ private readonly CLICK_THRESHOLD;
263
+ private readonly HOVER_TO_POP_MS;
264
+ private pointer;
265
+ private canvasPointer;
266
+ private isPointerDown;
267
+ private isDragging;
268
+ private mouseDownTime;
269
+ private draggedIndex;
270
+ private currentHoverIndex;
271
+ private hoverStartTime;
272
+ private hoverProgress;
273
+ private hasPopped;
274
+ private lastClientX;
275
+ private lastClientY;
276
+ constructor(pickFn: (x: number, y: number) => number, // Injected
277
+ canvas: HTMLCanvasElement, viewport: {
278
+ width: number;
279
+ height: number;
280
+ });
281
+ private setupEventListeners;
282
+ private handlePointerMove;
283
+ private handlePointerDown;
284
+ private handlePointerUp;
285
+ private handlePointerLeave;
286
+ private updateHover;
287
+ /**
288
+ * Update hover state even when pointer is stationary
289
+ * Called from render loop
290
+ */
291
+ update(): void;
292
+ private updatePointer;
293
+ /**
294
+ * Update viewport dimensions on resize
295
+ */
296
+ resize(width: number, height: number): void;
297
+ dispose(): void;
298
+ }
299
+ //#endregion
300
+ //#region controls/handlers/HoverHandler.d.ts
301
+ declare class HoverHandler extends EventEmitter {
302
+ private getNodeByIndex;
303
+ constructor(getNodeByIndex: (index: number) => GraphNode | null);
304
+ private handleHoverStart;
305
+ private handleHover;
306
+ private handlePop;
307
+ private handleHoverEnd;
308
+ dispose(): void;
309
+ }
310
+ //#endregion
311
+ //#region controls/handlers/ClickHandler.d.ts
312
+ declare class ClickHandler extends EventEmitter {
313
+ private getNodeByIndex;
314
+ constructor(getNodeByIndex: (index: number) => GraphNode | null);
315
+ private handleClick;
316
+ dispose(): void;
317
+ }
318
+ //#endregion
319
+ //#region textures/SimulationBuffers.d.ts
320
+ /**
321
+ * Manages dynamic render targets updated by force simulation
322
+ * Uses ping-pong technique for GPU computation
323
+ * Buffers are created lazily when data is initialized
324
+ */
325
+ declare class SimulationBuffers {
326
+ private renderer;
327
+ private textureSize;
328
+ private positionBuffers;
329
+ private velocityBuffers;
330
+ private isInitialized;
331
+ constructor(renderer: THREE.WebGLRenderer);
332
+ /**
333
+ * Check if buffers are initialized
334
+ */
335
+ isReady(): boolean;
336
+ /**
337
+ * Initialize buffers with point count and initial positions
338
+ */
339
+ init(pointsCount: number, initialPositions?: Float32Array): void;
340
+ /**
341
+ * Resize buffers (re-initializes with new size)
342
+ */
343
+ resize(pointsCount: number, preserveData?: boolean): void;
344
+ private calculateTextureSize;
345
+ private createDynamicBuffer;
346
+ /**
347
+ * Initialize position buffers from initial data
348
+ */
349
+ setInitialPositions(positionArray: Float32Array): void;
350
+ /**
351
+ * Update current and previous positions, but keep original positions intact
352
+ */
353
+ updateCurrentPositions(positionArray: Float32Array): void;
354
+ /**
355
+ * Set original positions (anchors) separately from current positions
356
+ */
357
+ setOriginalPositions(positionArray: Float32Array): void;
358
+ /**
359
+ * Initialize velocity buffers (usually to zero)
360
+ */
361
+ initVelocities(): void;
362
+ /**
363
+ * Swap position buffers (ping-pong)
364
+ */
365
+ swapPositions(): void;
366
+ /**
367
+ * Swap velocity buffers (ping-pong)
368
+ */
369
+ swapVelocities(): void;
370
+ /**
371
+ * Reset positions to original state
372
+ */
373
+ resetPositions(): void;
374
+ /**
375
+ * Read current positions back from GPU (expensive operation)
376
+ * Returns RGBA float array (x, y, z, state)
377
+ */
378
+ readPositions(): Float32Array;
379
+ getCurrentPositionTarget(): THREE.WebGLRenderTarget | null;
380
+ getPreviousPositionTarget(): THREE.WebGLRenderTarget | null;
381
+ getCurrentPositionTexture(): THREE.Texture<unknown>;
382
+ getPreviousPositionTexture(): THREE.Texture | null;
383
+ getOriginalPositionTexture(): THREE.Texture | null;
384
+ getCurrentVelocityTarget(): THREE.WebGLRenderTarget | null;
385
+ getPreviousVelocityTarget(): THREE.WebGLRenderTarget | null;
386
+ getCurrentVelocityTexture(): THREE.Texture | null;
387
+ getPreviousVelocityTexture(): THREE.Texture | null;
388
+ getTextureSize(): number;
389
+ private arrayToTextureData;
390
+ private createDataTexture;
391
+ private copyTextureToBuffer;
392
+ private copyBufferToBuffer;
393
+ dispose(): void;
394
+ }
395
+ //#endregion
396
+ //#region types/iAttractor.d.ts
397
+ /**
398
+ * Simple 3D vector type
399
+ */
400
+ interface Vec3 {
401
+ x: number;
402
+ y: number;
403
+ z: number;
404
+ }
405
+ /**
406
+ * Attractor - A point in space that attracts nodes of specific groups
407
+ */
408
+ interface Attractor {
409
+ /** Unique identifier */
410
+ id: string;
411
+ /** Position in world space */
412
+ position: Vec3;
413
+ /** Radius of attraction (default: 0.0) - nodes within this radius are not pulled further */
414
+ radius?: number;
415
+ /** Groups of nodes attracted to this attractor (empty = attracts all) */
416
+ groups: string[];
417
+ /** Strength of attraction (default: 1.0) */
418
+ strength?: number;
419
+ }
420
+ /**
421
+ * Resolved attractor with defaults applied
422
+ */
423
+ interface ResolvedAttractor {
424
+ id: string;
425
+ position: Vec3;
426
+ groups: string[];
427
+ strength: number;
428
+ radius: number;
429
+ }
430
+ //#endregion
431
+ //#region textures/StaticAssets.d.ts
432
+ /**
433
+ * Manages read-only GPU textures created at initialization
434
+ * These never change during simulation (except for mode changes)
435
+ *
436
+ * Node data: radii, colors
437
+ * Link data: source/target indices, properties
438
+ */
439
+ declare class StaticAssets {
440
+ private nodeRadiiTexture;
441
+ private nodeColorsTexture;
442
+ private linkIndicesTexture;
443
+ private linkPropertiesTexture;
444
+ private nodeLinkMapTexture;
445
+ private nodeTextureSize;
446
+ private linkTextureSize;
447
+ constructor();
448
+ /**
449
+ * Set/update node radii texture
450
+ */
451
+ setNodeRadii(radii: Float32Array, textureSize: number): void;
452
+ /**
453
+ * Set/update node colors texture
454
+ */
455
+ setNodeColors(colors: Float32Array, textureSize: number): void;
456
+ /**
457
+ * Set link indices (source/target pairs)
458
+ * Format: [sourceX, sourceY, targetX, targetY] per link
459
+ */
460
+ setLinkIndices(linkIndices: Float32Array, textureSize: number): void;
461
+ /**
462
+ * Set link properties (strength, distance, etc.)
463
+ */
464
+ setLinkProperties(linkProperties: Float32Array, textureSize: number): void;
465
+ setNodeLinkMap(linkMap: Float32Array, textureSize: number): void;
466
+ /**
467
+ * Create a data texture with proper settings for GPU compute
468
+ */
469
+ private createTexture;
470
+ getNodeRadiiTexture(): THREE.DataTexture | null;
471
+ getNodeColorsTexture(): THREE.DataTexture | null;
472
+ getLinkIndicesTexture(): THREE.DataTexture | null;
473
+ getLinkPropertiesTexture(): THREE.DataTexture | null;
474
+ getLinkMapTexture(): THREE.DataTexture | null;
475
+ getNodeTextureSize(): number;
476
+ getLinkTextureSize(): number;
477
+ /**
478
+ * Check if assets are ready
479
+ */
480
+ hasNodeAssets(): boolean;
481
+ hasLinkAssets(): boolean;
482
+ /**
483
+ * Cleanup
484
+ */
485
+ dispose(): void;
486
+ }
487
+ declare const staticAssets: StaticAssets;
488
+ //#endregion
489
+ //#region simulation/BasePass.d.ts
490
+ interface PassContext {
491
+ scene: THREE.Scene;
492
+ camera: THREE.Camera;
493
+ quad: THREE.BufferGeometry;
494
+ simBuffers: SimulationBuffers;
495
+ assets: StaticAssets;
496
+ renderer: THREE.WebGLRenderer;
497
+ config: ForceConfig;
498
+ textureSize: number;
499
+ }
500
+ /**
501
+ * Base class for GPU force simulation passes
502
+ * Each pass operates on simulation buffers and can read from static assets
503
+ */
504
+ declare abstract class BasePass {
505
+ protected material: THREE.ShaderMaterial | null;
506
+ protected enabled: boolean;
507
+ /**
508
+ * Get the name/identifier for this pass
509
+ */
510
+ abstract getName(): string;
511
+ /**
512
+ * Initialize the shader material for this pass
513
+ */
514
+ abstract initMaterial(context: PassContext): void;
515
+ /**
516
+ * Update uniforms before executing the pass
517
+ */
518
+ abstract updateUniforms(context: PassContext): void;
519
+ /**
520
+ * Execute the pass (renders to current velocity target)
521
+ */
522
+ execute(context: PassContext): void;
523
+ /**
524
+ * Render the compute shader
525
+ */
526
+ protected render(context: PassContext): void;
527
+ /**
528
+ * Create a shader material helper
529
+ */
530
+ protected createMaterial(vertexShader: string, fragmentShader: string, uniforms: {
531
+ [uniform: string]: THREE.IUniform;
532
+ }): THREE.ShaderMaterial;
533
+ /**
534
+ * Safe uniform setter - avoids TypeScript strict null check issues
535
+ */
536
+ protected setUniform(name: string, value: unknown): void;
537
+ /**
538
+ * Enable or disable this pass
539
+ */
540
+ setEnabled(enabled: boolean): void;
541
+ /**
542
+ * Check if pass is enabled
543
+ */
544
+ isEnabled(): boolean;
545
+ /**
546
+ * Get the material for external access
547
+ */
548
+ getMaterial(): THREE.ShaderMaterial | null;
549
+ /**
550
+ * Cleanup resources
551
+ */
552
+ dispose(): void;
553
+ }
554
+ //#endregion
555
+ //#region simulation/passes/AttractorPass.d.ts
556
+ /**
557
+ * Attractor force pass - attracts nodes to attractor points based on group membership
558
+ *
559
+ * Usage:
560
+ * attractorPass.setAttractors([
561
+ * { id: 'center', position: { x: 0, y: 0, z: 0 }, categories: ['root'] }, // categories acts as groups
562
+ * { id: 'left', position: { x: -100, y: 0, z: 0 }, categories: ['artwork', 'series'] }
563
+ * ])
564
+ */
565
+ declare class AttractorPass extends BasePass {
566
+ private attractors;
567
+ private groupMap;
568
+ private attractorsTexture;
569
+ private attractorGroupsTexture;
570
+ private attractorParamsTexture;
571
+ private nodeGroupsTexture;
572
+ getName(): string;
573
+ initMaterial(context: PassContext): void;
574
+ updateUniforms(context: PassContext): void;
575
+ /**
576
+ * Set attractors for the simulation
577
+ */
578
+ setAttractors(attractors: Attractor[]): void;
579
+ /**
580
+ * Add a single attractor
581
+ */
582
+ addAttractor(attractor: Attractor): void;
583
+ /**
584
+ * Remove an attractor by ID
585
+ */
586
+ removeAttractor(id: string): void;
587
+ /**
588
+ * Update an existing attractor's position
589
+ */
590
+ updateAttractorPosition(id: string, position: Vec3): void;
591
+ /**
592
+ * Get current attractors
593
+ */
594
+ getAttractors(): ResolvedAttractor[];
595
+ /**
596
+ * Set node groups from graph data
597
+ * Call this when graph data changes or grouping criteria changes
598
+ */
599
+ setNodeGroups(groups: string[][], textureSize: number): void;
600
+ /**
601
+ * Get the group map (group name -> index)
602
+ */
603
+ getGroupMap(): Map<string, number>;
604
+ private createAttractorTextures;
605
+ private updateAttractorTextures;
606
+ dispose(): void;
607
+ }
608
+ //#endregion
609
+ //#region simulation/ForceSimulation.d.ts
610
+ /**
611
+ * ForceSimulation - GPU-based force simulation
612
+ *
613
+ * Simple architecture:
614
+ * - Single shared config object (ForceConfig)
615
+ * - All passes read directly from config via PassContext
616
+ * - Enable flags control which passes execute
617
+ * - No manual syncing required
618
+ */
619
+ declare class ForceSimulation {
620
+ private renderer;
621
+ private simulationBuffers;
622
+ private computeScene;
623
+ private computeCamera;
624
+ private computeQuad;
625
+ private velocityCarryPass;
626
+ private collisionPass;
627
+ private manyBodyPass;
628
+ private gravityPass;
629
+ private linkPass;
630
+ private elasticPass;
631
+ private attractorPass;
632
+ private dragPass;
633
+ private integratePass;
634
+ private forcePasses;
635
+ readonly config: ForceConfig;
636
+ private isInitialized;
637
+ private iterationCount;
638
+ constructor(renderer: THREE.WebGLRenderer);
639
+ private createComputeQuad;
640
+ /**
641
+ * Initialize simulation with buffers
642
+ */
643
+ initialize(simulationBuffers: SimulationBuffers): void;
644
+ private createContext;
645
+ /**
646
+ * Check if a pass should execute based on config
647
+ */
648
+ private shouldExecutePass;
649
+ /**
650
+ * Run one simulation step
651
+ */
652
+ step(deltaTime?: number): void;
653
+ /**
654
+ * Get config for GUI binding
655
+ * Modify this object directly - changes take effect on next step()
656
+ */
657
+ getConfig(): ForceConfig;
658
+ /**
659
+ * Re-heat the simulation (set alpha to 1)
660
+ */
661
+ reheat(amt?: number): void;
662
+ startDrag(index: number, targetWorldPos: THREE.Vector3): void;
663
+ updateDrag(targetWorldPos: THREE.Vector3): void;
664
+ endDrag(): void;
665
+ /**
666
+ * Set attractors for category-based attraction
667
+ * @param attractors Array of attractor definitions
668
+ */
669
+ setAttractors(attractors: Attractor[]): void;
670
+ /**
671
+ * Add a single attractor
672
+ */
673
+ addAttractor(attractor: Attractor): void;
674
+ /**
675
+ * Remove an attractor by ID
676
+ */
677
+ removeAttractor(id: string): void;
678
+ /**
679
+ * Update an attractor's position (useful for animated attractors)
680
+ */
681
+ updateAttractorPosition(id: string, position: Vec3): void;
682
+ /**
683
+ * Get current attractors
684
+ */
685
+ getAttractors(): Attractor[];
686
+ /**
687
+ * Set node logic for attractor matching
688
+ * Call this when graph data changes
689
+ */
690
+ setNodeGroups(groups: (string | string[])[]): void;
691
+ setNodeGroupsFromData<T>(data: T[], accessor: (item: T, index: number) => string | string[] | undefined): void;
692
+ /**
693
+ * Get the attractor pass for direct access
694
+ */
695
+ getAttractorPass(): AttractorPass;
696
+ getAlpha(): number;
697
+ getIterationCount(): number;
698
+ reset(): void;
699
+ dispose(): void;
700
+ }
701
+ //#endregion
702
+ //#region controls/handlers/DragHandler.d.ts
703
+ declare class DragHandler extends EventEmitter {
704
+ private getNodeByIndex;
705
+ private cameraController?;
706
+ private forceSimulation?;
707
+ private viewport?;
708
+ private isDragging;
709
+ private raycaster;
710
+ private dragPlane;
711
+ private pointer;
712
+ constructor(getNodeByIndex: (index: number) => GraphNode | null, cameraController?: CameraController, forceSimulation?: ForceSimulation, viewport?: {
713
+ width: number;
714
+ height: number;
715
+ });
716
+ /**
717
+ * Set up drag plane perpendicular to camera, passing through a world point
718
+ */
719
+ private setupDragPlane;
720
+ private handleDragStart;
721
+ private handleDrag;
722
+ private handleDragEnd;
723
+ /**
724
+ * Convert screen coordinates to world position on drag plane
725
+ */
726
+ private screenToWorld;
727
+ /**
728
+ * Update viewport dimensions on resize
729
+ */
730
+ resize(width: number, height: number): void;
731
+ dispose(): void;
732
+ }
733
+ //#endregion
734
+ //#region textures/PickBuffer.d.ts
735
+ /**
736
+ * Manages GPU picking buffer for mouse interaction
737
+ * Separate from simulation buffers as it has different lifecycle
738
+ */
739
+ declare class PickBuffer {
740
+ private renderer;
741
+ private pickTarget;
742
+ constructor(renderer: THREE.WebGLRenderer);
743
+ /**
744
+ * Ensure pick buffer matches viewport size
745
+ */
746
+ resize(width: number, height: number): void;
747
+ private createPickBuffer;
748
+ /**
749
+ * Read node ID at pixel coordinates
750
+ */
751
+ readIdAt(x: number, y: number): number;
752
+ /**
753
+ * Render scene to pick buffer
754
+ */
755
+ render(scene: THREE.Scene, camera: THREE.Camera): void;
756
+ getTarget(): THREE.WebGLRenderTarget | null;
757
+ dispose(): void;
758
+ }
759
+ //#endregion
760
+ //#region rendering/links/LinksRenderer.d.ts
761
+ /**
762
+ * LinksRenderer - Renders links as line segments
763
+ * Uses shared SimulationBuffers for node positions
764
+ * Manages link-specific opacity and highlighting
765
+ */
766
+ declare class LinksRenderer {
767
+ private scene;
768
+ private renderer;
769
+ private lines;
770
+ private links;
771
+ private nodeIndexMap;
772
+ private linkIndexMap;
773
+ private interpolationSteps;
774
+ params: {
775
+ noiseStrength: number;
776
+ defaultAlpha: number;
777
+ highlightAlpha: number;
778
+ dimmedAlpha: number;
779
+ is2D: boolean;
780
+ };
781
+ private linkOpacity;
782
+ private simulationBuffers;
783
+ constructor(scene: THREE.Scene, renderer: THREE.WebGLRenderer);
784
+ /**
785
+ * Create link geometry and materials
786
+ * Receives shared buffers as dependencies
787
+ */
788
+ create(links: GraphLink[], nodes: GraphNode[], simulationBuffers: SimulationBuffers): void;
789
+ /**
790
+ * Update position texture from simulation
791
+ * This is the SHARED texture used by both nodes and links
792
+ */
793
+ setPositionTexture(positionTexture: THREE.Texture): void;
794
+ /**
795
+ * Update shader uniforms (called each frame)
796
+ */
797
+ update(time: number): void;
798
+ /**
799
+ * Update link opacity (called every frame)
800
+ */
801
+ updateOpacity(): void;
802
+ /**
803
+ * Highlight links connected to a specific node
804
+ */
805
+ highlightConnectedLinks(nodeId: string, step?: number): void;
806
+ /**
807
+ * Clear all highlights (return to defaultAlpha)
808
+ */
809
+ clearHighlights(step?: number): void;
810
+ /**
811
+ * Update noise strength parameter
812
+ */
813
+ setNoiseStrength(strength: number): void;
814
+ /**
815
+ * Update alpha parameters
816
+ */
817
+ setAlphaParams(params: {
818
+ defaultAlpha?: number;
819
+ highlightAlpha?: number;
820
+ dimmedAlpha?: number;
821
+ }): void;
822
+ /**
823
+ * Unified configuration method
824
+ */
825
+ setOptions(options: LinkOptions): void;
826
+ /**
827
+ * Refresh shader uniforms when params change
828
+ */
829
+ refreshUniforms(): void;
830
+ /**
831
+ * Handle window resize
832
+ */
833
+ resize(width: number, height: number): void;
834
+ /**
835
+ * Set visibility of links
836
+ */
837
+ setVisible(visible: boolean): void;
838
+ /**
839
+ * Check if links are visible
840
+ */
841
+ isVisible(): boolean;
842
+ /**
843
+ * Cleanup
844
+ */
845
+ dispose(): void;
846
+ /**
847
+ * Build node index mapping
848
+ */
849
+ private buildNodeMapping;
850
+ /**
851
+ * Create link geometry with interpolated segments
852
+ */
853
+ private createLinkGeometry;
854
+ /**
855
+ * Build all link-related textures for simulation
856
+ * - linkIndicesData: parent node INDEX per link entry (organized by child)
857
+ * - linkPropertiesData: strength/distance per link entry
858
+ * - nodeLinkMapData: per-node metadata (startX, startY, count, hasLinks)
859
+ */
860
+ private buildLinkTextures;
861
+ /**
862
+ * Create render material with all uniforms
863
+ */
864
+ private createRenderMaterial;
865
+ }
866
+ interface LinkOptions {
867
+ visible?: boolean;
868
+ noiseStrength?: number;
869
+ alpha?: {
870
+ default?: number;
871
+ highlight?: number;
872
+ dimmed?: number;
873
+ };
874
+ }
875
+ //#endregion
876
+ //#region rendering/nodes/NodesRenderer.d.ts
877
+ declare class NodesRenderer {
878
+ private scene;
879
+ private renderer;
880
+ private points;
881
+ private pickMaterial;
882
+ private nodeIndexMap;
883
+ private idArray;
884
+ private nodeOpacity;
885
+ private targets;
886
+ params: {
887
+ defaultAlpha: number;
888
+ highlightAlpha: number;
889
+ dimmedAlpha: number;
890
+ };
891
+ private simulationBuffers;
892
+ private pickBuffer;
893
+ constructor(scene: THREE.Scene, renderer: THREE.WebGLRenderer);
894
+ create(nodes: GraphNode[], simulationBuffers: SimulationBuffers, pickBuffer: PickBuffer): void;
895
+ setPositionTexture(positionTexture: THREE.Texture): void;
896
+ pick(pixelX: number, pixelY: number, camera: THREE.Camera): number;
897
+ highlight(nodeIds: string[], step?: number): void;
898
+ clearHighlights(step?: number): void;
899
+ /**
900
+ * Update node opacity (called every frame)
901
+ */
902
+ updateOpacity(): void;
903
+ resize(width: number, height: number): void;
904
+ dispose(): void;
905
+ private buildNodeMapping;
906
+ /**
907
+ * Create all node data in one pass
908
+ * Returns: colors, sizes, radii, nodeIds, pointIndices, alphaIndex
909
+ */
910
+ private createNodeData;
911
+ private createGeometry;
912
+ private createRenderMaterial;
913
+ private createPickMaterial;
914
+ }
915
+ //#endregion
916
+ //#region rendering/GraphScene.d.ts
917
+ /**
918
+ * GraphScene - Manages the 3D scene, camera, and renderers
919
+ * Responsibilities:
920
+ * - Scene setup and lifecycle
921
+ * - Node and link rendering
922
+ * - Camera control
923
+ * - Tooltip management
924
+ * - Mode application (visual changes)
925
+ */
926
+ declare class GraphScene {
927
+ readonly scene: THREE.Scene;
928
+ readonly renderer: THREE.WebGLRenderer;
929
+ readonly camera: CameraController;
930
+ private nodeRenderer;
931
+ private clock;
932
+ private linkRenderer;
933
+ constructor(canvas: HTMLCanvasElement, cameraConfig?: CameraConfig);
934
+ /**
935
+ * Initialize scene with nodes and links
936
+ */
937
+ create(nodes: GraphNode[], links: GraphLink[], simulationBuffers: SimulationBuffers, pickBuffer: PickBuffer, groupOrder?: string[]): void;
938
+ /**
939
+ * Apply visual mode (colors, sizes, camera position)
940
+ */
941
+ applyMode(mode: string, options?: {
942
+ transitionDuration?: number;
943
+ cameraTransitionDuration?: number;
944
+ }): void;
945
+ /**
946
+ * Update position textures from simulation
947
+ */
948
+ updatePositions(positionTexture: THREE.Texture): void;
949
+ /**
950
+ * Update time-based uniforms (called each frame with elapsed time)
951
+ */
952
+ update(elapsedTime: number): void;
953
+ /**
954
+ * GPU picking at canvas coordinates
955
+ */
956
+ pick(pixelX: number, pixelY: number): number;
957
+ /**
958
+ * Render the scene
959
+ */
960
+ render(): void;
961
+ /**
962
+ * Handle window resize
963
+ */
964
+ resize(width: number, height: number): void;
965
+ /**
966
+ * Cleanup all resources
967
+ */
968
+ dispose(): void;
969
+ private applyDefaultMode;
970
+ getCamera(): CameraController;
971
+ getNodeRenderer(): NodesRenderer | null;
972
+ getLinkRenderer(): LinksRenderer | null;
973
+ }
974
+ //#endregion
975
+ //#region ui/TooltipManager.d.ts
976
+ declare class TooltipManager {
977
+ private container;
978
+ private canvas;
979
+ private mainTooltip;
980
+ private previewTooltip;
981
+ private chainTooltips;
982
+ private config;
983
+ private closeButton;
984
+ private onCloseCallback?;
985
+ constructor(container: HTMLElement, canvas: HTMLCanvasElement, config?: TooltipConfig);
986
+ /**
987
+ * Show grab cursor when hovering over a node
988
+ */
989
+ showGrabIcon(x: number, y: number, progress: number): void;
990
+ hideGrabIcon(): void;
991
+ /**
992
+ * Show preview tooltip (triggered by pop event when hover reaches 1.0)
993
+ */
994
+ showPreview(node: GraphNode, x: number, y: number): void;
995
+ hidePreview(): void;
996
+ /**
997
+ * Show full tooltip (triggered by click)
998
+ */
999
+ showFull(node: GraphNode, x: number, y: number): void;
1000
+ hideFull(): void;
1001
+ /**
1002
+ * Set callback for when tooltip is closed
1003
+ */
1004
+ setOnCloseCallback(callback: () => void): void;
1005
+ /**
1006
+ * Add close button to tooltip
1007
+ */
1008
+ private addCloseButton;
1009
+ /**
1010
+ * Remove close button from tooltip
1011
+ */
1012
+ private removeCloseButton;
1013
+ /**
1014
+ * Hide all tooltips
1015
+ */
1016
+ hideAll(): void;
1017
+ showMainTooltip(content: string, x: number, y: number): void;
1018
+ hideMainTooltip(): void;
1019
+ showChainTooltip(nodeId: string, content: string, x: number, y: number): void;
1020
+ hideChainTooltips(): void;
1021
+ updateMainTooltipPos(x: number, y: number): void;
1022
+ /**
1023
+ * Set main tooltip visibility (doesn't affect open state or content)
1024
+ */
1025
+ setMainTooltipVisibility(visible: boolean): void;
1026
+ dispose(): void;
1027
+ }
1028
+ //#endregion
1029
+ //#region controls/InteractionManager.d.ts
1030
+ declare class InteractionManager {
1031
+ private graphScene?;
1032
+ private getConnectedNodeIds?;
1033
+ private pointerInput;
1034
+ private hoverHandler;
1035
+ private clickHandler;
1036
+ private dragHandler;
1037
+ tooltipManager: TooltipManager;
1038
+ private isDragging;
1039
+ isTooltipSticky: boolean;
1040
+ stickyNodeId: string | null;
1041
+ searchHighlightIds: string[];
1042
+ constructor(pickFunction: (x: number, y: number) => number, canvas: HTMLCanvasElement, viewport: {
1043
+ width: number;
1044
+ height: number;
1045
+ }, getNodeByIndex: (index: number) => GraphNode | null, cameraController?: CameraController, forceSimulation?: ForceSimulation, tooltipConfig?: TooltipConfig, graphScene?: GraphScene, getConnectedNodeIds?: (nodeId: string) => string[]);
1046
+ private wireEvents;
1047
+ private wireTooltipEvents;
1048
+ /**
1049
+ * Wire visual feedback events (opacity, highlighting)
1050
+ * Centralized control of visual responses to interactions
1051
+ */
1052
+ private wireVisualFeedbackEvents;
1053
+ getPointerInput(): InputProcessor;
1054
+ getHoverHandler(): HoverHandler;
1055
+ getClickHandler(): ClickHandler;
1056
+ getDragHandler(): DragHandler;
1057
+ getTooltipManager(): TooltipManager;
1058
+ isTooltipStickyOpen(): boolean;
1059
+ /**
1060
+ * Update viewport dimensions on resize
1061
+ */
1062
+ resize(width: number, height: number): void;
1063
+ cleanup(): void;
1064
+ dispose(): void;
1065
+ }
1066
+ //#endregion
1067
+ //#region core/Clock.d.ts
1068
+ /**
1069
+ * Clock - Unified timing for the force graph package
1070
+ */
1071
+ declare class Clock {
1072
+ private previousTime;
1073
+ private elapsedTime;
1074
+ private deltaTime;
1075
+ private isRunning;
1076
+ private maxDeltaTime;
1077
+ constructor();
1078
+ /**
1079
+ * Start the clock
1080
+ */
1081
+ start(): void;
1082
+ /**
1083
+ * Stop the clock
1084
+ */
1085
+ stop(): void;
1086
+ /**
1087
+ * Update the clock - call once per frame
1088
+ * @returns delta time in seconds
1089
+ */
1090
+ update(): number;
1091
+ /**
1092
+ * Get delta time in seconds
1093
+ */
1094
+ getDeltaTime(): number;
1095
+ /**
1096
+ * Get total elapsed time in seconds
1097
+ */
1098
+ getElapsedTime(): number;
1099
+ /**
1100
+ * Check if clock is running
1101
+ */
1102
+ getIsRunning(): boolean;
1103
+ }
1104
+ //#endregion
1105
+ //#region core/GraphStore.d.ts
1106
+ /**
1107
+ * GraphStore - Central data management
1108
+ * Responsibilities:
1109
+ * - Store raw graph data (nodes, links)
1110
+ * - Node/Link CRUD operations
1111
+ * - ID mapping and lookups
1112
+ * - Data validation
1113
+ * - Change notifications
1114
+ */
1115
+ declare class GraphStore {
1116
+ private nodes;
1117
+ private links;
1118
+ private nodeArray;
1119
+ private linkArray;
1120
+ private nodeIdToIndex;
1121
+ private linkIdToIndex;
1122
+ private nodeToLinks;
1123
+ constructor();
1124
+ /**
1125
+ * Set graph data (replaces all)
1126
+ */
1127
+ setData(data: GraphData): void;
1128
+ /**
1129
+ * Add nodes
1130
+ */
1131
+ addNodes(nodes: GraphNode[]): void;
1132
+ /**
1133
+ * Remove nodes (and connected links)
1134
+ */
1135
+ removeNodes(nodeIds: string[]): void;
1136
+ /**
1137
+ * Add links
1138
+ */
1139
+ addLinks(links: GraphLink[]): void;
1140
+ /**
1141
+ * Remove links
1142
+ */
1143
+ removeLinks(linkIds: string[]): void;
1144
+ /**
1145
+ * Get all nodes as array
1146
+ */
1147
+ getNodes(): GraphNode[];
1148
+ /**
1149
+ * Get all links as array
1150
+ */
1151
+ getLinks(): GraphLink[];
1152
+ /**
1153
+ * Get connected node IDs for a given node
1154
+ */
1155
+ getConnectedNodeIds(nodeId: string): string[];
1156
+ /**
1157
+ * Get node by ID
1158
+ */
1159
+ getNodeById(id: string): GraphNode | null;
1160
+ /**
1161
+ * Get node by index
1162
+ */
1163
+ getNodeByIndex(index: number): GraphNode | null;
1164
+ /**
1165
+ * Get node index
1166
+ */
1167
+ getNodeIndex(id: string): number;
1168
+ /**
1169
+ * Get link by ID
1170
+ */
1171
+ getLinkById(id: string): GraphLink | null;
1172
+ /**
1173
+ * Get links connected to node
1174
+ */
1175
+ getNodeLinks(nodeId: string): GraphLink[];
1176
+ /**
1177
+ * Get node count
1178
+ */
1179
+ getNodeCount(): number;
1180
+ /**
1181
+ * Get link count
1182
+ */
1183
+ getLinkCount(): number;
1184
+ /**
1185
+ * Clear all data
1186
+ */
1187
+ clear(): void;
1188
+ private getLinkId;
1189
+ private addLinkConnectivity;
1190
+ private removeLinkConnectivity;
1191
+ private rebuildNodeArrays;
1192
+ private rebuildLinkArrays;
1193
+ }
1194
+ //#endregion
1195
+ //#region core/Engine.d.ts
1196
+ interface EngineOptions {
1197
+ width?: number;
1198
+ height?: number;
1199
+ backgroundColor?: string;
1200
+ tooltipConfig?: TooltipConfig;
1201
+ groupOrder?: string[];
1202
+ }
1203
+ /**
1204
+ * Engine - Main orchestrator
1205
+ * Responsibilities:
1206
+ * - Owns all shared buffers (StaticAssets, SimulationBuffers, PickBuffer)
1207
+ * - Coordinates GraphStore, GraphScene, ForceSimulation
1208
+ * - Manages render loop
1209
+ * - Handles user interaction
1210
+ */
1211
+ declare class Engine {
1212
+ readonly canvas: HTMLCanvasElement;
1213
+ readonly graphStore: GraphStore;
1214
+ private graphScene;
1215
+ private forceSimulation;
1216
+ interactionManager: InteractionManager;
1217
+ private clock;
1218
+ private simulationBuffers;
1219
+ private pickBuffer;
1220
+ private animationFrameId;
1221
+ private isRunning;
1222
+ private boundResizeHandler;
1223
+ private groupOrder?;
1224
+ private smoothedTooltipPos;
1225
+ constructor(canvas: HTMLCanvasElement, options?: EngineOptions);
1226
+ /**
1227
+ * Handle window resize event
1228
+ */
1229
+ private handleWindowResize;
1230
+ /**
1231
+ * Set graph data
1232
+ */
1233
+ setData(data: GraphData): void;
1234
+ /**
1235
+ * Update node states based on a callback
1236
+ * This allows changing visibility/behavior without resetting the simulation
1237
+ */
1238
+ updateNodeStates(callback: (node: GraphNode) => NodeState): void;
1239
+ /**
1240
+ * Set target positions for elastic force (tree layout, etc.)
1241
+ * Writes positions into the "original positions" GPU buffer that ElasticPass reads from,
1242
+ * without touching current positions or node states.
1243
+ * Must be called AFTER applyPreset() since updateNodeStates() overwrites original positions.
1244
+ */
1245
+ setTargetPositions(targets: Map<string, {
1246
+ x: number;
1247
+ y: number;
1248
+ z: number;
1249
+ }>): void;
1250
+ /**
1251
+ * Reheat the simulation
1252
+ */
1253
+ reheat(alpha?: number): void;
1254
+ /**
1255
+ * Set alpha decay
1256
+ */
1257
+ setAlphaDecay(decay: number): void;
1258
+ /**
1259
+ * Get current alpha
1260
+ */
1261
+ getAlpha(): number;
1262
+ /**Apply a preset to the graph
1263
+ */
1264
+ applyPreset(preset: GraphPreset): void;
1265
+ /**
1266
+ *
1267
+ * Start render loop
1268
+ */
1269
+ start(): void;
1270
+ /**
1271
+ * Stop render loop
1272
+ */
1273
+ stop(): void;
1274
+ /**
1275
+ * Render loop
1276
+ */
1277
+ private animate;
1278
+ /**
1279
+ * GPU pick node at canvas coordinates
1280
+ */
1281
+ pickNode(x: number, y: number): string | null;
1282
+ /**
1283
+ * Get node by ID
1284
+ */
1285
+ getNodeById(id: string): GraphNode | null;
1286
+ /**
1287
+ * Highlight nodes
1288
+ */
1289
+ highlightNodes(nodeIds: string[]): void;
1290
+ /**
1291
+ * Clear highlights
1292
+ */
1293
+ clearHighlights(): void;
1294
+ /**
1295
+ * Get node position in 3D space
1296
+ */
1297
+ getNodePosition(nodeId: string): THREE.Vector3 | null;
1298
+ /**
1299
+ * Get node screen position from world position
1300
+ * Returns position and visibility info (whether node is on screen and in front of camera)
1301
+ */
1302
+ getNodeScreenPosition(nodeId: string): {
1303
+ x: number;
1304
+ y: number;
1305
+ visible: boolean;
1306
+ } | null;
1307
+ /**
1308
+ * Update sticky tooltip position to follow node during camera movement
1309
+ * Uses lerp smoothing to filter out micro-jitter from force simulation
1310
+ */
1311
+ private updateStickyTooltipPosition;
1312
+ /**
1313
+ * Programmatically select a node (highlight + tooltip)
1314
+ */
1315
+ selectNode(nodeId: string): void;
1316
+ /**
1317
+ * Resize canvas and all dependent components
1318
+ */
1319
+ resize(width: number, height: number): void;
1320
+ /**
1321
+ * Get the unified clock for timing information
1322
+ */
1323
+ getClock(): Clock;
1324
+ /**
1325
+ * Get all nodes
1326
+ */
1327
+ get nodes(): GraphNode[];
1328
+ /**
1329
+ * Get all links
1330
+ */
1331
+ get links(): GraphLink[];
1332
+ /**
1333
+ * Get force simulation for external configuration (GUI binding)
1334
+ */
1335
+ get simulation(): ForceSimulation;
1336
+ /**
1337
+ * Get camera controller for external configuration
1338
+ */
1339
+ get camera(): CameraController;
1340
+ /**
1341
+ * Set camera mode (Orbit, Map, Fly)
1342
+ */
1343
+ setCameraMode(mode: CameraMode): void;
1344
+ /**
1345
+ * Animate camera to look at a specific target from a specific position
1346
+ */
1347
+ setCameraLookAt(position: {
1348
+ x: number;
1349
+ y: number;
1350
+ z: number;
1351
+ }, target: {
1352
+ x: number;
1353
+ y: number;
1354
+ z: number;
1355
+ }, transitionDuration?: number): Promise<void>;
1356
+ /**
1357
+ * Focus camera on a specific target node
1358
+ */
1359
+ setCameraFocus(target: {
1360
+ x: number;
1361
+ y: number;
1362
+ z: number;
1363
+ }, distance: number, transitionDuration?: number): Promise<void>;
1364
+ /**
1365
+ * Cleanup
1366
+ */
1367
+ dispose(): void;
1368
+ private calculateTextureSize;
1369
+ }
1370
+ //#endregion
1371
+ //#region core/StyleRegistry.d.ts
1372
+ /** Color input - can be THREE.Color, hex number, or CSS color string */
1373
+ type ColorInput = THREE.Color | number | string;
1374
+ /**
1375
+ * Visual properties for a node category (input)
1376
+ */
1377
+ interface NodeStyle {
1378
+ color: ColorInput;
1379
+ size: number;
1380
+ }
1381
+ /**
1382
+ * Visual properties for a link category (input)
1383
+ */
1384
+ interface LinkStyle {
1385
+ color: ColorInput;
1386
+ }
1387
+ /**
1388
+ * Resolved node style with THREE.Color
1389
+ */
1390
+ interface ResolvedNodeStyle {
1391
+ color: THREE.Color;
1392
+ size: number;
1393
+ }
1394
+ /**
1395
+ * Resolved link style with THREE.Color
1396
+ */
1397
+ interface ResolvedLinkStyle {
1398
+ color: THREE.Color;
1399
+ }
1400
+ /**
1401
+ * StyleRegistry - Manages visual styles for node and link categories
1402
+ *
1403
+ * Usage:
1404
+ * styleRegistry.setNodeStyle('person', { color: 0xff0000, size: 20 })
1405
+ * styleRegistry.setLinkStyle('friendship', { color: '#00ff00', width: 2 })
1406
+ *
1407
+ * const style = styleRegistry.getNodeStyle('person')
1408
+ */
1409
+ declare class StyleRegistry {
1410
+ private nodeStyles;
1411
+ private linkStyles;
1412
+ private defaultNodeStyle;
1413
+ private defaultLinkStyle;
1414
+ /**
1415
+ * Convert color input to THREE.Color
1416
+ */
1417
+ private toColor;
1418
+ /**
1419
+ * Set the default style for nodes without a category
1420
+ */
1421
+ setDefaultNodeStyle(style: Partial<NodeStyle>): void;
1422
+ /**
1423
+ * Set the default style for links without a category
1424
+ */
1425
+ setDefaultLinkStyle(style: Partial<LinkStyle>): void;
1426
+ /**
1427
+ * Register a style for a node category
1428
+ */
1429
+ setNodeStyle(category: string, style: NodeStyle): void;
1430
+ /**
1431
+ * Register multiple node styles at once
1432
+ */
1433
+ setNodeStyles(styles: Record<string, NodeStyle>): void;
1434
+ /**
1435
+ * Register a style for a link category
1436
+ */
1437
+ setLinkStyle(category: string, style: LinkStyle): void;
1438
+ /**
1439
+ * Register multiple link styles at once
1440
+ */
1441
+ setLinkStyles(styles: Record<string, LinkStyle>): void;
1442
+ /**
1443
+ * Get the resolved style for a node category
1444
+ */
1445
+ getNodeStyle(category?: string): ResolvedNodeStyle;
1446
+ /**
1447
+ * Get the resolved style for a link category
1448
+ */
1449
+ getLinkStyle(category?: string): ResolvedLinkStyle;
1450
+ /**
1451
+ * Check if a node category exists
1452
+ */
1453
+ hasNodeStyle(category: string): boolean;
1454
+ /**
1455
+ * Check if a link category exists
1456
+ */
1457
+ hasLinkStyle(category: string): boolean;
1458
+ /**
1459
+ * Remove a node style
1460
+ */
1461
+ removeNodeStyle(category: string): void;
1462
+ /**
1463
+ * Remove a link style
1464
+ */
1465
+ removeLinkStyle(category: string): void;
1466
+ /**
1467
+ * Clear all styles
1468
+ */
1469
+ clear(): void;
1470
+ /**
1471
+ * Get all registered node categories
1472
+ */
1473
+ getNodeCategories(): string[];
1474
+ /**
1475
+ * Get all registered link categories
1476
+ */
1477
+ getLinkCategories(): string[];
1478
+ }
1479
+ declare const styleRegistry: StyleRegistry;
1480
+ //#endregion
1481
+ //#region types/iEngineConfig.d.ts
1482
+ interface EngineConfig {
1483
+ container: HTMLElement;
1484
+ width?: number;
1485
+ height?: number;
1486
+ antialias?: boolean;
1487
+ alpha?: boolean;
1488
+ }
1489
+ //#endregion
1468
1490
  export { type Attractor, type CameraConfig, CameraMode, Clock, Engine, type EngineConfig, type ForceConfig, ForceSimulation, type GraphData, type GraphLink, type GraphNode, type GraphPreset, GraphScene, GraphStore, type LinkStyle, NodeState, type NodeStyle, PickBuffer, type ResolvedAttractor, type ResolvedLinkStyle, type ResolvedNodeStyle, SimulationBuffers, StaticAssets, type Vec3, staticAssets, styleRegistry };