insightsengineering/teal.osprey

tm_g_ae_sub: plot defaults when subgroups are de-selected

Closed this issue · 2 comments

related to #87
Run the app below and de-select the subgroups of SEX, RACE and REGION1, the plot will default as below:

library(scda)

ADSL <- synthetic_cdisc_data("latest")$adsl
ADAE <- synthetic_cdisc_data("latest")$adae

app <- init(
  data = cdisc_data(
    cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
    cdisc_dataset("ADAE", ADAE, code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae"),
    check = TRUE
  ),
  modules = root_modules(
    tm_g_ae_sub(
      label = "AE by Subgroup",
      dataname = "ADAE",
      arm_var = choices_selected(
        selected = "ACTARMCD",
        choices = c("ACTARM", "ACTARMCD")
      ),
      group_var = choices_selected(
        selected = c("SEX", "REGION1", "RACE"),
        choices = c("SEX", "REGION1", "RACE")
      ),
      plot_height = c(600, 200, 2000)
    )
  )
)
shinyApp(app$ui, app$server)

Current state:
image

Compared to october release the desired output is as follows:
Screenshot from 2022-01-21 13-38-22

Possible solutions:

  1. Show only Overall when subgroups and their labels are deselected.
  2. Allow the de-selection of all Group variables which will return a plot with Overall only.

@kumamiao Is that really a bug?

Yes, when all Group variables are de-selected, it should only display an Overall plot.