Skip to content

correct example for ggplot_decorator#28

Open
aqlina wants to merge 4 commits intomainfrom
JGQO-527-ggplot-decorator-fix
Open

correct example for ggplot_decorator#28
aqlina wants to merge 4 commits intomainfrom
JGQO-527-ggplot-decorator-fix

Conversation

@aqlina
Copy link
Collaborator

@aqlina aqlina commented Mar 17, 2026

Check if the example for ggplot_decorator works correctly, make sure that the teal.modules.general version is at least 0.6.0.
Change Title or Footnote via UI, chekc if the plot appies changes correctly

devtools::load_all()




data <- teal.data::teal_data()
data <- within(data, {
  require(nestcolor)
  ADSL <- teal.data::rADSL
})
join_keys(data) <- default_cdisc_join_keys[names(data)]

# teal.modules.general >= 0.6.0
app <- init(
  data = data,
  modules = modules(
    teal.modules.general::tm_g_scatterplot(
      label = "Scatterplot Choices",
      x = teal.transform::data_extract_spec(
        dataname = "ADSL",
        select = teal.transform::select_spec(
          label = "Select variable:",
          choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2")),
          selected = "AGE",
          multiple = FALSE,
          fixed = FALSE
        )
      ),
      y = data_extract_spec(
        dataname = "ADSL",
        select = teal.transform::select_spec(
          label = "Select variable:",
          choices = teal.transform::variable_choices(data[["ADSL"]], c("AGE", "BMRKR1", "BMRKR2")),
          selected = "BMRKR1",
          multiple = FALSE,
          fixed = FALSE
        )
      ),
      decorators = list(
        plot = ggplot_decorator(
          output_name = "plot", render_ui = c("title", "footnote", "font_size_axis_title")
        )
      )
    )
  )
)


if (interactive()) {
  shinyApp(app$ui, app$server)
}
  

@github-actions
Copy link
Contributor

badge

Code Coverage Summary

Filename                                     Stmts    Miss  Cover    Missing
-----------------------------------------  -------  ------  -------  ---------
R/BlockConditions.R                             14      14  0.00%    23-54
R/create_rel_risk_transformator.R               43      43  0.00%    36-84
R/forest_plot_decorator.R                      164     164  0.00%    97-373
R/ggplot_decorator.R                           244     244  0.00%    106-376
R/merge_levels_transformator.R                 146     146  0.00%    11-240
R/or_filtering_transformator_view_model.R       27      27  0.00%    26-64
R/or_filtering_transformator.R                 254     254  0.00%    69-369
R/patchwork_plot_decorator.R                    46      46  0.00%    18-68
R/r_access_utilities.R                          46      46  0.00%    32-152
R/title_footer_decorator.R                     130     130  0.00%    103-241
R/watermark_decorator.R                         61      61  0.00%    23-87
TOTAL                                         1175    1175  0.00%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: 988e473

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant