@@ -90,41 +90,3 @@ dual_param <- function(x, default = list(x = NULL, y = NULL)) {
90
90
list (x = x , y = x )
91
91
}
92
92
}
93
-
94
- bin2d_breaks <- function (scale , breaks = NULL , origin = NULL , binwidth = NULL ,
95
- bins = 30 , closed = " right" ) {
96
- # Bins for categorical data should take the width of one level,
97
- # and should show up centered over their tick marks. All other parameters
98
- # are ignored.
99
- if (scale $ is_discrete()) {
100
- breaks <- scale $ get_breaks()
101
- return (- 0.5 + seq_len(length(breaks ) + 1 ))
102
- } else {
103
- if (! is.null(breaks )) {
104
- breaks <- scale $ transform(breaks )
105
- }
106
- }
107
-
108
- if (! is.null(breaks ))
109
- return (breaks )
110
-
111
- range <- scale $ get_limits()
112
-
113
- if (is.null(binwidth ) || identical(binwidth , NA )) {
114
- binwidth <- diff(range ) / bins
115
- }
116
- check_number_decimal(binwidth )
117
-
118
- if (is.null(origin ) || identical(origin , NA )) {
119
- origin <- round_any(range [1 ], binwidth , floor )
120
- }
121
- check_number_decimal(origin )
122
-
123
- breaks <- seq(origin , range [2 ] + binwidth , binwidth )
124
-
125
- # Check if the last bin lies fully outside the range
126
- if (length(breaks ) > 1 && breaks [length(breaks ) - 1 ] > = range [2 ]) {
127
- breaks <- breaks [- length(breaks )]
128
- }
129
- bins(breaks , closed )$ fuzzy
130
- }
0 commit comments