@@ -68,17 +68,17 @@ export class DagreLayout implements Layout<DagreLayoutOptions> {
68
68
private async genericDagreLayout (
69
69
assign : false ,
70
70
graph : IGraph ,
71
- options ?: DagreLayoutOptions
71
+ options ?: DagreLayoutOptions ,
72
72
) : Promise < LayoutMapping > ;
73
73
private async genericDagreLayout (
74
74
assign : true ,
75
75
graph : IGraph ,
76
- options ?: DagreLayoutOptions
76
+ options ?: DagreLayoutOptions ,
77
77
) : Promise < void > ;
78
78
private async genericDagreLayout (
79
79
assign : boolean ,
80
80
graph : IGraph ,
81
- options ?: DagreLayoutOptions
81
+ options ?: DagreLayoutOptions ,
82
82
) : Promise < LayoutMapping | void > {
83
83
const mergedOptions = { ...this . options , ...options } ;
84
84
const {
@@ -192,7 +192,7 @@ export class DagreLayout implements Layout<DagreLayoutOptions> {
192
192
if ( minY > node . data . y ! ) minY = node . data . y ! ;
193
193
} ) ;
194
194
g . getAllEdges ( ) . forEach ( ( edge ) => {
195
- edge . data . points ?. forEach ( ( point ) => {
195
+ edge . data . points ?. forEach ( ( point : Point ) => {
196
196
if ( minX > point . x ) minX = point . x ;
197
197
if ( minY > point . y ) minY = point . y ;
198
198
} ) ;
@@ -460,7 +460,7 @@ export class DagreLayout implements Layout<DagreLayoutOptions> {
460
460
// if (i <= -1) return;
461
461
if ( edgeLabelSpace && controlPoints && edge . data . type !== 'loop' ) {
462
462
edge . data . controlPoints = getControlPoints (
463
- edge . data . points ?. map ( ( { x, y } ) => ( {
463
+ edge . data . points ?. map ( ( { x, y } : Point ) => ( {
464
464
x : x + layoutTopLeft [ 0 ] ,
465
465
y : y + layoutTopLeft [ 1 ] ,
466
466
} ) ) ,
@@ -469,7 +469,7 @@ export class DagreLayout implements Layout<DagreLayoutOptions> {
469
469
layerCoordsArr ,
470
470
isHorizontal ,
471
471
isDifferentLayer ,
472
- filterControlPointsOutOfBoundary
472
+ filterControlPointsOutOfBoundary ,
473
473
) ;
474
474
}
475
475
} ) ;
@@ -525,8 +525,8 @@ const getControlPoints = (
525
525
filterControlPointsOutOfBoundary : (
526
526
ps : Point [ ] ,
527
527
point1 : Point ,
528
- point2 : Point
529
- ) => Point [ ]
528
+ point2 : Point ,
529
+ ) => Point [ ] ,
530
530
) => {
531
531
let controlPoints = points ?. slice ( 1 , points . length - 1 ) || [ ] ; // 去掉头尾
532
532
// 酌情增加控制点,使折线不穿过跨层的节点
@@ -575,7 +575,7 @@ const getControlPoints = (
575
575
controlPoints = filterControlPointsOutOfBoundary (
576
576
controlPoints ,
577
577
sourceNode . data as Point ,
578
- targetNode . data as Point
578
+ targetNode . data as Point ,
579
579
) ;
580
580
// one controlPoint at least
581
581
if ( ! controlPoints . length ) {
@@ -588,7 +588,7 @@ const getControlPoints = (
588
588
: {
589
589
x : sourceX ,
590
590
y : ( sourceY ! + targetY ! ) / 2 ,
591
- } ) as Point
591
+ } ) as Point ,
592
592
) ;
593
593
}
594
594
} else if ( layerDiff > 1 ) {
0 commit comments