-
-
Notifications
You must be signed in to change notification settings - Fork 15
Fix decorators #857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix decorators #857
Conversation
Code Coverage SummaryDiff against mainResults for commit: 82cd7a5 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 22 suites 13m 4s ⏱️ Results for commit 82cd7a5. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Results for commit fa74cb0 ♻️ This comment has been updated with latest results. |
|
@m7pr I also realised that the Transform Module Output vignette from teal was incorrect so this PR changes it. |
|
@vedhav I get this error when I am testing
with caption_decorator <- function(default_caption = "I am a good decorator", .var_to_replace = "plot") {
teal_transform_module(
label = "Caption",
ui = function(id) shiny::textInput(shiny::NS(id, "footnote"), "Footnote", value = default_caption),
server = make_teal_transform_server(
substitute({
.var_to_replace <- .var_to_replace + ggplot2::labs(caption = footnote)
}, env = list(.var_to_replace = as.name(.var_to_replace)))
)
)
}
# general data example
data <- teal_data()
data <- within(data, {
require(nestcolor)
USArrests <- USArrests
})
app <- init(
data = data,
modules = modules(
tm_a_pca(
"PCA",
dat = data_extract_spec(
dataname = "USArrests",
select = select_spec(
choices = variable_choices(
data = data[["USArrests"]], c("Murder", "Assault", "UrbanPop", "Rape")
),
selected = c("Murder", "Assault"),
multiple = TRUE
),
filter = NULL
),
decorators = list(eigenvector_plot = caption_decorator(.var_to_replace = 'eigenvector_plot '))
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
|



Closes #848