gridpattern v1.2.1
Breaking Changes
- The default
typefor the "placeholder" pattern
is now "bear" instead of "kitten".
Explicitly settype = "kitten"to continue to use
the "kitten" placeholder but note that although
the "kitten" placeholder website isn't completely down
it has been buggy recently (#73).
New Features
-
patternFill()wrapspatternGrob()to return a
grid::pattern()fill object (#70). -
The "geometry" patterns (e.g. "circle", "stripe", etc.) now allow
thefillto be pattern fills (#67). -
The "geometry" patterns (e.g. "circle", "stripe", etc.) now allow
the newunitsparameter to set whichgrid::unit()to use for the
thespacing,xoffset, andyoffsetparameters
(and for the "wave" pattern also theamplitudeandfrequencyparameters) (#58).
By default it will continue to be "snpc" units but can now be changed to "cm", "in", etc. -
update_alpha()updates fill colour and/or pattern transparency.- It is a fork of
ggplot2::fill_alpha()by @teunbrand. - It does not depend on
{ggplot2}or{scales}. - It does not throw an error with a length one list of a vector of multiple colours.
- It is available as a "standalone" file.
You may copy its source under the permissive MIT license into your own R package by either
usingusethis::use_standalone("trevorld/gridpattern", "standalone-update_alpha.R")
or simply copyingstandalone-update_alpha.Rinto your R directory and adding
grDevices,grid, andrlangto theImportsof yourDESCRIPTIONfile.
- It is a fork of
-
For completeness there is now a new "fill" pattern with corresponding
grid.pattern_fill()which draws a simple fill pattern. -
For completeness there is now a
grid.pattern_none()corresponding to the previously
supported "none" pattern which draws nothing.
Bug fixes and minor improvements
- The
wavepattern no longer quietly and incorrectly ignores thefrequencyparameter.
The effective wavelength of the wave pattern is now1 / frequencyinstead ofspacing.
Howeverfrequencywill continue to default to1 / spacing. clippingPathGrob()can now more efficiently compute arasterGrob()approximation
viaragg::agg_capture()and forpng_devicefunctions that support
the clipping path feature such aspng(type = "cairo")(#74).alphaMaskGrob()can now more efficiently compute arasterGrob()approximation
forpng_devicefunctions that support
the alpha mask feature such aspng(type = "cairo")(#75).alphaMaskGrob()andclippingPathGrob()now
switch back to the previously open graphics device if
they open and close any new graphics devices.