Browse code

roundrect and ellipse layout incorporate with coord_flip

xiangpin authored on 12/08/2022 12:08:10
Showing 1 changed files

... ...
@@ -204,6 +204,9 @@ GeomCurvelink <- ggproto("GeomCurvelink", GeomSegment,
204 204
         trans$curvature <- curvature
205 205
     }else{
206 206
         trans <- coord$transform(data, panel_params)
207
+        if (inherits(coord, 'CoordFlip')){ 
208
+            trans$curvature <- -1 * trans$curvature
209
+        }
207 210
     }
208 211
     arrow.fill <- arrow.fill %|||% trans$colour
209 212
 
... ...
@@ -225,6 +228,7 @@ GeomCurvelink <- ggproto("GeomCurvelink", GeomSegment,
225 228
   }
226 229
 )
227 230
 
231
+
228 232
 # for inward curve lines
229 233
 generate_curvature <- function(starttheta, endtheta, hratio, ncp){
230 234
     flag <- endtheta - starttheta