Skip to contents

layout_grid() calculates a layout data frame for a grid of identically sized print-and-play components.

Usage

layout_grid(
  nrow = 2L,
  ncol = 1L,
  width = 2.5,
  height = 3.5,
  bleed = 0,
  paper = getOption("papersize", "letter"),
  orientation = c("landscape", "portrait"),
  angle = 0,
  name = layout_name_fn(),
  direction = "left-to-right"
)

Arguments

nrow, ncol

Number of rows and columns of print-and-play components (e.g. cards)

width, height, bleed

Width, height, and bleed for each print-and-play component (in inches)

paper, orientation

Print-and-play paper size and orientation

angle

Vector of angles of the pieces in degrees (counter-clockwise) (assigned direction, top-to-bottom)

name

Either a vector of names of each piece or a function with arguments nrow and ncol to be used to generate a vector of names for each piece. These will be assigned direction, top-to-bottom. layout_name_fn() can be used to generate such a function.

direction

Should name and angle be assigned "left-to-right" or "right-to-left". Also supports aliases "ltr", "lr", "rtl", and "rl".

Value

A data frame with columns "row", "col", "x", "y", "angle", "width", "height", "bleed", "paper", "orientation", and "name".

Examples

# Button Shy card layout
layout_grid(nrow = 2L, ncol = 3L, height = 3.447, width = 2.469, bleed = 0.125)
#>   row col     x      y angle width height bleed  paper orientation    name
#> 1   1   1 2.781 6.0985     0 2.469  3.447 0.125 letter   landscape piece.1
#> 2   1   2 5.500 6.0985     0 2.469  3.447 0.125 letter   landscape piece.2
#> 3   1   3 8.219 6.0985     0 2.469  3.447 0.125 letter   landscape piece.3
#> 4   2   1 2.781 2.4015     0 2.469  3.447 0.125 letter   landscape piece.4
#> 5   2   2 5.500 2.4015     0 2.469  3.447 0.125 letter   landscape piece.5
#> 6   2   3 8.219 2.4015     0 2.469  3.447 0.125 letter   landscape piece.6