Releases: trevorld/gridpattern
gridpattern v1.3.1
gridpattern v1.2.2
Bug fixes and minor improvements
-
grid.pattern_weave()adds the newunitsparameter
that most other "geometry" pattern functions received in gridpattern v1.2.1. -
The "polygon_tiling" pattern should now respect the
unitsparameter
if set to a value different from the "snpc" default (#82). -
For the "polygon_tiling" pattern
type = "18.18.3*"the size of the
eighteen-sided polygons have been increased a teeny bit and
this polygon tiling should look a bit cleaner. -
The following "placeholder" pattern updates (#83):
-
The following placeholder pattern names are now serviced by lucidinternets.com:
- "cage" and "cagebw"
- "murray" and "murraybw"
- "seagal" and "seagalbw"
-
The following placeholder pattern names have been removed since their associated web service no longer works:
- "lorempixel" and "lorempixelbw" (service unavailable since 2022)
- "placeimg" and "placeimgbw" (support officially ended July 2023)
-
The "dummybw" name now provides a pure black-and-white image (i.e. no grey).
-
Fixes a regression for the "placeholderbw" name where it redirected to the "seagal" name instead of "placeholder".
-
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.
gridpattern v1.1.1
- "text" pattern example now skipped if ran within certain graphics devices like
pdf()
that can't handle the playing cards Unicode glyphs (#68).
gridpattern v1.1.0
New Features
reset_image_cache()resets the image cache used bygrid.pattern_image()
andgrid.pattern_placeholder()to store images (#63).
Bug fixes and minor improvements
- The function
guess_has_R4.1_features()is now available as a "standalone" file.
You may copy its source under the permissive MIT No Attribution (MIT-0)
license into your own R package
by either usingusethis::use_standalone("trevorld/gridpattern", "standalone-guess_has_R4.1_features.R")
or simply copyingstandalone-guess_has_R4.1_features.Rinto yourRdirectory and
addinggrDevicesandutilsto theImportsof yourDESCRIPTIONfile. - If
{vdiffr}has been updated to at least v1.0.6 (released 2023-08-25) then
guess_has_R4.1_features()should now always correctly guess R4.1 feature support for the
svglite::svglite()andvdiffr:::svglite()graphics devices.
gridpattern v1.0.2
Bug fixes and minor improvements
- An internal function
convert_polygon_sf_to_polygon_df()will now be a bit more
quiet (throw WARNINGs less often).
gridpattern v1.0.1
Bug fixes and minor improvements
guess_has_R4.1_features()can now also take advantage ifdev.capabilities()
explicitly indicates that a feature is not supported in active graphics device.- To match aesthetic changes in
{ggplot2}one may now use the parameterlinewidthto
set polygon/path line widths in
grid.pattern_circle(),grid.pattern_crosshatch(),grid.pattern_pch(),
grid.pattern_polygon_tiling(),
grid.pattern_regular_polygon(),grid.pattern_stripe(),grid.pattern_rose(),
grid.pattern_wave(), andgrid.pattern_weave().
For backwards compatibility one may continue to usesizeas well.
Continue to usesize(orgp) to set the fontsize ingrid.pattern_text().
Bothpattern_linewidthandpattern_sizewill be available
for use in custom patterns (#57).
gridpattern v0.5.3
gridpattern v0.5.3
Bug Fixes and minor improvements
-
Fixes bug with
grid.pattern_image()withtype = "tile"(#47).
Additionallygrid.pattern_image()now supportsgravityargument whentype = "tile". -
If the active graphics device has also implemented the new R 4.2
dev.capabilities()support then
guess_has_R4.1_features()can now better guess R 4.1 graphic feature support when called within R 4.2.- In particular
guess_has_R4.1_features()can now better guess R 4.1 graphic feature support in the
{grDevices}bitmap devices (i.e.bmp(),jpeg(),png(),tiff())
when called within R 4.2 on Windows.
Previously it was not possible to easily distinguish on Windows if the device was called with
type = "windows"ortype = "cairo"and hence we had to conservatively guess no such support
even iftype = "cairo"had been specified (and within R 4.1 we must still conservatively do so). - Also if in the future any graphic devices add R 4.1 graphic feature support as well as
R 4.2dev.capabilities()support then we should now be able to correctly guess such support within R 4.2
without needing to manually updateguess_has_R4.1_features().
- In particular
-
guess_has_R4.1_features()now supports an argumentfeatureswhich allows one to
limit the guessing of R4.1 feature support to a subset ofc("clippingPaths", "gradients", "masks", "patterns").
Although all known graphic devices either implements all or none of these features
this need not hold true in the future.
gridpattern v0.5.1
Breaking Changes
grid.pattern_rose()andgrid.pattern_text()now "clip" their boundary using an
"alpha mask" rather than a "clipping path".
Now use the argumentuse_R4.1_masks, the global optionggpattern_use_R4.1_masks,
or the global optionggpattern_use_R4.1_featuresto toggle on/off the R 4.1 alpha mask
feature instead of using theuse_R4.1_clippingargument or
the global optionggpattern_use_R4.1_clippingas before
(the latter continue to toggle on/off the R 4.1 clipping path feature inclippingPathGrob()).
New Features
-
alphaMaskGrob()is a function that (alpha) masks one grob by using a second grob to specify the (alpha) mask.- If
use_R4.1_masksisTRUEwe simply use the new R 4.1 (alpha) masks feature. - If
use_R4.1_masksisFALSEwe generate agrid::rasterGrob()approximation. - If
use_R4.1_masksisNULLtry to guess an appropriate choice. - The default for
use_R4.1_maskscan be set byoptions("ggpattern_use_R4.1_masks").
- If
Bug fixes and minor improvements
guess_has_R4.1_features()now returnsTRUEfor theragg::agg_jpeg(),
ragg::agg_ppm(), andragg::agg_tiff()devices ifpackageVersion("ragg") >= '1.2.0'.
It also returnsTRUEforsvglite::svglite()ifpackageVersion("svglite") >= '2.1.0'.clippingPathGrob()will now consistently - as previously documented - useragg::agg_png()
as the defaultpng_devicegraphics device if it is available anduse_R4.1_clippingisFALSE.grid.pattern_image()should no longer throw an inscrutableError in magick_image_readpath...
error on certain platforms such as Windows (#47).
gridpattern v0.4.0
New Features
guess_has_R4.1_features()is now an exported function.
It guesses whether the "active" graphic devices supports the
new R 4.1 graphics features and returns
TRUEorFALSE.
Bug fixes and minor improvements
grid.pattern_polygon_tiling()now supports the "elongated_triangular"type(#48).
"geometry" patterns now support a "elongated_triangle"gridvalue.guess_has_R4.1_features()now returnsTRUEfor theragg::agg_png()device ifpackageVersion("ragg") >= '1.2.0'.
It now also returnsTRUEfor thegrDevices::bmp(type = "cairo"),grDevices::cairo_ps(),grDevices::jpeg(type = "cairo"),grDevices::tiff(type = "cairo").