66GeomCurve <- ggproto(
77 " GeomCurve" , GeomSegment ,
88
9- draw_panel = function (data , panel_params , coord , curvature = 0.5 , angle = 90 ,
10- ncp = 5 , arrow = NULL , arrow.fill = NULL , lineend = " butt" , na.rm = FALSE ) {
9+ draw_panel = function (data , panel_params , coord , curvature = 0.5 , angle = 90 , ncp = 5 , shape = 0.5 ,
10+ arrow = NULL , arrow.fill = NULL , lineend = " butt" , na.rm = FALSE ) {
1111
1212 if (! coord $ is_linear()) {
1313 cli :: cli_warn(" {.fn geom_curve} is not implemented for non-linear coordinates" )
@@ -31,11 +31,13 @@ GeomCurve <- ggproto(
3131
3232 arrow.fill <- arrow.fill %|| % trans $ colour
3333
34+ square <- (ncp == 1 && angle == 90 )
35+
3436 curveGrob(
3537 trans $ x , trans $ y , trans $ xend , trans $ yend ,
3638 default.units = " native" ,
37- curvature = curvature , angle = angle , ncp = ncp ,
38- square = FALSE , squareShape = 1 , inflect = FALSE , open = TRUE ,
39+ curvature = curvature , angle = angle , ncp = ncp , shape = shape ,
40+ square = square , squareShape = 1 , inflect = FALSE , open = TRUE ,
3941 gp = gg_par(
4042 col = alpha(trans $ colour , trans $ alpha ),
4143 fill = alpha(arrow.fill , trans $ alpha ),
0 commit comments