add_box: Add a box layer to the chess board

Description Usage Arguments Value Examples

View source: R/add_box.R

Description

Add a box layer to the chess board

Usage

1
2
3
4
5
6
7
8
9
add_box(
  bottom_left,
  top_right,
  size = 1.5,
  linetype = "solid",
  fill = NA,
  col = "red",
  ...
)

Arguments

bottom_left

square for box bottom left coordinate (eg "e4")

top_right

square for box top right coordinate

size

Box line size

linetype

Box line type

fill

Box fill (default = NA (no fill))

col

Box line colour (default = "red")

...

Further arguments passed to ggplot2::geom_rect()

Value

A ggplot2 geom_segment() layer

Examples

1
2
3
4
plot_fen() + add_box("d4", "e5")
plot_fen() +
  add_box("d4", "e5", fill = "white", alpha=1/2) +
  add_box("g3", "h6", fill="green", alpha=1/2, col="black", linetype="solid")

cj-holmes/ggambit documentation built on July 22, 2021, 12:56 p.m.