polly-graph 0.2.3 → 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 +2351 -900
- package/dist/index.css +2 -0
- package/dist/index.d.cts +280 -140
- package/dist/index.d.ts +280 -140
- package/dist/index.js +2351 -900
- 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;
|
|
@@ -428,6 +440,17 @@ interface V2Instance {
|
|
|
428
440
|
resetPerformanceMetrics(): void;
|
|
429
441
|
}
|
|
430
442
|
|
|
443
|
+
interface PhysicsConfig {
|
|
444
|
+
nodes: V2Node[];
|
|
445
|
+
links: V2Link[];
|
|
446
|
+
width: number;
|
|
447
|
+
height: number;
|
|
448
|
+
onTick: () => void;
|
|
449
|
+
onEnd?: () => void;
|
|
450
|
+
autoFitView?: boolean;
|
|
451
|
+
cooldownTime?: number;
|
|
452
|
+
}
|
|
453
|
+
|
|
431
454
|
/**
|
|
432
455
|
* V2 Canvas Graph - Error Handling
|
|
433
456
|
*/
|
|
@@ -604,29 +627,38 @@ declare class CanvasManager {
|
|
|
604
627
|
* Manages D3 force simulation lifecycle and behavior
|
|
605
628
|
*/
|
|
606
629
|
|
|
607
|
-
interface PhysicsConfig {
|
|
608
|
-
nodes: V2Node[];
|
|
609
|
-
links: V2Link[];
|
|
610
|
-
width: number;
|
|
611
|
-
height: number;
|
|
612
|
-
onTick: () => void;
|
|
613
|
-
onEnd?: () => void;
|
|
614
|
-
autoFitView?: boolean;
|
|
615
|
-
cooldownTime?: number;
|
|
616
|
-
}
|
|
617
630
|
declare class PhysicsManager {
|
|
618
631
|
private simulation?;
|
|
619
632
|
private config?;
|
|
620
633
|
private simulationStartTime?;
|
|
621
634
|
private simulationEndTime?;
|
|
622
|
-
private cooldownTimer?;
|
|
623
635
|
private hasInitialAutoFitCompleted;
|
|
624
636
|
private timerManager;
|
|
637
|
+
private isVisibilityListenerAttached;
|
|
638
|
+
private stateManager;
|
|
639
|
+
private isWarmingUp;
|
|
640
|
+
private warmupSteps;
|
|
625
641
|
constructor(timerManager: TimerManager);
|
|
626
642
|
/**
|
|
627
643
|
* Initialize physics simulation
|
|
628
644
|
*/
|
|
629
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;
|
|
630
662
|
/**
|
|
631
663
|
* Handle simulation end
|
|
632
664
|
*/
|
|
@@ -673,20 +705,12 @@ declare class PhysicsManager {
|
|
|
673
705
|
* Calculate base distance based on graph size and node count
|
|
674
706
|
*/
|
|
675
707
|
private calculateBaseDistance;
|
|
676
|
-
/**
|
|
677
|
-
* Find node by ID
|
|
678
|
-
*/
|
|
679
|
-
private findNodeById;
|
|
680
|
-
/**
|
|
681
|
-
* Get node radius from style or default
|
|
682
|
-
*/
|
|
683
|
-
private getNodeRadius;
|
|
684
708
|
/**
|
|
685
709
|
* Get arrow length from link style or default
|
|
686
710
|
*/
|
|
687
711
|
private getLinkArrowLength;
|
|
688
712
|
/**
|
|
689
|
-
* Initialize node positions
|
|
713
|
+
* Initialize node positions with improved distribution for smoother startup
|
|
690
714
|
*/
|
|
691
715
|
initializePositions(): void;
|
|
692
716
|
/**
|
|
@@ -715,6 +739,7 @@ declare class PhysicsManager {
|
|
|
715
739
|
* Resume the simulation
|
|
716
740
|
*/
|
|
717
741
|
resume(): void;
|
|
742
|
+
private handleVisibilityChange;
|
|
718
743
|
/**
|
|
719
744
|
* Destroy physics simulation
|
|
720
745
|
*/
|
|
@@ -766,6 +791,7 @@ declare class HoverManager {
|
|
|
766
791
|
private flushShadowCanvas?;
|
|
767
792
|
private hasValidPointerPosition;
|
|
768
793
|
private containerWarningLogged;
|
|
794
|
+
private boundHandlers;
|
|
769
795
|
/**
|
|
770
796
|
* Initialize hover manager with force-graph pattern
|
|
771
797
|
*/
|
|
@@ -850,6 +876,10 @@ interface DragConfig {
|
|
|
850
876
|
physicsManager: PhysicsManager;
|
|
851
877
|
hoverManager: HoverManager;
|
|
852
878
|
onRender: () => void;
|
|
879
|
+
renderer?: {
|
|
880
|
+
setDragState(isDragging: boolean): void;
|
|
881
|
+
setDraggedNode(node: V2Node): void;
|
|
882
|
+
};
|
|
853
883
|
}
|
|
854
884
|
interface DragState {
|
|
855
885
|
isDragging: boolean;
|
|
@@ -859,6 +889,9 @@ declare class DragManager {
|
|
|
859
889
|
private config?;
|
|
860
890
|
private state;
|
|
861
891
|
private readonly DRAG_CLICK_TOLERANCE_PX;
|
|
892
|
+
private dragRenderPending;
|
|
893
|
+
private lastDragRenderTime;
|
|
894
|
+
private pendingAnimationFrame?;
|
|
862
895
|
/**
|
|
863
896
|
* Initialize drag behavior
|
|
864
897
|
*/
|
|
@@ -875,6 +908,10 @@ declare class DragManager {
|
|
|
875
908
|
* Handle drag movement
|
|
876
909
|
*/
|
|
877
910
|
private handleDrag;
|
|
911
|
+
/**
|
|
912
|
+
* RAF-throttled render during drag (like ZoomManager pattern)
|
|
913
|
+
*/
|
|
914
|
+
private throttledDragRender;
|
|
878
915
|
/**
|
|
879
916
|
* Handle drag end
|
|
880
917
|
*/
|
|
@@ -907,6 +944,10 @@ interface ZoomConfig {
|
|
|
907
944
|
canvas: HTMLCanvasElement;
|
|
908
945
|
canvasManager: CanvasManager;
|
|
909
946
|
onRender: () => void;
|
|
947
|
+
onZoomEnd?: () => void;
|
|
948
|
+
renderer?: {
|
|
949
|
+
setZoomState(isZooming: boolean): void;
|
|
950
|
+
};
|
|
910
951
|
minZoom?: number;
|
|
911
952
|
maxZoom?: number;
|
|
912
953
|
isOverEntity?: () => boolean;
|
|
@@ -914,6 +955,9 @@ interface ZoomConfig {
|
|
|
914
955
|
declare class ZoomManager {
|
|
915
956
|
private config?;
|
|
916
957
|
private zoomBehavior?;
|
|
958
|
+
private isZooming;
|
|
959
|
+
private zoomRenderPending;
|
|
960
|
+
private isProgrammaticZoom;
|
|
917
961
|
/**
|
|
918
962
|
* Initialize zoom behavior
|
|
919
963
|
*/
|
|
@@ -927,13 +971,14 @@ declare class ZoomManager {
|
|
|
927
971
|
*/
|
|
928
972
|
private handleZoomStart;
|
|
929
973
|
/**
|
|
930
|
-
* Handle zoom events
|
|
974
|
+
* Handle zoom events with RAF throttling for smooth performance
|
|
931
975
|
*/
|
|
932
976
|
private handleZoom;
|
|
933
977
|
/**
|
|
934
978
|
* Handle zoom end (when panning ends)
|
|
935
979
|
*/
|
|
936
980
|
private handleZoomEnd;
|
|
981
|
+
isCurrentlyZooming(): boolean;
|
|
937
982
|
/**
|
|
938
983
|
* Get zoom behavior instance
|
|
939
984
|
*/
|
|
@@ -1015,6 +1060,7 @@ declare class SelectionManager {
|
|
|
1015
1060
|
private selectionState;
|
|
1016
1061
|
private eventHandlers;
|
|
1017
1062
|
private container?;
|
|
1063
|
+
private boundHandlers;
|
|
1018
1064
|
/**
|
|
1019
1065
|
* Initialize selection manager
|
|
1020
1066
|
*/
|
|
@@ -1082,161 +1128,263 @@ declare class SelectionManager {
|
|
|
1082
1128
|
}
|
|
1083
1129
|
|
|
1084
1130
|
/**
|
|
1085
|
-
* V2 Canvas Graph -
|
|
1131
|
+
* V2 Canvas Graph - State Manager
|
|
1086
1132
|
*
|
|
1087
|
-
*
|
|
1133
|
+
* Centralized state management for O(1) lookups across all renderers.
|
|
1134
|
+
* Eliminates duplicate Maps and provides consistent caching patterns.
|
|
1088
1135
|
*/
|
|
1089
1136
|
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
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 {
|
|
1096
1151
|
private nodeMap;
|
|
1097
|
-
private
|
|
1098
|
-
private
|
|
1099
|
-
private
|
|
1100
|
-
private
|
|
1101
|
-
private
|
|
1102
|
-
private linkHoverPrecision;
|
|
1152
|
+
private linkMap;
|
|
1153
|
+
private nodeStateCache;
|
|
1154
|
+
private linkStateCache;
|
|
1155
|
+
private linkIdToLinkMap;
|
|
1156
|
+
private highlightedNodes;
|
|
1103
1157
|
/**
|
|
1104
|
-
* Initialize
|
|
1158
|
+
* Initialize with graph data
|
|
1105
1159
|
*/
|
|
1106
|
-
initialize(
|
|
1107
|
-
nodes: V2Node[];
|
|
1108
|
-
links: V2Link[];
|
|
1109
|
-
interaction?: InteractionConfig;
|
|
1110
|
-
}, canvasState: CanvasState, hoverManager: HoverManager, selectionManager?: SelectionManager): void;
|
|
1160
|
+
initialize(state: GraphState): void;
|
|
1111
1161
|
/**
|
|
1112
|
-
*
|
|
1162
|
+
* Update with new graph data
|
|
1113
1163
|
*/
|
|
1114
|
-
|
|
1164
|
+
updateState(state: GraphState): void;
|
|
1115
1165
|
/**
|
|
1116
|
-
*
|
|
1166
|
+
* Build node map for O(1) node lookups
|
|
1117
1167
|
*/
|
|
1118
|
-
|
|
1168
|
+
private buildNodeMap;
|
|
1119
1169
|
/**
|
|
1120
|
-
*
|
|
1170
|
+
* Build link maps for O(1) link lookups
|
|
1121
1171
|
*/
|
|
1122
|
-
|
|
1172
|
+
private buildLinkMaps;
|
|
1123
1173
|
/**
|
|
1124
|
-
*
|
|
1174
|
+
* Get node by ID (O(1) lookup)
|
|
1125
1175
|
*/
|
|
1126
|
-
|
|
1176
|
+
getNode(nodeId: string): V2Node | undefined;
|
|
1127
1177
|
/**
|
|
1128
|
-
*
|
|
1178
|
+
* Get link by link ID (O(1) lookup)
|
|
1129
1179
|
*/
|
|
1130
|
-
|
|
1180
|
+
getLink(linkId: string): V2Link | undefined;
|
|
1131
1181
|
/**
|
|
1132
|
-
*
|
|
1182
|
+
* Get link by source/target IDs (O(1) lookup)
|
|
1133
1183
|
*/
|
|
1134
|
-
|
|
1184
|
+
getLinkByNodes(sourceId: string, targetId: string): V2Link | undefined;
|
|
1135
1185
|
/**
|
|
1136
|
-
*
|
|
1186
|
+
* Get all nodes (returns reference to avoid copying)
|
|
1137
1187
|
*/
|
|
1138
|
-
|
|
1188
|
+
getAllNodes(): V2Node[];
|
|
1139
1189
|
/**
|
|
1140
|
-
* Get
|
|
1190
|
+
* Get all links (returns reference to avoid copying)
|
|
1141
1191
|
*/
|
|
1142
|
-
|
|
1192
|
+
getAllLinks(): V2Link[];
|
|
1143
1193
|
/**
|
|
1144
|
-
*
|
|
1194
|
+
* Get node map (for renderers that need direct map access)
|
|
1145
1195
|
*/
|
|
1146
|
-
|
|
1196
|
+
getNodeMap(): Map<string, V2Node>;
|
|
1147
1197
|
/**
|
|
1148
|
-
*
|
|
1198
|
+
* Get link ID to link map (for renderers that need direct map access)
|
|
1149
1199
|
*/
|
|
1150
|
-
|
|
1200
|
+
getLinkIdToLinkMap(): Map<string, V2Link>;
|
|
1151
1201
|
/**
|
|
1152
|
-
*
|
|
1202
|
+
* Cache node state for performance (avoid repeated hover/selection checks)
|
|
1153
1203
|
*/
|
|
1154
|
-
|
|
1204
|
+
cacheNodeState(nodeId: string, state: NodeLookupState): void;
|
|
1155
1205
|
/**
|
|
1156
|
-
*
|
|
1206
|
+
* Get cached node state
|
|
1157
1207
|
*/
|
|
1158
|
-
|
|
1208
|
+
getCachedNodeState(nodeId: string): NodeLookupState | undefined;
|
|
1159
1209
|
/**
|
|
1160
|
-
*
|
|
1210
|
+
* Cache link state for performance (avoid repeated hover/selection checks)
|
|
1161
1211
|
*/
|
|
1162
|
-
|
|
1212
|
+
cacheLinkState(linkId: string, state: LinkLookupState): void;
|
|
1163
1213
|
/**
|
|
1164
|
-
* Get
|
|
1214
|
+
* Get cached link state
|
|
1165
1215
|
*/
|
|
1166
|
-
|
|
1216
|
+
getCachedLinkState(linkId: string): LinkLookupState | undefined;
|
|
1167
1217
|
/**
|
|
1168
|
-
*
|
|
1218
|
+
* Clear state caches (call when hover/selection state changes)
|
|
1169
1219
|
*/
|
|
1170
|
-
|
|
1220
|
+
clearStateCache(): void;
|
|
1171
1221
|
/**
|
|
1172
|
-
*
|
|
1222
|
+
* Clear only node state cache
|
|
1173
1223
|
*/
|
|
1174
|
-
|
|
1224
|
+
clearNodeStateCache(): void;
|
|
1175
1225
|
/**
|
|
1176
|
-
*
|
|
1226
|
+
* Clear only link state cache
|
|
1177
1227
|
*/
|
|
1178
|
-
|
|
1228
|
+
clearLinkStateCache(): void;
|
|
1179
1229
|
/**
|
|
1180
|
-
*
|
|
1230
|
+
* Generate consistent link ID
|
|
1181
1231
|
*/
|
|
1182
|
-
|
|
1232
|
+
getLinkId(link: V2Link): string;
|
|
1183
1233
|
/**
|
|
1184
|
-
*
|
|
1234
|
+
* Calculate link midpoint (common utility)
|
|
1185
1235
|
*/
|
|
1186
|
-
|
|
1236
|
+
getLinkMidpoint(link: V2Link): {
|
|
1237
|
+
x: number;
|
|
1238
|
+
y: number;
|
|
1239
|
+
} | null;
|
|
1187
1240
|
/**
|
|
1188
|
-
*
|
|
1241
|
+
* Highlight a node by ID
|
|
1189
1242
|
*/
|
|
1190
|
-
|
|
1243
|
+
highlightNode(nodeId: string): void;
|
|
1191
1244
|
/**
|
|
1192
|
-
*
|
|
1245
|
+
* Highlight multiple nodes by IDs
|
|
1193
1246
|
*/
|
|
1194
|
-
|
|
1247
|
+
highlightNodes(nodeIds: string[]): void;
|
|
1195
1248
|
/**
|
|
1196
|
-
*
|
|
1249
|
+
* Remove highlight from a node
|
|
1197
1250
|
*/
|
|
1198
|
-
|
|
1251
|
+
unhighlightNode(nodeId: string): void;
|
|
1199
1252
|
/**
|
|
1200
|
-
*
|
|
1253
|
+
* Clear all node highlights
|
|
1201
1254
|
*/
|
|
1202
|
-
|
|
1255
|
+
clearHighlights(): void;
|
|
1203
1256
|
/**
|
|
1204
|
-
* Check if a node is
|
|
1257
|
+
* Check if a node is highlighted
|
|
1205
1258
|
*/
|
|
1206
|
-
|
|
1259
|
+
isNodeHighlighted(nodeId: string): boolean;
|
|
1207
1260
|
/**
|
|
1208
|
-
*
|
|
1261
|
+
* Get all highlighted node IDs
|
|
1209
1262
|
*/
|
|
1210
|
-
|
|
1263
|
+
getHighlightedNodes(): Set<string>;
|
|
1211
1264
|
/**
|
|
1212
|
-
*
|
|
1213
|
-
* (either the link itself is selected, or its connected node is selected)
|
|
1265
|
+
* Clear state cache for a specific node
|
|
1214
1266
|
*/
|
|
1215
|
-
private
|
|
1267
|
+
private clearSingleNodeStateCache;
|
|
1216
1268
|
/**
|
|
1217
|
-
*
|
|
1269
|
+
* Get statistics about cached state
|
|
1218
1270
|
*/
|
|
1219
|
-
|
|
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;
|
|
1303
|
+
/**
|
|
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;
|
|
1220
1319
|
/**
|
|
1221
|
-
*
|
|
1320
|
+
* Initialize the hit detection renderer for shadow canvas
|
|
1222
1321
|
*/
|
|
1223
|
-
private
|
|
1322
|
+
private initializeHitDetectionRenderer;
|
|
1224
1323
|
/**
|
|
1225
|
-
*
|
|
1324
|
+
* Initialize the drag optimizer for fast drag rendering
|
|
1226
1325
|
*/
|
|
1227
|
-
private
|
|
1326
|
+
private initializeDragOptimizer;
|
|
1228
1327
|
/**
|
|
1229
|
-
*
|
|
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)
|
|
1230
1342
|
*/
|
|
1231
|
-
|
|
1343
|
+
setDragState(isDragging: boolean): void;
|
|
1232
1344
|
/**
|
|
1233
|
-
*
|
|
1345
|
+
* Set the currently dragged node
|
|
1234
1346
|
*/
|
|
1235
|
-
|
|
1347
|
+
setDraggedNode(draggedNode: V2Node): void;
|
|
1236
1348
|
/**
|
|
1237
|
-
* Render
|
|
1349
|
+
* Render shadow canvas for hit detection (delegates to HitDetectionRenderer)
|
|
1238
1350
|
*/
|
|
1239
|
-
|
|
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)
|
|
1370
|
+
*/
|
|
1371
|
+
private getLinkId;
|
|
1372
|
+
/**
|
|
1373
|
+
* Reset performance metrics
|
|
1374
|
+
*/
|
|
1375
|
+
resetPerformanceMetrics(): void;
|
|
1376
|
+
/**
|
|
1377
|
+
* Get current performance metrics
|
|
1378
|
+
*/
|
|
1379
|
+
getPerformanceMetrics(): StatsMetrics;
|
|
1380
|
+
/**
|
|
1381
|
+
* Force log performance metrics immediately (for debugging)
|
|
1382
|
+
*/
|
|
1383
|
+
forceLogMetrics(): void;
|
|
1384
|
+
/**
|
|
1385
|
+
* Calculate midpoint of a link for label positioning (delegates to StateManager)
|
|
1386
|
+
*/
|
|
1387
|
+
private getLinkMidpoint;
|
|
1240
1388
|
/**
|
|
1241
1389
|
* Initialize node positions if needed
|
|
1242
1390
|
*/
|
|
@@ -1261,44 +1409,16 @@ declare class Renderer {
|
|
|
1261
1409
|
};
|
|
1262
1410
|
};
|
|
1263
1411
|
/**
|
|
1264
|
-
* Debug shadow canvas export (
|
|
1412
|
+
* Debug shadow canvas export (delegates to HitDetectionRenderer)
|
|
1265
1413
|
*/
|
|
1266
1414
|
debugShadowCanvas(): void;
|
|
1267
|
-
/**
|
|
1268
|
-
* Build node index for O(1) lookups (Step 3 optimization)
|
|
1269
|
-
*/
|
|
1270
|
-
private buildNodeIndex;
|
|
1271
|
-
/**
|
|
1272
|
-
* Get node by ID using O(1) lookup (Step 3 optimization)
|
|
1273
|
-
*/
|
|
1274
|
-
private getNodeById;
|
|
1275
|
-
/**
|
|
1276
|
-
* Render with z-index layers (for renderWithTransform)
|
|
1277
|
-
*/
|
|
1278
|
-
private renderWithLayers;
|
|
1279
|
-
/**
|
|
1280
|
-
* Render with z-index layers and performance metrics (for main render)
|
|
1281
|
-
*/
|
|
1282
|
-
private renderWithLayersAndMetrics;
|
|
1283
|
-
/**
|
|
1284
|
-
* Helper methods for getting current interaction states
|
|
1285
|
-
*/
|
|
1286
|
-
private getHoveredNode;
|
|
1287
|
-
private getSelectedNode;
|
|
1288
|
-
private getHoveredLink;
|
|
1289
|
-
private getSelectedLink;
|
|
1290
|
-
/**
|
|
1291
|
-
* Layer-specific rendering methods (render subsets of entities)
|
|
1292
|
-
*/
|
|
1293
|
-
private renderNodesWithLabelsLayer;
|
|
1294
|
-
/**
|
|
1295
|
-
* Helper method to truncate labels (copied from NodeLabelsRenderer)
|
|
1296
|
-
*/
|
|
1297
|
-
private truncateLabel;
|
|
1298
1415
|
private renderLinksLayer;
|
|
1299
|
-
private renderLinkLabelsLayer;
|
|
1300
1416
|
private renderNodesLayer;
|
|
1301
1417
|
private renderNodeLabelsLayer;
|
|
1418
|
+
/**
|
|
1419
|
+
* Get the state manager for highlight operations
|
|
1420
|
+
*/
|
|
1421
|
+
getStateManager(): StateManager;
|
|
1302
1422
|
/**
|
|
1303
1423
|
* Destroy renderer and clean up resources
|
|
1304
1424
|
*/
|
|
@@ -1458,6 +1578,26 @@ declare class V2Graph implements V2Instance {
|
|
|
1458
1578
|
* Draw legend on export canvas
|
|
1459
1579
|
*/
|
|
1460
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>;
|
|
1461
1601
|
/**
|
|
1462
1602
|
* Destroy the graph and clean up resources
|
|
1463
1603
|
*/
|
|
@@ -1468,4 +1608,4 @@ declare class V2Graph implements V2Instance {
|
|
|
1468
1608
|
*/
|
|
1469
1609
|
declare function createV2Graph(config: V2Config): V2Instance;
|
|
1470
1610
|
|
|
1471
|
-
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 };
|