gridpattern v0.2.1
Breaking Changes
- "array" patterns no longer set a minimum 12 pixel image width and/or height.
In particular, they can now have a zero pixel image width and/or height
(in which case the array pattern returns agrid::nullGrob()
). - "array" patterns no longer reduces the number of requested pixels when
legend = TRUE
.
New Features
-
Supports the following new patterns:
-
names_pattern
is a new character vector of supported (builtin) patterns. -
clippingPathGrob()
is a function that clips one grob according to clipping path set by a second grob.- If
use_R4.1_clipping
isTRUE
we simply use the new R 4.1 clipping path feature - If
use_R4.1_clipping
isFALSE
we generate agrid::rasterGrob()
approximation - If
use_R4.1_clipping
isNULL
try to guess an appropriate choice. - The default for
use_R4.1_clipping
can be set byoptions("ggpattern_use_R4.1_clipping")
- If
-
grid.pattern_gradient()
now supports the argumentuse_R4.1_gradients
- If
TRUE
use the new R 4.1 gradient feature - If
FALSE
use arasterGrob
approximation (old behaviour) - If
NULL
try to guess an appropriate choice. - The default for
use_R4.1_gradients
can be set byoptions("ggpattern_use_R4.1_gradients")
- If
-
The following package options can now be set by
options()
:ggpattern_use_R4.1_clipping
IfTRUE
use the grid clipping path feature introduced in R v4.1.0.
IfFALSE
do arasterGrob
approximation of the clipped pattern.
Currently used byclippingPathGrob()
,grid.pattern_rose()
,
grid.pattern_text()
, and available for custom patterns.ggpattern_use_R4.1_features
Set the default for all the other
ggpattern_use_R4.1_*
options arguments.ggpattern_use_R4.1_gradients
IfTRUE
use the grid gradient feature introduced in R v4.1.0.
IfFALSE
do arasterGrob
approximation of the gradient pattern.
Currently used bygrid.pattern_gradient()
and available for custom patterns.ggpattern_use_R4.1_masks
IfTRUE
use the grid mask feature introduced in R v4.1.0.
Currently unused by this package but available for custom patterns.ggpattern_use_R4.1_patterns
IfTRUE
use the grid pattern feature introduced in R v4.1.0.
Currently unused by this package but available for custom patterns.
Bug fixes and minor improvements
grid.pattern()
now throws an error if there is a non-unique pattern name
(set byoptions("ggpattern_geometry_funcs")
and/oroptions("ggpattern_array_funcs")
).- Fixes an error when catching a {magick} image reading error
for some array patterns.