Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions R/coord-polar.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ CoordPolar <- ggproto("CoordPolar", Coord,

is_free = function() TRUE,

distance = function(self, x, y, details) {
distance = function(self, x, y, details, boost = 0.75) {
arc <- self$start + c(0, 2 * pi)
dir <- self$direction
if (self$theta == "x") {
Expand All @@ -94,8 +94,8 @@ CoordPolar <- ggproto("CoordPolar", Coord,
r <- rescale(x, from = details$r.range)
theta <- theta_rescale_no_clip(y, details$theta.range, arc, dir)
}

dist_polar(r, theta)
# The ^boost boosts detailed munching when r is small
dist_polar(r^boost, theta)
},

backtransform_range = function(self, panel_params) {
Expand Down
6 changes: 3 additions & 3 deletions R/coord-radial.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CoordRadial <- ggproto("CoordRadial", Coord,

is_free = function() TRUE,

distance = function(self, x, y, details) {
distance = function(self, x, y, details, boost = 0.75) {
arc <- details$arc %||% c(0, 2 * pi)
if (self$theta == "x") {
r <- rescale(y, from = details$r.range, to = self$inner_radius / 0.4)
Expand All @@ -129,8 +129,8 @@ CoordRadial <- ggproto("CoordRadial", Coord,
r <- rescale(x, from = details$r.range, to = self$inner_radius / 0.4)
theta <- theta_rescale_no_clip(y, details$theta.range, arc)
}

dist_polar(r, theta)
# The ^boost boosts detailed munching when r is small
dist_polar(r^boost, theta)
},

backtransform_range = function(self, panel_params) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading