polly-graph 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2291 -894
- package/dist/index.d.cts +267 -126
- package/dist/index.d.ts +267 -126
- package/dist/index.js +2291 -894
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -303,6 +303,11 @@ interface SelectionInteractionConfig {
|
|
|
303
303
|
readonly nodeStyle?: Partial<NodeStyle>;
|
|
304
304
|
readonly linkStyle?: Partial<LinkStyle>;
|
|
305
305
|
}
|
|
306
|
+
interface HighlightInteractionConfig {
|
|
307
|
+
readonly enabled?: boolean;
|
|
308
|
+
readonly nodeStyle?: Partial<NodeStyle>;
|
|
309
|
+
readonly linkStyle?: Partial<LinkStyle>;
|
|
310
|
+
}
|
|
306
311
|
interface DragInteractionConfig {
|
|
307
312
|
readonly enabled?: boolean;
|
|
308
313
|
}
|
|
@@ -310,6 +315,7 @@ interface GraphInteractionConfig {
|
|
|
310
315
|
readonly drag?: DragInteractionConfig;
|
|
311
316
|
readonly hover?: HoverInteractionConfig;
|
|
312
317
|
readonly selection?: SelectionInteractionConfig;
|
|
318
|
+
readonly highlight?: HighlightInteractionConfig;
|
|
313
319
|
}
|
|
314
320
|
|
|
315
321
|
type LegendPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
@@ -377,6 +383,7 @@ interface V2Link extends SimulationLinkDatum<V2Node> {
|
|
|
377
383
|
interface InteractionConfig {
|
|
378
384
|
readonly hover?: HoverInteractionConfig;
|
|
379
385
|
readonly selection?: SelectionInteractionConfig;
|
|
386
|
+
readonly highlight?: HighlightInteractionConfig;
|
|
380
387
|
}
|
|
381
388
|
interface V2Config {
|
|
382
389
|
container: HTMLElement;
|
|
@@ -406,6 +413,11 @@ interface V2Instance {
|
|
|
406
413
|
zoomIn(factor?: number, center?: [number, number]): void;
|
|
407
414
|
zoomOut(factor?: number, center?: [number, number]): void;
|
|
408
415
|
clearSelection(): void;
|
|
416
|
+
highlightNode(nodeId: string): void;
|
|
417
|
+
highlightNodes(nodeIds: string[]): void;
|
|
418
|
+
unhighlightNode(nodeId: string): void;
|
|
419
|
+
clearHighlights(): void;
|
|
420
|
+
getHighlightedNodes(): Set<string>;
|
|
409
421
|
on(event: 'nodeSelect', handler: (node: V2Node, element: HTMLCanvasElement) => void): () => void;
|
|
410
422
|
on(event: 'nodeDeselect', handler: (node: V2Node, element: HTMLCanvasElement) => void): () => void;
|
|
411
423
|
on(event: 'linkSelect', handler: (link: V2Link, element: HTMLCanvasElement) => void): () => void;
|
|
@@ -623,12 +635,30 @@ declare class PhysicsManager {
|
|
|
623
635
|
private hasInitialAutoFitCompleted;
|
|
624
636
|
private timerManager;
|
|
625
637
|
private isVisibilityListenerAttached;
|
|
626
|
-
private
|
|
638
|
+
private stateManager;
|
|
639
|
+
private isWarmingUp;
|
|
640
|
+
private warmupSteps;
|
|
627
641
|
constructor(timerManager: TimerManager);
|
|
628
642
|
/**
|
|
629
643
|
* Initialize physics simulation
|
|
630
644
|
*/
|
|
631
645
|
initialize(config: PhysicsConfig): void;
|
|
646
|
+
/**
|
|
647
|
+
* Handle tick with smooth warmup progression
|
|
648
|
+
*/
|
|
649
|
+
private handleTick;
|
|
650
|
+
/**
|
|
651
|
+
* Start smooth warmup process for large graphs
|
|
652
|
+
*/
|
|
653
|
+
private startSmoothWarmup;
|
|
654
|
+
/**
|
|
655
|
+
* Progress warmup over time for smoother initial animation
|
|
656
|
+
*/
|
|
657
|
+
private progressWarmup;
|
|
658
|
+
/**
|
|
659
|
+
* Apply scaled forces during warmup
|
|
660
|
+
*/
|
|
661
|
+
private applyWarmupForces;
|
|
632
662
|
/**
|
|
633
663
|
* Handle simulation end
|
|
634
664
|
*/
|
|
@@ -641,10 +671,6 @@ declare class PhysicsManager {
|
|
|
641
671
|
* Setup cooldown timer (force-graph pattern)
|
|
642
672
|
*/
|
|
643
673
|
private setupCooldownTimer;
|
|
644
|
-
/**
|
|
645
|
-
* Build node index for O(1) lookups (Step 3 optimization)
|
|
646
|
-
*/
|
|
647
|
-
private buildNodeIndex;
|
|
648
674
|
/**
|
|
649
675
|
* Get simulation instance
|
|
650
676
|
*/
|
|
@@ -684,7 +710,7 @@ declare class PhysicsManager {
|
|
|
684
710
|
*/
|
|
685
711
|
private getLinkArrowLength;
|
|
686
712
|
/**
|
|
687
|
-
* Initialize node positions
|
|
713
|
+
* Initialize node positions with improved distribution for smoother startup
|
|
688
714
|
*/
|
|
689
715
|
initializePositions(): void;
|
|
690
716
|
/**
|
|
@@ -765,6 +791,7 @@ declare class HoverManager {
|
|
|
765
791
|
private flushShadowCanvas?;
|
|
766
792
|
private hasValidPointerPosition;
|
|
767
793
|
private containerWarningLogged;
|
|
794
|
+
private boundHandlers;
|
|
768
795
|
/**
|
|
769
796
|
* Initialize hover manager with force-graph pattern
|
|
770
797
|
*/
|
|
@@ -849,6 +876,10 @@ interface DragConfig {
|
|
|
849
876
|
physicsManager: PhysicsManager;
|
|
850
877
|
hoverManager: HoverManager;
|
|
851
878
|
onRender: () => void;
|
|
879
|
+
renderer?: {
|
|
880
|
+
setDragState(isDragging: boolean): void;
|
|
881
|
+
setDraggedNode(node: V2Node): void;
|
|
882
|
+
};
|
|
852
883
|
}
|
|
853
884
|
interface DragState {
|
|
854
885
|
isDragging: boolean;
|
|
@@ -858,6 +889,9 @@ declare class DragManager {
|
|
|
858
889
|
private config?;
|
|
859
890
|
private state;
|
|
860
891
|
private readonly DRAG_CLICK_TOLERANCE_PX;
|
|
892
|
+
private dragRenderPending;
|
|
893
|
+
private lastDragRenderTime;
|
|
894
|
+
private pendingAnimationFrame?;
|
|
861
895
|
/**
|
|
862
896
|
* Initialize drag behavior
|
|
863
897
|
*/
|
|
@@ -874,6 +908,10 @@ declare class DragManager {
|
|
|
874
908
|
* Handle drag movement
|
|
875
909
|
*/
|
|
876
910
|
private handleDrag;
|
|
911
|
+
/**
|
|
912
|
+
* RAF-throttled render during drag (like ZoomManager pattern)
|
|
913
|
+
*/
|
|
914
|
+
private throttledDragRender;
|
|
877
915
|
/**
|
|
878
916
|
* Handle drag end
|
|
879
917
|
*/
|
|
@@ -906,6 +944,10 @@ interface ZoomConfig {
|
|
|
906
944
|
canvas: HTMLCanvasElement;
|
|
907
945
|
canvasManager: CanvasManager;
|
|
908
946
|
onRender: () => void;
|
|
947
|
+
onZoomEnd?: () => void;
|
|
948
|
+
renderer?: {
|
|
949
|
+
setZoomState(isZooming: boolean): void;
|
|
950
|
+
};
|
|
909
951
|
minZoom?: number;
|
|
910
952
|
maxZoom?: number;
|
|
911
953
|
isOverEntity?: () => boolean;
|
|
@@ -913,6 +955,9 @@ interface ZoomConfig {
|
|
|
913
955
|
declare class ZoomManager {
|
|
914
956
|
private config?;
|
|
915
957
|
private zoomBehavior?;
|
|
958
|
+
private isZooming;
|
|
959
|
+
private zoomRenderPending;
|
|
960
|
+
private isProgrammaticZoom;
|
|
916
961
|
/**
|
|
917
962
|
* Initialize zoom behavior
|
|
918
963
|
*/
|
|
@@ -926,13 +971,14 @@ declare class ZoomManager {
|
|
|
926
971
|
*/
|
|
927
972
|
private handleZoomStart;
|
|
928
973
|
/**
|
|
929
|
-
* Handle zoom events
|
|
974
|
+
* Handle zoom events with RAF throttling for smooth performance
|
|
930
975
|
*/
|
|
931
976
|
private handleZoom;
|
|
932
977
|
/**
|
|
933
978
|
* Handle zoom end (when panning ends)
|
|
934
979
|
*/
|
|
935
980
|
private handleZoomEnd;
|
|
981
|
+
isCurrentlyZooming(): boolean;
|
|
936
982
|
/**
|
|
937
983
|
* Get zoom behavior instance
|
|
938
984
|
*/
|
|
@@ -1014,6 +1060,7 @@ declare class SelectionManager {
|
|
|
1014
1060
|
private selectionState;
|
|
1015
1061
|
private eventHandlers;
|
|
1016
1062
|
private container?;
|
|
1063
|
+
private boundHandlers;
|
|
1017
1064
|
/**
|
|
1018
1065
|
* Initialize selection manager
|
|
1019
1066
|
*/
|
|
@@ -1081,161 +1128,263 @@ declare class SelectionManager {
|
|
|
1081
1128
|
}
|
|
1082
1129
|
|
|
1083
1130
|
/**
|
|
1084
|
-
* V2 Canvas Graph -
|
|
1131
|
+
* V2 Canvas Graph - State Manager
|
|
1085
1132
|
*
|
|
1086
|
-
*
|
|
1133
|
+
* Centralized state management for O(1) lookups across all renderers.
|
|
1134
|
+
* Eliminates duplicate Maps and provides consistent caching patterns.
|
|
1087
1135
|
*/
|
|
1088
1136
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1137
|
+
interface GraphState {
|
|
1138
|
+
nodes: V2Node[];
|
|
1139
|
+
links: V2Link[];
|
|
1140
|
+
}
|
|
1141
|
+
interface NodeLookupState {
|
|
1142
|
+
isHovered: boolean;
|
|
1143
|
+
isSelected: boolean;
|
|
1144
|
+
isHighlighted: boolean;
|
|
1145
|
+
}
|
|
1146
|
+
interface LinkLookupState {
|
|
1147
|
+
isHovered: boolean;
|
|
1148
|
+
isSelected: boolean;
|
|
1149
|
+
}
|
|
1150
|
+
declare class StateManager {
|
|
1095
1151
|
private nodeMap;
|
|
1096
|
-
private
|
|
1097
|
-
private
|
|
1098
|
-
private
|
|
1099
|
-
private
|
|
1100
|
-
private
|
|
1101
|
-
private linkHoverPrecision;
|
|
1152
|
+
private linkMap;
|
|
1153
|
+
private nodeStateCache;
|
|
1154
|
+
private linkStateCache;
|
|
1155
|
+
private linkIdToLinkMap;
|
|
1156
|
+
private highlightedNodes;
|
|
1102
1157
|
/**
|
|
1103
|
-
* Initialize
|
|
1158
|
+
* Initialize with graph data
|
|
1104
1159
|
*/
|
|
1105
|
-
initialize(
|
|
1106
|
-
nodes: V2Node[];
|
|
1107
|
-
links: V2Link[];
|
|
1108
|
-
interaction?: InteractionConfig;
|
|
1109
|
-
}, canvasState: CanvasState, hoverManager: HoverManager, selectionManager?: SelectionManager): void;
|
|
1160
|
+
initialize(state: GraphState): void;
|
|
1110
1161
|
/**
|
|
1111
|
-
*
|
|
1162
|
+
* Update with new graph data
|
|
1112
1163
|
*/
|
|
1113
|
-
|
|
1164
|
+
updateState(state: GraphState): void;
|
|
1114
1165
|
/**
|
|
1115
|
-
*
|
|
1166
|
+
* Build node map for O(1) node lookups
|
|
1116
1167
|
*/
|
|
1117
|
-
|
|
1168
|
+
private buildNodeMap;
|
|
1118
1169
|
/**
|
|
1119
|
-
*
|
|
1170
|
+
* Build link maps for O(1) link lookups
|
|
1120
1171
|
*/
|
|
1121
|
-
|
|
1172
|
+
private buildLinkMaps;
|
|
1122
1173
|
/**
|
|
1123
|
-
*
|
|
1174
|
+
* Get node by ID (O(1) lookup)
|
|
1124
1175
|
*/
|
|
1125
|
-
|
|
1176
|
+
getNode(nodeId: string): V2Node | undefined;
|
|
1126
1177
|
/**
|
|
1127
|
-
*
|
|
1178
|
+
* Get link by link ID (O(1) lookup)
|
|
1128
1179
|
*/
|
|
1129
|
-
|
|
1180
|
+
getLink(linkId: string): V2Link | undefined;
|
|
1130
1181
|
/**
|
|
1131
|
-
*
|
|
1182
|
+
* Get link by source/target IDs (O(1) lookup)
|
|
1132
1183
|
*/
|
|
1133
|
-
|
|
1184
|
+
getLinkByNodes(sourceId: string, targetId: string): V2Link | undefined;
|
|
1134
1185
|
/**
|
|
1135
|
-
*
|
|
1186
|
+
* Get all nodes (returns reference to avoid copying)
|
|
1136
1187
|
*/
|
|
1137
|
-
|
|
1188
|
+
getAllNodes(): V2Node[];
|
|
1138
1189
|
/**
|
|
1139
|
-
* Get
|
|
1190
|
+
* Get all links (returns reference to avoid copying)
|
|
1140
1191
|
*/
|
|
1141
|
-
|
|
1192
|
+
getAllLinks(): V2Link[];
|
|
1142
1193
|
/**
|
|
1143
|
-
*
|
|
1194
|
+
* Get node map (for renderers that need direct map access)
|
|
1144
1195
|
*/
|
|
1145
|
-
|
|
1196
|
+
getNodeMap(): Map<string, V2Node>;
|
|
1146
1197
|
/**
|
|
1147
|
-
*
|
|
1198
|
+
* Get link ID to link map (for renderers that need direct map access)
|
|
1148
1199
|
*/
|
|
1149
|
-
|
|
1200
|
+
getLinkIdToLinkMap(): Map<string, V2Link>;
|
|
1150
1201
|
/**
|
|
1151
|
-
*
|
|
1202
|
+
* Cache node state for performance (avoid repeated hover/selection checks)
|
|
1152
1203
|
*/
|
|
1153
|
-
|
|
1204
|
+
cacheNodeState(nodeId: string, state: NodeLookupState): void;
|
|
1154
1205
|
/**
|
|
1155
|
-
*
|
|
1206
|
+
* Get cached node state
|
|
1156
1207
|
*/
|
|
1157
|
-
|
|
1208
|
+
getCachedNodeState(nodeId: string): NodeLookupState | undefined;
|
|
1158
1209
|
/**
|
|
1159
|
-
*
|
|
1210
|
+
* Cache link state for performance (avoid repeated hover/selection checks)
|
|
1160
1211
|
*/
|
|
1161
|
-
|
|
1212
|
+
cacheLinkState(linkId: string, state: LinkLookupState): void;
|
|
1162
1213
|
/**
|
|
1163
|
-
* Get
|
|
1214
|
+
* Get cached link state
|
|
1164
1215
|
*/
|
|
1165
|
-
|
|
1216
|
+
getCachedLinkState(linkId: string): LinkLookupState | undefined;
|
|
1166
1217
|
/**
|
|
1167
|
-
*
|
|
1218
|
+
* Clear state caches (call when hover/selection state changes)
|
|
1168
1219
|
*/
|
|
1169
|
-
|
|
1220
|
+
clearStateCache(): void;
|
|
1170
1221
|
/**
|
|
1171
|
-
*
|
|
1222
|
+
* Clear only node state cache
|
|
1172
1223
|
*/
|
|
1173
|
-
|
|
1224
|
+
clearNodeStateCache(): void;
|
|
1174
1225
|
/**
|
|
1175
|
-
*
|
|
1226
|
+
* Clear only link state cache
|
|
1176
1227
|
*/
|
|
1177
|
-
|
|
1228
|
+
clearLinkStateCache(): void;
|
|
1178
1229
|
/**
|
|
1179
|
-
*
|
|
1230
|
+
* Generate consistent link ID
|
|
1180
1231
|
*/
|
|
1181
|
-
|
|
1232
|
+
getLinkId(link: V2Link): string;
|
|
1182
1233
|
/**
|
|
1183
|
-
*
|
|
1234
|
+
* Calculate link midpoint (common utility)
|
|
1184
1235
|
*/
|
|
1185
|
-
|
|
1236
|
+
getLinkMidpoint(link: V2Link): {
|
|
1237
|
+
x: number;
|
|
1238
|
+
y: number;
|
|
1239
|
+
} | null;
|
|
1186
1240
|
/**
|
|
1187
|
-
*
|
|
1241
|
+
* Highlight a node by ID
|
|
1188
1242
|
*/
|
|
1189
|
-
|
|
1243
|
+
highlightNode(nodeId: string): void;
|
|
1190
1244
|
/**
|
|
1191
|
-
*
|
|
1245
|
+
* Highlight multiple nodes by IDs
|
|
1192
1246
|
*/
|
|
1193
|
-
|
|
1247
|
+
highlightNodes(nodeIds: string[]): void;
|
|
1194
1248
|
/**
|
|
1195
|
-
*
|
|
1249
|
+
* Remove highlight from a node
|
|
1196
1250
|
*/
|
|
1197
|
-
|
|
1251
|
+
unhighlightNode(nodeId: string): void;
|
|
1198
1252
|
/**
|
|
1199
|
-
*
|
|
1253
|
+
* Clear all node highlights
|
|
1200
1254
|
*/
|
|
1201
|
-
|
|
1255
|
+
clearHighlights(): void;
|
|
1202
1256
|
/**
|
|
1203
|
-
* Check if a node is
|
|
1257
|
+
* Check if a node is highlighted
|
|
1204
1258
|
*/
|
|
1205
|
-
|
|
1259
|
+
isNodeHighlighted(nodeId: string): boolean;
|
|
1206
1260
|
/**
|
|
1207
|
-
*
|
|
1261
|
+
* Get all highlighted node IDs
|
|
1208
1262
|
*/
|
|
1209
|
-
|
|
1263
|
+
getHighlightedNodes(): Set<string>;
|
|
1210
1264
|
/**
|
|
1211
|
-
*
|
|
1212
|
-
* (either the link itself is selected, or its connected node is selected)
|
|
1265
|
+
* Clear state cache for a specific node
|
|
1213
1266
|
*/
|
|
1214
|
-
private
|
|
1267
|
+
private clearSingleNodeStateCache;
|
|
1215
1268
|
/**
|
|
1216
|
-
*
|
|
1269
|
+
* Get statistics about cached state
|
|
1217
1270
|
*/
|
|
1218
|
-
|
|
1271
|
+
getStats(): {
|
|
1272
|
+
nodeCount: number;
|
|
1273
|
+
linkCount: number;
|
|
1274
|
+
cachedNodeStates: number;
|
|
1275
|
+
cachedLinkStates: number;
|
|
1276
|
+
highlightedNodes: number;
|
|
1277
|
+
};
|
|
1278
|
+
/**
|
|
1279
|
+
* Destroy and clean up all maps
|
|
1280
|
+
*/
|
|
1281
|
+
destroy(): void;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* V2 Canvas Graph - Renderer (Force-Graph Pattern)
|
|
1286
|
+
*
|
|
1287
|
+
* Clean implementation following force-graph's exact architecture
|
|
1288
|
+
*/
|
|
1289
|
+
|
|
1290
|
+
declare class Renderer {
|
|
1291
|
+
private config?;
|
|
1292
|
+
private canvasState?;
|
|
1293
|
+
private hoverManager?;
|
|
1294
|
+
private selectionManager?;
|
|
1295
|
+
private styleResolver?;
|
|
1296
|
+
private stateManager;
|
|
1297
|
+
private metricsManager;
|
|
1298
|
+
private interactionResolver;
|
|
1299
|
+
private dragOptimizer;
|
|
1300
|
+
private zIndexRenderer;
|
|
1301
|
+
private zoomRenderer;
|
|
1302
|
+
private hitDetectionRenderer;
|
|
1219
1303
|
/**
|
|
1220
|
-
*
|
|
1304
|
+
* Initialize the renderer
|
|
1305
|
+
*/
|
|
1306
|
+
initialize(config: {
|
|
1307
|
+
nodes: V2Node[];
|
|
1308
|
+
links: V2Link[];
|
|
1309
|
+
interaction?: InteractionConfig;
|
|
1310
|
+
}, canvasState: CanvasState, hoverManager: HoverManager, selectionManager?: SelectionManager): void;
|
|
1311
|
+
/**
|
|
1312
|
+
* Initialize the optimized z-index renderer with all required dependencies
|
|
1313
|
+
*/
|
|
1314
|
+
private initializeZIndexRenderer;
|
|
1315
|
+
/**
|
|
1316
|
+
* Initialize the zoom renderer for zoom-specific optimizations
|
|
1317
|
+
*/
|
|
1318
|
+
private initializeZoomRenderer;
|
|
1319
|
+
/**
|
|
1320
|
+
* Initialize the hit detection renderer for shadow canvas
|
|
1321
|
+
*/
|
|
1322
|
+
private initializeHitDetectionRenderer;
|
|
1323
|
+
/**
|
|
1324
|
+
* Initialize the drag optimizer for fast drag rendering
|
|
1325
|
+
*/
|
|
1326
|
+
private initializeDragOptimizer;
|
|
1327
|
+
/**
|
|
1328
|
+
* Main render method with performance metrics (Instrumented)
|
|
1329
|
+
*/
|
|
1330
|
+
render(): void;
|
|
1331
|
+
/**
|
|
1332
|
+
* Render with transform (called during zoom/pan) - OPTIMIZED PATTERN
|
|
1333
|
+
* Fast rendering during zoom, full rendering when stopped
|
|
1334
|
+
*/
|
|
1335
|
+
renderWithTransform(): void;
|
|
1336
|
+
/**
|
|
1337
|
+
* Set zoom state for performance optimization (delegates to ZoomRenderer)
|
|
1338
|
+
*/
|
|
1339
|
+
setZoomState(isZooming: boolean): void;
|
|
1340
|
+
/**
|
|
1341
|
+
* Set drag state for performance optimization (like setZoomState)
|
|
1342
|
+
*/
|
|
1343
|
+
setDragState(isDragging: boolean): void;
|
|
1344
|
+
/**
|
|
1345
|
+
* Set the currently dragged node
|
|
1346
|
+
*/
|
|
1347
|
+
setDraggedNode(draggedNode: V2Node): void;
|
|
1348
|
+
/**
|
|
1349
|
+
* Render shadow canvas for hit detection (delegates to HitDetectionRenderer)
|
|
1350
|
+
*/
|
|
1351
|
+
renderShadowCanvas(): void;
|
|
1352
|
+
/**
|
|
1353
|
+
* Mark shadow canvas as dirty for next render (delegates to HitDetectionRenderer)
|
|
1354
|
+
*/
|
|
1355
|
+
markShadowCanvasDirty(): void;
|
|
1356
|
+
/**
|
|
1357
|
+
* Force shadow canvas render (delegates to HitDetectionRenderer)
|
|
1358
|
+
*/
|
|
1359
|
+
forceShadowCanvasRender(): void;
|
|
1360
|
+
/**
|
|
1361
|
+
* Clear canvas context
|
|
1362
|
+
*/
|
|
1363
|
+
private clearCanvas;
|
|
1364
|
+
/**
|
|
1365
|
+
* Apply transform to canvas context
|
|
1366
|
+
*/
|
|
1367
|
+
private applyTransform;
|
|
1368
|
+
/**
|
|
1369
|
+
* Get unique link ID for tracking (delegates to StateManager)
|
|
1221
1370
|
*/
|
|
1222
|
-
private
|
|
1371
|
+
private getLinkId;
|
|
1223
1372
|
/**
|
|
1224
|
-
*
|
|
1373
|
+
* Reset performance metrics
|
|
1225
1374
|
*/
|
|
1226
|
-
|
|
1375
|
+
resetPerformanceMetrics(): void;
|
|
1227
1376
|
/**
|
|
1228
|
-
*
|
|
1377
|
+
* Get current performance metrics
|
|
1229
1378
|
*/
|
|
1230
|
-
|
|
1379
|
+
getPerformanceMetrics(): StatsMetrics;
|
|
1231
1380
|
/**
|
|
1232
|
-
*
|
|
1381
|
+
* Force log performance metrics immediately (for debugging)
|
|
1233
1382
|
*/
|
|
1234
|
-
|
|
1383
|
+
forceLogMetrics(): void;
|
|
1235
1384
|
/**
|
|
1236
|
-
*
|
|
1385
|
+
* Calculate midpoint of a link for label positioning (delegates to StateManager)
|
|
1237
1386
|
*/
|
|
1238
|
-
private
|
|
1387
|
+
private getLinkMidpoint;
|
|
1239
1388
|
/**
|
|
1240
1389
|
* Initialize node positions if needed
|
|
1241
1390
|
*/
|
|
@@ -1260,44 +1409,16 @@ declare class Renderer {
|
|
|
1260
1409
|
};
|
|
1261
1410
|
};
|
|
1262
1411
|
/**
|
|
1263
|
-
* Debug shadow canvas export (
|
|
1412
|
+
* Debug shadow canvas export (delegates to HitDetectionRenderer)
|
|
1264
1413
|
*/
|
|
1265
1414
|
debugShadowCanvas(): void;
|
|
1266
|
-
/**
|
|
1267
|
-
* Build node index for O(1) lookups (Step 3 optimization)
|
|
1268
|
-
*/
|
|
1269
|
-
private buildNodeIndex;
|
|
1270
|
-
/**
|
|
1271
|
-
* Get node by ID using O(1) lookup (Step 3 optimization)
|
|
1272
|
-
*/
|
|
1273
|
-
private getNodeById;
|
|
1274
|
-
/**
|
|
1275
|
-
* Render with z-index layers (for renderWithTransform)
|
|
1276
|
-
*/
|
|
1277
|
-
private renderWithLayers;
|
|
1278
|
-
/**
|
|
1279
|
-
* Render with z-index layers and performance metrics (for main render)
|
|
1280
|
-
*/
|
|
1281
|
-
private renderWithLayersAndMetrics;
|
|
1282
|
-
/**
|
|
1283
|
-
* Helper methods for getting current interaction states
|
|
1284
|
-
*/
|
|
1285
|
-
private getHoveredNode;
|
|
1286
|
-
private getSelectedNode;
|
|
1287
|
-
private getHoveredLink;
|
|
1288
|
-
private getSelectedLink;
|
|
1289
|
-
/**
|
|
1290
|
-
* Layer-specific rendering methods (render subsets of entities)
|
|
1291
|
-
*/
|
|
1292
|
-
private renderNodesWithLabelsLayer;
|
|
1293
|
-
/**
|
|
1294
|
-
* Helper method to truncate labels (copied from NodeLabelsRenderer)
|
|
1295
|
-
*/
|
|
1296
|
-
private truncateLabel;
|
|
1297
1415
|
private renderLinksLayer;
|
|
1298
|
-
private renderLinkLabelsLayer;
|
|
1299
1416
|
private renderNodesLayer;
|
|
1300
1417
|
private renderNodeLabelsLayer;
|
|
1418
|
+
/**
|
|
1419
|
+
* Get the state manager for highlight operations
|
|
1420
|
+
*/
|
|
1421
|
+
getStateManager(): StateManager;
|
|
1301
1422
|
/**
|
|
1302
1423
|
* Destroy renderer and clean up resources
|
|
1303
1424
|
*/
|
|
@@ -1457,6 +1578,26 @@ declare class V2Graph implements V2Instance {
|
|
|
1457
1578
|
* Draw legend on export canvas
|
|
1458
1579
|
*/
|
|
1459
1580
|
private drawLegendOnExportCanvas;
|
|
1581
|
+
/**
|
|
1582
|
+
* Highlight a node by ID
|
|
1583
|
+
*/
|
|
1584
|
+
highlightNode(nodeId: string): void;
|
|
1585
|
+
/**
|
|
1586
|
+
* Highlight multiple nodes by IDs
|
|
1587
|
+
*/
|
|
1588
|
+
highlightNodes(nodeIds: string[]): void;
|
|
1589
|
+
/**
|
|
1590
|
+
* Remove highlight from a node
|
|
1591
|
+
*/
|
|
1592
|
+
unhighlightNode(nodeId: string): void;
|
|
1593
|
+
/**
|
|
1594
|
+
* Clear all node highlights
|
|
1595
|
+
*/
|
|
1596
|
+
clearHighlights(): void;
|
|
1597
|
+
/**
|
|
1598
|
+
* Get all highlighted node IDs
|
|
1599
|
+
*/
|
|
1600
|
+
getHighlightedNodes(): Set<string>;
|
|
1460
1601
|
/**
|
|
1461
1602
|
* Destroy the graph and clean up resources
|
|
1462
1603
|
*/
|
|
@@ -1467,4 +1608,4 @@ declare class V2Graph implements V2Instance {
|
|
|
1467
1608
|
*/
|
|
1468
1609
|
declare function createV2Graph(config: V2Config): V2Instance;
|
|
1469
1610
|
|
|
1470
|
-
export { type ArrowRenderStyle, type BaseGraphConfig, CanvasManager, type CanvasRenderConfig, type CanvasState, type ControlsController, type Coordinates, DEFAULT_COLORS, DEFAULT_HOVER_STYLES, DEFAULT_LINK_LABEL_STYLE, DEFAULT_LINK_STYLE, type DragConfig, type DragInteractionConfig, DragManager, type DragState, ErrorHandler, type GraphControlsConfig, type GraphControlsOrientation, type GraphControlsPosition, type GraphInteractionConfig, type GraphLink, type GraphNode, type GraphNodeWithInitial, type GraphTooltipTheme, type HoverEvent, type HoverInteractionConfig, HoverManager, type HoverState, type HoverStyles, type IconName, type IconSvgName, type InteractionColors, type InteractionConfig, type LegendConfig, type LegendPosition, type LinkArrowStyle, type LinkColors, type LinkLabelRenderStyle, type LinkLabelStyle, type LinkRenderStyle, type LinkSelectHandler, type LinkStyle, NeutralColor, type NodeColorPalette, type NodeLabelRenderStyle, type NodeRenderStyle, type NodeSelectHandler, type NodeStyle, type Orientation, type PhysicsConfig, PhysicsManager, PointerManager, type PointerState, type Position, PrimaryColor, type RenderStyles, Renderer, type ResolvedLinkLabelStyle, type ResolvedLinkStyle, SecondaryColor, type SelectionEvent, type SelectionInteractionConfig, SelectionManager, type SelectionState, type SimulationConfig, StandardColor, type TooltipInteractionConfig, type TooltipPlacement, type UIColors, type V2Config, V2Graph, type V2Instance, type V2Link, type V2Node, ValidationError, type ZoomConfig, ZoomManager, createV2Graph, getIcon, getIconSvg, iconSvg, icons, isValidLinkStyle, isValidNodeStyle, mergeLinkStyle, mergeNodeStyle };
|
|
1611
|
+
export { type ArrowRenderStyle, type BaseGraphConfig, CanvasManager, type CanvasRenderConfig, type CanvasState, type ControlsController, type Coordinates, DEFAULT_COLORS, DEFAULT_HOVER_STYLES, DEFAULT_LINK_LABEL_STYLE, DEFAULT_LINK_STYLE, type DragConfig, type DragInteractionConfig, DragManager, type DragState, ErrorHandler, type GraphControlsConfig, type GraphControlsOrientation, type GraphControlsPosition, type GraphInteractionConfig, type GraphLink, type GraphNode, type GraphNodeWithInitial, type GraphTooltipTheme, type HighlightInteractionConfig, type HoverEvent, type HoverInteractionConfig, HoverManager, type HoverState, type HoverStyles, type IconName, type IconSvgName, type InteractionColors, type InteractionConfig, type LegendConfig, type LegendPosition, type LinkArrowStyle, type LinkColors, type LinkLabelRenderStyle, type LinkLabelStyle, type LinkRenderStyle, type LinkSelectHandler, type LinkStyle, NeutralColor, type NodeColorPalette, type NodeLabelRenderStyle, type NodeRenderStyle, type NodeSelectHandler, type NodeStyle, type Orientation, type PhysicsConfig, PhysicsManager, PointerManager, type PointerState, type Position, PrimaryColor, type RenderStyles, Renderer, type ResolvedLinkLabelStyle, type ResolvedLinkStyle, SecondaryColor, type SelectionEvent, type SelectionInteractionConfig, SelectionManager, type SelectionState, type SimulationConfig, StandardColor, type TooltipInteractionConfig, type TooltipPlacement, type UIColors, type V2Config, V2Graph, type V2Instance, type V2Link, type V2Node, ValidationError, type ZoomConfig, ZoomManager, createV2Graph, getIcon, getIconSvg, iconSvg, icons, isValidLinkStyle, isValidNodeStyle, mergeLinkStyle, mergeNodeStyle };
|