polly-graph 0.2.2 → 0.2.4
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 +351 -233
- package/dist/index.css +2 -0
- package/dist/index.d.cts +18 -19
- package/dist/index.d.ts +18 -19
- package/dist/index.js +351 -233
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -49,9 +49,11 @@
|
|
|
49
49
|
justify-content: center;
|
|
50
50
|
cursor: pointer;
|
|
51
51
|
transition: background 120ms ease;
|
|
52
|
+
overflow: hidden;
|
|
52
53
|
}
|
|
53
54
|
.pg-control-btn:hover {
|
|
54
55
|
background: #f9fafb;
|
|
56
|
+
border-radius: 12px;
|
|
55
57
|
}
|
|
56
58
|
.pg-orient-vertical .pg-control-btn:not(:last-child) {
|
|
57
59
|
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
package/dist/index.d.cts
CHANGED
|
@@ -428,6 +428,17 @@ interface V2Instance {
|
|
|
428
428
|
resetPerformanceMetrics(): void;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
interface PhysicsConfig {
|
|
432
|
+
nodes: V2Node[];
|
|
433
|
+
links: V2Link[];
|
|
434
|
+
width: number;
|
|
435
|
+
height: number;
|
|
436
|
+
onTick: () => void;
|
|
437
|
+
onEnd?: () => void;
|
|
438
|
+
autoFitView?: boolean;
|
|
439
|
+
cooldownTime?: number;
|
|
440
|
+
}
|
|
441
|
+
|
|
431
442
|
/**
|
|
432
443
|
* V2 Canvas Graph - Error Handling
|
|
433
444
|
*/
|
|
@@ -604,24 +615,15 @@ declare class CanvasManager {
|
|
|
604
615
|
* Manages D3 force simulation lifecycle and behavior
|
|
605
616
|
*/
|
|
606
617
|
|
|
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
618
|
declare class PhysicsManager {
|
|
618
619
|
private simulation?;
|
|
619
620
|
private config?;
|
|
620
621
|
private simulationStartTime?;
|
|
621
622
|
private simulationEndTime?;
|
|
622
|
-
private cooldownTimer?;
|
|
623
623
|
private hasInitialAutoFitCompleted;
|
|
624
624
|
private timerManager;
|
|
625
|
+
private isVisibilityListenerAttached;
|
|
626
|
+
private nodeMap;
|
|
625
627
|
constructor(timerManager: TimerManager);
|
|
626
628
|
/**
|
|
627
629
|
* Initialize physics simulation
|
|
@@ -639,6 +641,10 @@ declare class PhysicsManager {
|
|
|
639
641
|
* Setup cooldown timer (force-graph pattern)
|
|
640
642
|
*/
|
|
641
643
|
private setupCooldownTimer;
|
|
644
|
+
/**
|
|
645
|
+
* Build node index for O(1) lookups (Step 3 optimization)
|
|
646
|
+
*/
|
|
647
|
+
private buildNodeIndex;
|
|
642
648
|
/**
|
|
643
649
|
* Get simulation instance
|
|
644
650
|
*/
|
|
@@ -673,14 +679,6 @@ declare class PhysicsManager {
|
|
|
673
679
|
* Calculate base distance based on graph size and node count
|
|
674
680
|
*/
|
|
675
681
|
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
682
|
/**
|
|
685
683
|
* Get arrow length from link style or default
|
|
686
684
|
*/
|
|
@@ -715,6 +713,7 @@ declare class PhysicsManager {
|
|
|
715
713
|
* Resume the simulation
|
|
716
714
|
*/
|
|
717
715
|
resume(): void;
|
|
716
|
+
private handleVisibilityChange;
|
|
718
717
|
/**
|
|
719
718
|
* Destroy physics simulation
|
|
720
719
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -428,6 +428,17 @@ interface V2Instance {
|
|
|
428
428
|
resetPerformanceMetrics(): void;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
interface PhysicsConfig {
|
|
432
|
+
nodes: V2Node[];
|
|
433
|
+
links: V2Link[];
|
|
434
|
+
width: number;
|
|
435
|
+
height: number;
|
|
436
|
+
onTick: () => void;
|
|
437
|
+
onEnd?: () => void;
|
|
438
|
+
autoFitView?: boolean;
|
|
439
|
+
cooldownTime?: number;
|
|
440
|
+
}
|
|
441
|
+
|
|
431
442
|
/**
|
|
432
443
|
* V2 Canvas Graph - Error Handling
|
|
433
444
|
*/
|
|
@@ -604,24 +615,15 @@ declare class CanvasManager {
|
|
|
604
615
|
* Manages D3 force simulation lifecycle and behavior
|
|
605
616
|
*/
|
|
606
617
|
|
|
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
618
|
declare class PhysicsManager {
|
|
618
619
|
private simulation?;
|
|
619
620
|
private config?;
|
|
620
621
|
private simulationStartTime?;
|
|
621
622
|
private simulationEndTime?;
|
|
622
|
-
private cooldownTimer?;
|
|
623
623
|
private hasInitialAutoFitCompleted;
|
|
624
624
|
private timerManager;
|
|
625
|
+
private isVisibilityListenerAttached;
|
|
626
|
+
private nodeMap;
|
|
625
627
|
constructor(timerManager: TimerManager);
|
|
626
628
|
/**
|
|
627
629
|
* Initialize physics simulation
|
|
@@ -639,6 +641,10 @@ declare class PhysicsManager {
|
|
|
639
641
|
* Setup cooldown timer (force-graph pattern)
|
|
640
642
|
*/
|
|
641
643
|
private setupCooldownTimer;
|
|
644
|
+
/**
|
|
645
|
+
* Build node index for O(1) lookups (Step 3 optimization)
|
|
646
|
+
*/
|
|
647
|
+
private buildNodeIndex;
|
|
642
648
|
/**
|
|
643
649
|
* Get simulation instance
|
|
644
650
|
*/
|
|
@@ -673,14 +679,6 @@ declare class PhysicsManager {
|
|
|
673
679
|
* Calculate base distance based on graph size and node count
|
|
674
680
|
*/
|
|
675
681
|
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
682
|
/**
|
|
685
683
|
* Get arrow length from link style or default
|
|
686
684
|
*/
|
|
@@ -715,6 +713,7 @@ declare class PhysicsManager {
|
|
|
715
713
|
* Resume the simulation
|
|
716
714
|
*/
|
|
717
715
|
resume(): void;
|
|
716
|
+
private handleVisibilityChange;
|
|
718
717
|
/**
|
|
719
718
|
* Destroy physics simulation
|
|
720
719
|
*/
|