Skip to content

Commit 68592d2

Browse files
committed
add boosts to radius
1 parent 679ff96 commit 68592d2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

R/coord-polar.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ CoordPolar <- ggproto("CoordPolar", Coord,
8484

8585
is_free = function() TRUE,
8686

87-
distance = function(self, x, y, details) {
87+
distance = function(self, x, y, details, boost = 0.75) {
8888
arc <- self$start + c(0, 2 * pi)
8989
dir <- self$direction
9090
if (self$theta == "x") {
@@ -94,8 +94,8 @@ CoordPolar <- ggproto("CoordPolar", Coord,
9494
r <- rescale(x, from = details$r.range)
9595
theta <- theta_rescale_no_clip(y, details$theta.range, arc, dir)
9696
}
97-
98-
dist_polar(r, theta)
97+
# The ^boost boosts detailed munching when r is small
98+
dist_polar(r^boost, theta)
9999
},
100100

101101
backtransform_range = function(self, panel_params) {

R/coord-radial.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ CoordRadial <- ggproto("CoordRadial", Coord,
120120

121121
is_free = function() TRUE,
122122

123-
distance = function(self, x, y, details) {
123+
distance = function(self, x, y, details, boost = 0.75) {
124124
arc <- details$arc %||% c(0, 2 * pi)
125125
if (self$theta == "x") {
126126
r <- rescale(y, from = details$r.range, to = self$inner_radius / 0.4)
@@ -129,8 +129,8 @@ CoordRadial <- ggproto("CoordRadial", Coord,
129129
r <- rescale(x, from = details$r.range, to = self$inner_radius / 0.4)
130130
theta <- theta_rescale_no_clip(y, details$theta.range, arc)
131131
}
132-
133-
dist_polar(r, theta)
132+
# The ^boost boosts detailed munching when r is small
133+
dist_polar(r^boost, theta)
134134
},
135135

136136
backtransform_range = function(self, panel_params) {

0 commit comments

Comments
 (0)