@@ -17,6 +17,7 @@ export class Link extends Mark {
17
17
fillOpacity,
18
18
stroke,
19
19
strokeOpacity,
20
+ strokeWidth,
20
21
curve,
21
22
...options
22
23
} = { }
@@ -25,6 +26,7 @@ export class Link extends Mark {
25
26
const [ vfillOpacity , cfillOpacity ] = maybeNumber ( fillOpacity ) ;
26
27
const [ vstroke , cstroke ] = maybeColor ( stroke , "currentColor" ) ;
27
28
const [ vstrokeOpacity , cstrokeOpacity ] = maybeNumber ( strokeOpacity ) ;
29
+ const [ vstrokeWidth , cstrokeWidth ] = maybeNumber ( strokeWidth , 1 ) ;
28
30
super (
29
31
data ,
30
32
[
@@ -36,7 +38,8 @@ export class Link extends Mark {
36
38
{ name : "fill" , value : vfill , scale : "color" , optional : true } ,
37
39
{ name : "fillOpacity" , value : vfillOpacity , scale : "opacity" , optional : true } ,
38
40
{ name : "stroke" , value : vstroke , scale : "color" , optional : true } ,
39
- { name : "strokeOpacity" , value : vstrokeOpacity , scale : "opacity" , optional : true }
41
+ { name : "strokeOpacity" , value : vstrokeOpacity , scale : "opacity" , optional : true } ,
42
+ { name : "strokeWidth" , value : vstrokeWidth , optional : true }
40
43
] ,
41
44
options
42
45
) ;
@@ -47,13 +50,14 @@ export class Link extends Mark {
47
50
stroke : cstroke ,
48
51
strokeMiterlimit : cstroke === "none" ? undefined : 1 ,
49
52
strokeOpacity : cstrokeOpacity ,
53
+ strokeWidth : cstrokeWidth ,
50
54
...options
51
55
} ) ;
52
56
}
53
57
render (
54
58
I ,
55
59
{ x, y} ,
56
- { x1 : X1 , y1 : Y1 , x2 : X2 , y2 : Y2 , title : L , stroke : S , strokeOpacity : SO }
60
+ { x1 : X1 , y1 : Y1 , x2 : X2 , y2 : Y2 , title : L , stroke : S , strokeOpacity : SO , strokeWidth : SW }
57
61
) {
58
62
const index = filter ( I , X1 , Y1 , X2 , Y2 , S , SO ) ;
59
63
return create ( "svg:g" )
@@ -74,6 +78,7 @@ export class Link extends Mark {
74
78
} )
75
79
. call ( applyAttr , "stroke" , S && ( i => S [ i ] ) )
76
80
. call ( applyAttr , "stroke-opacity" , SO && ( i => SO [ i ] ) )
81
+ . call ( applyAttr , "stroke-width" , SW && ( i => SW [ i ] ) )
77
82
. call ( title ( L ) ) )
78
83
. node ( ) ;
79
84
}
0 commit comments