Create the shared reactive state used by the extensible ptr_* server
helpers. This object can be passed to the bind helpers or inspected directly
inside a larger Shiny app.
Usage
ptr_server_state(
formula,
envir = parent.frame(),
ui_text = NULL,
ids = ptr_build_ids(),
placeholders = NULL,
expr_check = TRUE
)Arguments
- formula
A single formula string using
ggpaintrplaceholders.- envir
Environment used to resolve local data objects when building the app.
- ui_text
Optional named list of copy overrides for UI labels, helper text, and placeholders.
- ids
A
ptr_build_idsobject describing the top-level Shiny ids used by the integration helpers.- placeholders
Optional custom placeholder definitions or an existing placeholder registry.
- expr_check
Controls
exprplaceholder validation.TRUE(default) applies the built-in denylist of dangerous functions.FALSEdisables all checking. A named list withdeny_listand/orallow_listcharacter vectors supplies a custom check; when both are given, denied entries are removed from the allowlist.
Examples
state <- ptr_server_state(
"ggplot(data = mtcars, aes(x = var, y = var)) + geom_point()"
)
is.function(state$runtime)
#> [1] TRUE