Commit d57ce4c
Reimplement classes in S7 (#6364)
* add S7 as import
* custom properties for theme elements
* convert theme elements to S7 classes
* adapt element definitions
* convert element_grob to S7 generic
* replace merge_element by S7
* implement `$.element` for backward compatibility
* Use S7 properties
* fix `inherits()` issues
* fix misc issues
* Revert "implement `$.element` for backward compatibility"
This reverts commit b038e8f.
* don't rely on `element$prop`
* move element properties
* convert `margin` to S7
* I liked index properties as an idea but apparently they print badly
* adapt failing example
* import S7
* convert theme to S7
* Reimplement S3 <uneval> into S7 <mapping>
* convert labels to S7
* make S7 class_ggplot
* Use `@` as accessor
* double dispatch for `ggplot_add()`
* Write methods for external generics as S7
* backward compatibility for ggplot class
* Implement <ggplot_built> as S7
* implement `as.gtable` methods
* rename mapping to class_mapping
* refine class_ggplot_built and related functions
* also access ggplot_built slots with normal extractors
* resolve gnarlyness in S3/S7 method conflicts
* fix esoteric 'promise already under evaluation' error
* fix series of minor issues
* export theme as class
* export labels class
* collect classes in one place
* revert @include decisions
* Make S7 generic of `get_alt_text()`
* backport `@`
* exempt classes from pkgdown
* lol at my incompetence
* allow variant error messages
* workaround for old R versions
* update pkgdown index
* backport `@`
* S7-aware `is_theme_element()`
* utility for grabbing props
* use classic extractors and subassignment
* fallback for `register_theme_elements()`
* contingencies for `inherits(x, <S7>)` on old R versions
* use `is_theme()`
* sprinkle notes
* bump staged deprecations
* add linejoins
* Disable `ggtext::element_markdown()` example
* fix failing tests
* redocument
* fix doc links
* soft-deprecate `%+%`
* simplify logic block
* don't evaluate code temporarily in FAQ example
* run revdepcheck
* recover from S3 mappings
* enable classic subsetting for ggplot_built
* fix typo
* prevent NSE shenannigans
* avoid `%+%` in test code
* add 'meta' property to track arbitrary fields
* document new property
* fix stretchy guide bug
* backward compatibility for `ggplot_add()`
* backward compatibility for `ggplot_add()`
* notes for the future
* backward compatibility for `ggplot_gtable()`
* backwards compatibility for `element_grob()`
* keep theme class
* add news bullet
* redirect other news
* add `italic`/`fontweight`/`fontwidth` properties (#6458)
* contingencies for old elements
* left out null/blank handling to from methods to generic
* also merge s3 elements
* revdepcheck
* remove outdated duplicate
* append old element classes
* append old uneval class
* append old ggplot classes
* allow for numeric `face`
* Symmetry between `$` and `[[` methods
* Revert `ggplot()` constructor to S3
* fallback for unit margins
* repair invalid theme
* make `rotate_just()` resilient for mixed S3/S7 classes
* redocument/snapshot
* revdepcheck
* contend with vector input
* unify mapping validation
* more carefullyl extract margins
* try to prevent cyclical `+`
* include snapshots
* protection against vectorised input
* fix typo
* add `as.list()` method
* be fussy about margin input length
* tiny version bump
* allow numeric colour
* defend against insanity
---------
Co-authored-by: Thomas Lin Pedersen <thomasp85@gmail.com>1 parent f7da3b4 commit d57ce4c
File tree
107 files changed
+37697
-14184
lines changed- R
- man
- revdep
- tests/testthat
- _snaps
- 4.0
- 4.4
- 4.5
- vignettes/articles
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
107 files changed
+37697
-14184
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
207 | | - | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 | | |
11 | | - | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
14 | 25 | | |
15 | 26 | | |
16 | | - | |
17 | | - | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 61 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 62 | + | |
| 63 | + | |
77 | 64 | | |
78 | | - | |
79 | 65 | | |
80 | 66 | | |
81 | 67 | | |
| |||
98 | 84 | | |
99 | 85 | | |
100 | 86 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 87 | | |
106 | 88 | | |
107 | 89 | | |
108 | 90 | | |
109 | | - | |
110 | 91 | | |
111 | 92 | | |
112 | 93 | | |
113 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
114 | 98 | | |
115 | | - | |
116 | 99 | | |
117 | 100 | | |
118 | 101 | | |
119 | 102 | | |
120 | | - | |
121 | | - | |
122 | 103 | | |
123 | 104 | | |
124 | 105 | | |
| |||
132 | 113 | | |
133 | 114 | | |
134 | 115 | | |
135 | | - | |
136 | 116 | | |
137 | 117 | | |
138 | 118 | | |
| |||
288 | 268 | | |
289 | 269 | | |
290 | 270 | | |
| 271 | + | |
291 | 272 | | |
292 | 273 | | |
293 | 274 | | |
| |||
311 | 292 | | |
312 | 293 | | |
313 | 294 | | |
| 295 | + | |
314 | 296 | | |
315 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
316 | 303 | | |
317 | 304 | | |
318 | 305 | | |
| |||
334 | 321 | | |
335 | 322 | | |
336 | 323 | | |
| 324 | + | |
337 | 325 | | |
338 | 326 | | |
339 | 327 | | |
| |||
353 | 341 | | |
354 | 342 | | |
355 | 343 | | |
| 344 | + | |
356 | 345 | | |
357 | 346 | | |
358 | 347 | | |
| |||
456 | 445 | | |
457 | 446 | | |
458 | 447 | | |
| 448 | + | |
459 | 449 | | |
460 | 450 | | |
461 | 451 | | |
| |||
762 | 752 | | |
763 | 753 | | |
764 | 754 | | |
| 755 | + | |
765 | 756 | | |
766 | 757 | | |
767 | 758 | | |
| |||
773 | 764 | | |
774 | 765 | | |
775 | 766 | | |
| 767 | + | |
776 | 768 | | |
777 | 769 | | |
778 | 770 | | |
779 | 771 | | |
780 | 772 | | |
| 773 | + | |
781 | 774 | | |
782 | 775 | | |
783 | 776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | | - | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 132 | | |
139 | 133 | | |
140 | | - | |
| 134 | + | |
| 135 | + | |
141 | 136 | | |
142 | 137 | | |
143 | 138 | | |
| |||
152 | 147 | | |
153 | 148 | | |
154 | 149 | | |
| 150 | + | |
155 | 151 | | |
156 | | - | |
157 | | - | |
| 152 | + | |
| 153 | + | |
158 | 154 | | |
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
162 | | - | |
163 | | - | |
| 158 | + | |
| 159 | + | |
164 | 160 | | |
165 | 161 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 162 | + | |
| 163 | + | |
171 | 164 | | |
172 | 165 | | |
173 | | - | |
174 | | - | |
| 166 | + | |
| 167 | + | |
175 | 168 | | |
176 | 169 | | |
177 | 170 | | |
| |||
212 | 205 | | |
213 | 206 | | |
214 | 207 | | |
215 | | - | |
216 | | - | |
| 208 | + | |
217 | 209 | | |
218 | 210 | | |
219 | 211 | | |
| |||
311 | 303 | | |
312 | 304 | | |
313 | 305 | | |
314 | | - | |
| 306 | + | |
315 | 307 | | |
316 | 308 | | |
317 | 309 | | |
| |||
337 | 329 | | |
338 | 330 | | |
339 | 331 | | |
340 | | - | |
| 332 | + | |
341 | 333 | | |
342 | 334 | | |
343 | 335 | | |
| |||
358 | 350 | | |
359 | 351 | | |
360 | 352 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
365 | 356 | | |
366 | 357 | | |
367 | 358 | | |
| |||
0 commit comments