insightsengineering / teal

Exploratory Web Apps for Analyzing Clinical Trial Data
https://insightsengineering.github.io/teal/
Other
171 stars 34 forks source link

[Bug]: Example in `init()` uses module-specific filters, but they are not shown #1132

Closed averissimo closed 6 months ago

averissimo commented 6 months ago

What happened?

The current example of init() function defines an initial filter state with module-specific filters, but they are not shown in the application

Proposed solution:

Add module_specific = TRUE to the teal_slices call in the example

filter <- teal_slices(
  teal_slice(dataname = "iris", varname = "Species", id = "species"),
  teal_slice(dataname = "iris", varname = "Sepal.Length", id = "sepal_length"),
  teal_slice(
    dataname = "iris", id = "long_petals", title = "Long petals", expr = "Petal.Length > 5"
  ),
  teal_slice(dataname = "mtcars", varname = "mpg", id = "mtcars_mpg"),
  mapping = list(
    module1 = c("species", "sepal_length"),
    module2 = c("mtcars_mpg"),
    global_filters = "long_petals"
  )
)

app <- init(
  data = teal_data(iris = iris, mtcars = mtcars),
  modules = list(
    module("module1"),
    module("module2")
  ),
  filter = filter
)

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

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

Contribution Guidelines

Security Policy