@@ -16,11 +16,13 @@ export class Link extends Mark {
16
16
title,
17
17
stroke,
18
18
strokeOpacity,
19
+ strokeWidth,
19
20
...options
20
21
} = { }
21
22
) {
22
23
const [ vstroke , cstroke ] = maybeColor ( stroke , "currentColor" ) ;
23
24
const [ vstrokeOpacity , cstrokeOpacity ] = maybeNumber ( strokeOpacity ) ;
25
+ const [ vstrokeWidth , cstrokeWidth ] = maybeNumber ( strokeWidth , 1 ) ;
24
26
super (
25
27
data ,
26
28
[
@@ -31,20 +33,22 @@ export class Link extends Mark {
31
33
{ name : "z" , value : z , optional : true } ,
32
34
{ name : "title" , value : title , optional : true } ,
33
35
{ name : "stroke" , value : vstroke , scale : "color" , optional : true } ,
34
- { name : "strokeOpacity" , value : vstrokeOpacity , scale : "opacity" , optional : true }
36
+ { name : "strokeOpacity" , value : vstrokeOpacity , scale : "opacity" , optional : true } ,
37
+ { name : "strokeWidth" , value : vstrokeWidth , optional : true } ,
35
38
] ,
36
39
options
37
40
) ;
38
41
Style ( this , {
39
42
stroke : cstroke ,
40
43
strokeOpacity : cstrokeOpacity ,
44
+ strokeWidth : cstrokeWidth ,
41
45
...options
42
46
} ) ;
43
47
}
44
48
render (
45
49
I ,
46
50
{ x, y} ,
47
- { x1 : X1 , y1 : Y1 , x2 : X2 , y2 : Y2 , z : Z , title : L , stroke : S , strokeOpacity : SO }
51
+ { x1 : X1 , y1 : Y1 , x2 : X2 , y2 : Y2 , z : Z , title : L , stroke : S , strokeOpacity : SO , strokeWidth : SW }
48
52
) {
49
53
const index = filter ( I , X1 , Y1 , X2 , Y2 , S , SO ) ;
50
54
if ( Z ) index . sort ( ( i , j ) => ascending ( Z [ i ] , Z [ j ] ) ) ;
@@ -61,6 +65,7 @@ export class Link extends Mark {
61
65
. attr ( "y2" , i => Y2 [ i ] )
62
66
. call ( applyAttr , "stroke" , S && ( i => S [ i ] ) )
63
67
. call ( applyAttr , "stroke-opacity" , SO && ( i => SO [ i ] ) )
68
+ . call ( applyAttr , "stroke-width" , SW && ( i => SW [ i ] ) )
64
69
. call ( title ( L ) ) )
65
70
. node ( ) ;
66
71
}
0 commit comments