These functions are Deprecated in this release of piecepackr, they will be marked as Defunct and removed in a future version.
halmaGrob(name = NULL, gp = gpar(), vp = NULL) kiteGrob(name = NULL, gp = gpar(), vp = NULL) pyramidGrob(name = NULL, gp = gpar(), vp = NULL) convexGrobFn(n_vertices, t) concaveGrobFn(n_vertices, t, r = 0.2) gridlinesGrob(col, shape = "rect", shape_t = 90, lex = 1, name = NULL) matGrob(col, shape = "rect", shape_t = 90, mat_width = 0, name = NULL) checkersGrob(col, shape = "rect", shape_t = 90, name = NULL) hexlinesGrob(col, shape = "rect", name = NULL) get_shape_grob_fn(shape, shape_t = 90, shape_r = 0.2, back = FALSE)
name | A character identifier (for grid) |
---|---|
gp | An object of class ‘gpar’ |
vp | A |
n_vertices | Number of vertices |
t | Angle (in degrees) of first vertex of shape |
r | Radial distance (from 0 to 0.5) |
col | Color |
shape | Label of shape |
shape_t | Angle (in degrees) of first vertex of shape (ignored by many shapes). |
lex | Scales width of line. |
mat_width | Numeric vector of mat widths |
shape_r | Radial distance (from 0 to 0.5) (ignored by most shapes) |
back | Logical of whether back of the piece, in which case will reflect shape along vertical axis. |
For get_shape_grob_fn
use pp_shape()$shape
instead.
For gridlinesGrob()
use pp_shape()$gridlines()
instead.
For matGrob()
use pp_shape()$mat()
instead.
For checkersGrob()
() use pp_shape()$checkers()
instead.
For hexlinesGrob()
use pp_shape()$hexlines()
instead.
For halmaGrob()
use pp_shape("halma")$shape()
instead.
For kiteGrob()
use pp_shape("kite")$shape()
instead.
For pyramidGrob()
use pp_shape("pyramid")$shape()
instead.
For convexGrobFn(n, t)
use pp_shape(paste0("convex", n), t)$shape
instead.
For concaveGrobFn(n, t, r)
use pp_shape(paste0("concave", n), t, r)$shape
instead.
if (require("grid")) { if (getRversion() < "4.0.0") suppressWarnings <- backports::suppressWarnings suppressWarnings({ gp <- gpar(col="black", fill="yellow") pushViewport(viewport(x=0.25, y=0.75, width=1/2, height=1/2)) grid.draw(get_shape_grob_fn("rect")(gp=gp)) grid.draw(gridlinesGrob("blue", lex=4)) grid.draw(hexlinesGrob("green")) popViewport() pushViewport(viewport(x=0.75, y=0.75, width=1/2, height=1/2)) grid.draw(get_shape_grob_fn("convex6")(gp=gp)) grid.draw(checkersGrob("blue", shape="convex6")) popViewport() pushViewport(viewport(x=0.25, y=0.25, width=1/2, height=1/2)) grid.draw(get_shape_grob_fn("circle")(gp=gp)) grid.draw(matGrob("blue", shape="circle", mat_width=0.2)) popViewport() pushViewport(viewport(x=0.75, y=0.25, width=1/2, height=1/2)) grid.draw(get_shape_grob_fn("rect")(gp=gp)) grid.draw(matGrob("blue", shape="rect", mat_width=c(0.2, 0.1, 0.3, 0.4))) popViewport() grid.newpage() gp <- gpar(col="black", fill="yellow") vp <- viewport(x=1/3-1/6, width=1/3) grid.draw(halmaGrob(gp=gp, vp=vp)) vp <- viewport(x=2/3-1/6, width=1/3) grid.draw(pyramidGrob(gp=gp, vp=vp)) vp <- viewport(x=3/3-1/6, width=1/3) grid.draw(kiteGrob(gp=gp, vp=vp)) grid.newpage() vp <- viewport(x=1/4, y=1/4, width=1/2, height=1/2) grid.draw(convexGrobFn(3, 0)(gp=gp, vp=vp)) vp <- viewport(x=3/4, y=1/4, width=1/2, height=1/2) grid.draw(convexGrobFn(4, 90)(gp=gp, vp=vp)) vp <- viewport(x=3/4, y=3/4, width=1/2, height=1/2) grid.draw(convexGrobFn(5, 180)(gp=gp, vp=vp)) vp <- viewport(x=1/4, y=3/4, width=1/2, height=1/2) grid.draw(convexGrobFn(6, 270)(gp=gp, vp=vp)) grid.newpage() vp <- viewport(x=1/4, y=1/4, width=1/2, height=1/2) grid.draw(concaveGrobFn(3, 0, 0.1)(gp=gp, vp=vp)) vp <- viewport(x=3/4, y=1/4, width=1/2, height=1/2) grid.draw(concaveGrobFn(4, 90, 0.2)(gp=gp, vp=vp)) vp <- viewport(x=3/4, y=3/4, width=1/2, height=1/2) grid.draw(concaveGrobFn(5, 180, 0.3)(gp=gp, vp=vp)) vp <- viewport(x=1/4, y=3/4, width=1/2, height=1/2) grid.draw(concaveGrobFn(6, 270)(gp=gp, vp=vp)) }, classes = "deprecatedWarning") }