|
13 | 13 | #' - `render_bg`: Renders background elements.
|
14 | 14 | #' - `render_axis_h`: Renders the horizontal axes.
|
15 | 15 | #' - `render_axis_v`: Renders the vertical axes.
|
16 |
| -#' - `range(panel_params)`: Extracts the panel range provided |
| 16 | +#' - `backtransform_range(panel_params)`: Extracts the panel range provided |
17 | 17 | #' in `panel_params` (created by `setup_panel_params()`, see below) and
|
18 |
| -#' back-transforms to data coordinates. This back-transformation is needed |
| 18 | +#' backtransforms to data coordinates. This back-transformation is needed |
19 | 19 | #' for coords such as `coord_flip()`, `coord_polar()`, `coord_trans()` where
|
20 | 20 | #' the range in the transformed coordinates differs from the range in the
|
21 | 21 | #' untransformed coordinates.
|
| 22 | +#' - `range`: Deprecated, do not implement. Calls `backtransform_range()`. |
22 | 23 | #' - `transform`: Transforms x and y coordinates.
|
23 | 24 | #' - `distance`: Calculates distance.
|
24 | 25 | #' - `is_linear`: Returns `TRUE` if the coordinate system is
|
@@ -84,14 +85,24 @@ Coord <- ggproto("Coord",
|
84 | 85 | # transform range given in transformed coordinates
|
85 | 86 | # back into range in given in (possibly scale-transformed)
|
86 | 87 | # data coordinates
|
87 |
| - range = function(panel_params) { |
| 88 | + backtransform_range = function(panel_params) { |
88 | 89 | warning(
|
89 | 90 | "range backtransformation not implemented in this coord; plot may be wrong.",
|
90 | 91 | call. = FALSE
|
91 | 92 | )
|
92 | 93 | list(x = panel_params$x.range, y = panel_params$y.range)
|
93 | 94 | },
|
94 | 95 |
|
| 96 | + # deprecated, do not use or reimplement |
| 97 | + # kept only for backwards compatibility |
| 98 | + range = function(self, panel_params) { |
| 99 | + warning( |
| 100 | + "function `Coord$range()` is deprecated; use `Coord$backtransform_range()`.", |
| 101 | + call. = FALSE |
| 102 | + ) |
| 103 | + self$backtransform_range(panel_params) |
| 104 | + }, |
| 105 | + |
95 | 106 | setup_panel_params = function(scale_x, scale_y, params = list()) {
|
96 | 107 | list()
|
97 | 108 | },
|
|
0 commit comments