---
title: "shinyCohortBuilder options"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{shinyCohortBuilder options}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(shinyCohortBuilder)
```

The goal of this document is to present what options can be specified while using `shinyCohortBuilder` and what effect do they have on the package operations.

## cb_verbose

Default value: `FALSE`.

When the option is enabled (`options("cb_verbose" = TRUE)`) operations taken in the filtering panel result with printing readable log about the operation state.

## scb_verbose

Default value: `FALSE`.

Similar to `cb_vebose`, enabling the option (`options("scb_verbose" = TRUE)`) results with printing readable logs. Logs are visible as popups in the Shiny application where filtering panel is used.

## scb_verbose_call_stack

Default value: `FALSE`.

Controls whether messages and warnings raised while handling filtering panel actions are logged together with their call stack.
By default (`FALSE`), messages and warnings are printed as-is, without the call stack, to keep the logs readable.
Enabling the option (`options("scb_verbose_call_stack" = TRUE)`) makes them pass through to `tryCatchLog`, so the call stack is included in the log output, which is useful when debugging.
Errors always include their call stack regardless of this option.

## scb_render_all

Default value: `FALSE`.

Having the option enabled, results with rendering filter related controllers only when the filter becomes active (enrolled in the filtering panel). This way when having large amount of filters configured you can improve performance of rendering the filtering panel (i.e. when initializing the app).

If you prefer to render all the filters when filtering panel is generated, just set `options("scb_render_all" = TRUE)`.
With such configuration, you can realize a slight delay when filter controllers are enrolled for the first time. 

## scb_labels

Default value: stored within `shinyCohortBuilder::scb_label` object.

List of labels used within the filtering panel.
For available names please check `shinyCohortBuilder::scb_label` structure.

## scb_icons

Default value: stored within `shinyCohortBuilder::scb_icons` object.

List of icons used within the filtering panel.
To list configurable icons please check `shinyCohortBuilder::scb_icons` structure.

## scb_chart_palette

Default value: stored within `shinyCohortBuilder::scb_chart_palette` object.

List of color palettes used to render filter feedback plots.
See `shinyCohortBuilder::scb_label` documentation for more details.

## scb_minified

Default value: `TRUE`.

Having the options enabled results with using minified version of css and js files used for filtering panel.
If you want to use original source (i.e. for debugging) please set `options("scb_minified" = FALSE)`.

## scb_repro_code_include_source, scb_repro_code_include_methods, scb_repro_code_include_action, scb_repro_code_mark_step

Default value: unset (the `cohort$get_code()` defaults are used).

These options control the code shown by the "Show Reproducible Code" action.
Each one, when set, is forwarded as the matching argument of `cohort$get_code()`
(`include_source`, `include_methods`, `include_action` and `mark_step`
respectively). Options left unset fall back to the `get_code()` defaults.

For example, to show only the source and binding step (no method definitions,
no per-step markers):

```r
options(
  scb_repro_code_include_source  = TRUE,
  scb_repro_code_include_methods = character(0),
  scb_repro_code_include_action  = "run_binding",
  scb_repro_code_mark_step       = FALSE
)
```
