R/mod_canvas_utils.R

Defines functions createPageItem safari_circle

safari_circle <- function(cx, fill, stroke) {
  tags$circle(
    cx = cx,
    cy = "5",
    r = "6",
    fill = fill,
    stroke = stroke,
    `stroke-width` = ".5"
  )
}

createPageItem <- function(page_index) {
  page_type <- names(PAGE_TYPES)[page_index]
  page_id <- unname(PAGE_TYPES[page_index])
  page_desc <- PAGE_DESCRIPTIONS[page_type]

  tags$button(
    class = "btn btn-secondary canvas-page-choice",
    type = "button",
    `data-page` = page_id,
    tags$h4(class = "canvas-choice-header", page_type),
    tags$p(class = "canvas-choice-content", page_desc)
  )
}

Try the designer package in your browser

Any scripts or data that you put into this service are public.

designer documentation built on Aug. 20, 2023, 5:06 p.m.