spsNewTab {systemPipeShiny} | R Documentation

## Create a new SPS tab

### Description

create custom tabs in newer (> 1.1) version of SPS. The old creation functions will be deprecated by next Bioconductor major release.

### Usage

    spsNewTab(
      tab_id = "vs_mytab",
      tab_displayname = "My custom plotting tab",
      img = "",
      app_path = getwd(),
      out_folder_path = file.path(app_path, "R"),
      author = "",
      template = c("simple", "full"),
      preview = FALSE,
      reformat = FALSE,
      open_file = TRUE,
      verbose = spsOption("verbose"),
      colorful = spsOption("use_crayon")
    )

### Arguments

`tab_id` | character string, length 1, must be unique. Use spsTabInfo(app_path = "YOUR_APP_PATH") to see current tab IDs.
`tab_displayname` | character string, length 1, the name to be displayed on side navigation bar list and tab title
`img` | realtive path, an image representation of the new plot. It can be a internet link or a local link which uses the www folder as the root. e.g. drop your image plot.png inside www/plot_list, then the link here is "plot_list/plot.png". You will see these images on "Custom Tabs" main page. If no provided, a warning will be given on app start and an empty image will show up on "Custom Tabs".
`app_path` | string, app directory, default is current directory
`out_folder_path` | string, which directory to write the new tab file, default is the R folder in the SPS project. If you write the file other than R, this file will not be automatically loaded by SPS or Shiny. You must source it manually.
`author` | character string, or a vector of strings. authors of the tab
`template` | one of "simple" or "full", default "simple". "simple" gives a tab file with minimum Shiny code, you can only focus on you R plotting code. "full" gives the full tab code, so you can modify everything on the tab.
`preview` | bool, TRUE will print the new tab code to console and will not write the file and will not register the tab
`reformat` | bool, whether to use styler::style_file reformat the code
`open_file` | bool, if Rstudio is detected, open the new tab file?
`verbose` | bool, default follows the project verbosity level. TRUE will give you more information on progress and debugging
`colorful` | bool, whether the message will be colorful or not

### Details

- template "simple": hides the UI and server code and use spsEzUI and spsEzServer instead.

- template "full": full tab code. You need to know some Shiny development knowledge.

### Value

returns a new tab file

### Examples

    spsInit(change_wd = FALSE, overwrite = TRUE)
    spsNewTab("vs_newtab_ez", app_path = glue::glue("SPS_{format(Sys.time(), '%Y%m%d')}"))
    spsNewTab("vs_newtab_full", template = "full",
    app_path = glue::glue("SPS_{format(Sys.time(), '%Y%m%d')}"))
    spsNewTab("vs_newtab_pre", preview = TRUE,
    app_path = glue::glue("SPS_{format(Sys.time(), '%Y%m%d')}"))

[Package systemPipeShiny version 1.4.0 Index]