-
-
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
The mapping in teal_slice
is lost
#966
Comments
Thanks for catching this and I was able to reproduce this. |
Everything works if one specifies working example app with `module_specific = TRUE`app <- teal::init(
data = teal.data::teal_data(iris = iris, mtcars = mtcars),
modules = modules(
example_module("iris", datanames = "iris"),
example_module("mtcars", datanames = "mtcars"),
example_module("all", datanames = "all"),
example_module("none", datanames = NULL)
),
filter = teal_slices(
# filters created with id
teal_slice(dataname = "mtcars", varname = "mpg", id = "f-1"),
teal_slice(dataname = "mtcars", varname = "cyl", id = "f-2"),
teal_slice(dataname = "mtcars", varname = "disp", id = "f-3"),
teal_slice(dataname = "mtcars", varname = "hp", id = "f-4"),
teal_slice(dataname = "mtcars", varname = "drat", id = "f-5"),
teal_slice(dataname = "mtcars", varname = "wt", id = "f-6"),
teal_slice(dataname = "iris", varname = "Species", id = "f-7"),
# filters mapped to modules
module_specific = TRUE,
mapping = list(
"iris" = "f-7",
"mtcars" = c("f-1", "f-2"),
"all" = c("f-2", "f-3", "f-4", "f-5", "f-6", "f-7"),
global_filters = "f-1"
)
)
)
shinyApp(app$ui, app$server)
|
Ah that's right! Forgot about the
Sounds good to me! |
While we're on this topic. Do you think having module-specific filters should be independent from the mapping? I mean that the |
Okay, I see that we always want to maintain the filter state of one dataset common across all the modules. So ignore my previous comment. |
I disagree. I find computations in default values convoluted and needlessly confusing. My preferred version would be leave |
@insightsengineering/nest-core-dev Upon closely reading of the documentation I notice that There is no error in processing global/specific filters. What is missing is a has only global filters with
|
Perhaps we should make the documentation clearer still. I suggest reversing the order of possible values of |
oh I completely overlooked documentation the details of the mapping. so proposed changes in https://github.com/insightsengineering/teal/pull/968/files are no longer required ? |
I don't believe so. |
I have added another PR for document change #970. |
Given the example @chlebowa has shown, does it make sense to set default |
@lcd2yyz |
Fair point @chlebowa |
The thing is that warning will multiply:
This is because of how I say we leave it as is. The documentation is good enough, though requires careful reading. There are also |
Closes insightsengineering#966. Here as per discussion I have added `module_specific` parameter in vignettes example and updated documentation for `module_specific `paramter --------- Signed-off-by: kartikeya kirar <[email protected]> Co-authored-by: Aleksander Chlebowski <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: m7pr <[email protected]>
Only the global_filters are retained when filter-module mapping is provided.
The text was updated successfully, but these errors were encountered: