-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Adds decorate functionality to module output #1357
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…er creation - some documentation - some todo's
gogonzo
commented
Oct 9, 2024
gogonzo
commented
Oct 9, 2024
gogonzo
commented
Oct 9, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
kpagacz
reviewed
Oct 14, 2024
Co-authored-by: Marcin <[email protected]> Fixes comments on vignette example on #1357
5 tasks
averissimo
added a commit
to insightsengineering/teal.modules.general
that referenced
this pull request
Nov 26, 2024
Partner to insightsengineering/teal#1357 <details><summary>Working Example </summary> ```r devtools::load_all('../teal') devtools::load_all('.') # general data example data <- teal_data() data <- within(data, { CO2 <- CO2 CO2[["primary_key"]] <- seq_len(nrow(CO2)) }) join_keys(data) <- join_keys(join_key("CO2", "CO2", "primary_key")) vars <- choices_selected(variable_choices(data[["CO2"]], c("Plant", "Type", "Treatment"))) boxplot_decorator <- teal_transform_module( label = "Footnote", ui = function(id) shiny::textInput(shiny::NS(id, "footnote"), "Box plot Footnote", value = "BOX PLOT I am a good decorator"), server = function(id, data) { moduleServer(id, function(input, output, session) { logger::log_info("🟢 Footnote called to action!", namespace = "teal.modules.general") reactive( within( data(), { if (exists("box_plot")) { footnote_str <- footnote box_plot <- box_plot + ggplot2::labs(caption = footnote_str) } }, footnote = input$footnote ) ) }) } ) cum_dist_decorator <- teal_transform_module( label = "Footnote", ui = function(id) shiny::textInput(shiny::NS(id, "footnote"), "Cum dist Footnote", value = "CUM DIST I am a good decorator"), server = function(id, data) { moduleServer(id, function(input, output, session) { logger::log_info("🟢 Footnote called to action!", namespace = "teal.modules.general") reactive( within( data(), { if (exists("cum_dist_plot")) { footnote_str <- footnote cum_dist_plot <- cum_dist_plot + ggplot2::labs(caption = footnote_str) } }, footnote = input$footnote ) ) }) } ) app <- init( data = data, modules = modules( tm_outliers( outlier_var = list( data_extract_spec( dataname = "CO2", select = select_spec( label = "Select variable:", choices = variable_choices(data[["CO2"]], c("conc", "uptake")), selected = "uptake", multiple = FALSE, fixed = FALSE ) ) ), categorical_var = list( data_extract_spec( dataname = "CO2", filter = filter_spec( vars = vars, choices = value_choices(data[["CO2"]], vars$selected), selected = value_choices(data[["CO2"]], vars$selected), multiple = TRUE ) ) ), decorators = list(boxplot_decorator, cum_dist_decorator) ) ) ) if (interactive()) { shinyApp(app$ui, app$server) } ``` <details> --------- Signed-off-by: André Veríssimo <[email protected]> Co-authored-by: André Veríssimo <[email protected]>
averissimo
reviewed
Nov 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
averissimo
reviewed
Nov 29, 2024
averissimo
reviewed
Nov 29, 2024
Co-authored-by: André Veríssimo <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: André Veríssimo <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: André Veríssimo <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: André Veríssimo <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: André Veríssimo <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: André Veríssimo <[email protected]> Signed-off-by: Marcin <[email protected]>
m7pr
approved these changes
Nov 29, 2024
Co-authored-by: Lluís Revilla <[email protected]> Signed-off-by: André Veríssimo <[email protected]>
Signed-off-by: André Veríssimo <[email protected]>
Signed-off-by: André Veríssimo <[email protected]>
llrs-roche
reviewed
Nov 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit 2fd5402#diff-e0580713ebab38629323af94a681f70a14d5651b6294a0a941c8d8b31848d01bR683-R685 looks good, just a minor comment.
🔥 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #1383 #1384
Companion PRs:
decorators
feature branch teal.modules.general#795example tmg app