-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Feature Request]: Implement the mechanism to flag filter-states with some id #137
Comments
Acceptance Criteria:
|
Added blocked label because we need to decide how to set the information, through:
|
@lcd2yyz @donyunardi @asbates @chlebowa Please imagine two modules groups
teal::init(
modules(
# modules,
filters = filter_settings(
filter_var(...),
filter_var(...)
)
),
modules(
#modules,
filter_settings(
filter_var(...),
filter_var(...)
)
)
)
filter_settings(
filter_var(..., id = "filter1"),
filter_var(..., id = "filter2"),
filter_var(..., id = "filter3"),
filter_var(..., id = "filter4"),
)
teal::init(
modules = list(
modules("modules1", ..., filters = c("filter1", "filter2", "filter3"),
modules("modules2", ..., filters = c("filter1", "filter2", "filter4")
)
) or filter_settings(
filter_var(..., external_id = c("modules1", "modules2")),
filter_var(..., external_id = c("modules1", "modules2")),
filter_var(..., external_id = "modules1")),
filter_var(..., external_id = "modules2"))
)
teal::init(
modules = list(
modules(..., "modules1"),
modules(..., "modules2")
)
) Advantage of the 1st is that it won't introduce any extra code in
Any thoughts? Thanks |
I think a combination of 1. and 2. would be nice. In 1. I like how a In 2. I like how it gives more options for users. I think my ideal merger of the two would be module_1_filters <- filter_settings(
filter_var(..., id = "filter1"),
filter_expression(..., id = "expr1")
)
module_2_filters <- filter_settings(
filter_var(..., id = "filter1"),
filter_var(..., id = "filter2")
)
teal::init(
modules(
# modules,
module_1_filters
),
modules(
#modules,
filters = module_2_filters
)
)
I particularly like having an |
Option 1 is good but this means the With option 2, we can keep them separate and we only need to surface the Here's an example how this could possibly look like my_filters <- filter_settings(
# settings for module 1 and 2
filter_var(..., module_id = c("module1", "module2")),
# settings for module 1
filter_var(..., module_id = "module1")),
# settings for module 2
filter_var(..., module_id = "module2")),
# settings for all modules (module 1, 2, and 3)
filter_var(...)
)
app <- teal::init(
data = cdisc_data(),
modules = modules(
tm_t_summary(..., id = "module1"),
tm_g_lineplot(..., id = "module2"),
tm_g_km(..., id = "module3")
),
filter = my_filters
) |
@donyunardi I'm not sure the module packages would need a dependency on |
For option 1, won't the app <- teal::init(
data = cdisc_data(),
modules = modules(
tm_t_summary(..., filter = filter_settings()),
tm_g_lineplot(..., filter = filter_settings()),
tm_g_km(..., filter = filter_settings())
),
filter = some_filter
) If so, then won't |
Ooooh. Wow, was I way off :). |
Definitely Option 2 for me. But before deciding on option 2.1 (using module id) vs 2.2 (using filter id), perhaps we need to think more in-depth about not only the default settings but also usage during app run. I do like Dony's example code, it's very clear and clean way of assigning default filters to apply to specified modules. In fact, it can easily be applied to a module set (eg. all AE modules), when multiple modules are nested under a module set tab. On the other hand, I'm wondering if filter ID may be a better approach if we want to allow app users to activate/apply filter from a filter queue, or to allow changes made in one interactive filter to be automatically applied to other modules with the same interactive filter? Would it be easier to keep track of the changes in each individual filter state by associating it with an ID? |
2.1 has better encapsulation as @donyunardi @asbates
|
Sorry I just realized I made a really stupid mistake in my reply previously 🙈 - In referring options, I completely flipped the order you've listed the options. I meant to say 2.1 = filter ID, option 2.2 = module ID ( |
Closes #135 and #137 1. `FilterStates$srv_active` uses `renderUI` instead of `insertUI`. 2. `teal_slice` has now obligatory `id` field. 3. `teal_slice` object is now a `reactiveValues` which is passed and stored directly to `FilterState`. This `teal_slice` object can be returned using `FilterState$get_state`. This gives possibility that one `teal_slice` object can be present in the same time in multiple `FilterState` object. This simplifies little constructor of `FilterState` as we don't have to have check again assertions on dataname, varname etc. 4. removed `disabled` functionality as it conflicts with module specific feature. Discussed with @lcd2yyz and we decided to develop some alternatives to quickly activate/deactivate filters. See (5) 5. added `set_available_teal_slice` (public) and `ui/srv_available_filters` to link `srv/ui_active` with some reactive list of "available" slices. This gives a possibility to activate/deactivate particular state. This reactive list of states is set in teal which gathers all modules filters and creates a one unique list of available filters. Co-authored-by: Aleksander Chlebowski <aleksander.chlebowski@contractors.roche.com>
Feature description
Purpose:
We need a mechanism which allow to group filter-state(s) to obtain:
get_data(<module id>)
,get_code(<module id>)
.We need a mechanism within
FilterStates
which controls which filter-state belong to which module. Name "module" in the filter-panel shouldn't be used, we need a name of this attribute to be more general (flag, target, you name it).What I know for sure is that this attribute should be a reactive value, because in the app user will be able to enable/disable this filter in any module.
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: