Skip to content
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

187 new filter panel api #222

Merged
Merged
Show file tree
Hide file tree
Changes from 237 commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
53c4e40
begin new API
Mar 6, 2023
7a660d7
Merge branch 'filter_panel_refactor@main' into 187_new_api@filter_pan…
Mar 7, 2023
cc4c015
update arguments in filter_var
Mar 7, 2023
8873050
add arguments to FilterState class
Mar 7, 2023
2129306
modify old api
Mar 7, 2023
ebbed93
modify FilterStateChoices
Mar 7, 2023
355b5d2
upgrade new API
Mar 7, 2023
af8bae2
modify new API methods and examples
Mar 7, 2023
46be93d
update new api
Mar 7, 2023
9bf7879
simplify FilterState-utils
Mar 7, 2023
2ccabe0
reorder fields in FilterState
Mar 7, 2023
73ae4e0
update FilterState constructors
Mar 7, 2023
6f0345c
expand new api
Mar 7, 2023
e2b3847
expand new api
Mar 8, 2023
304fdc0
fix bug in new api
Mar 8, 2023
0f1d1ce
modify assertions in filter_var
Mar 8, 2023
69badaf
modify get_state and set_state in FilterState
Mar 8, 2023
3688f7f
remove obsolete methods from RangeFilterState
Mar 8, 2023
fdd6a85
adjust examples in ChoicesFilterState
Mar 8, 2023
49938c8
add is.* functions to new api
Mar 8, 2023
477a35d
modify FilterStatesDF
Mar 8, 2023
82b0fb7
modify filter_var
Mar 9, 2023
c24b715
modify RangeFilterState constructor
Mar 9, 2023
0b75c75
modify FilteredData$get_filter_state
Mar 9, 2023
d0b9f65
modify FilteredDataset
Mar 9, 2023
d42dee8
add arguments and fields in FilterStates
Mar 9, 2023
c784983
modifty FilterStates
Mar 9, 2023
49f4f3c
add arguments in FilterStatesDF
Mar 9, 2023
968bf86
modify FilterStatesDF
Mar 9, 2023
1d63c42
add arguments in FilterStates subclasses and utils
Mar 9, 2023
a3ea551
restore dropped argument in FilterStates set_filter_state_impl
Mar 9, 2023
c56d31b
remove setting selected in RangeFilterState constructor
Mar 9, 2023
ee59b9b
fix bug in c.teal_slices
Mar 9, 2023
4ee82b3
remove get_filter_state from DefaultFilteredDataset
Mar 9, 2023
73ef6ad
modify sert_filter_state in DefaultFilteredDataset
Mar 9, 2023
36fa8b0
modify set_filter_state in FilteredData
Mar 9, 2023
de9a6e5
update documentation
Mar 9, 2023
143ca5b
improve class checks on teal_slice(s)
Mar 9, 2023
c2a5f4d
update sest_state in FilterState
Mar 9, 2023
2188f15
change filterable argument in api to exclude
Mar 9, 2023
c887b6f
bug fixes
Mar 9, 2023
0ac6373
count_type in FilterStates constructors and wrappers
Mar 9, 2023
005a7a6
minor clean up
Mar 9, 2023
bd19dc2
Merge branch 'filter_panel_refactor@main' into 187_new_api@filter_pan…
Mar 10, 2023
1e60fbd
prune new api
Mar 10, 2023
d0dee0b
remove varlabel from api
Mar 10, 2023
bfd2717
default value in FilterState utils
Mar 10, 2023
9b4a9a6
drop varlabel from FilterState get_state
Mar 10, 2023
642a08c
adjust examplesz
Mar 10, 2023
51e5ea4
minor changes
Mar 10, 2023
36f3b0e
bug fix
Mar 10, 2023
4ab1341
LogicalFilterState choices changed from list to vector
Mar 10, 2023
1492d97
revert inappropriate change
Mar 10, 2023
bee34d5
reastore set_state to RangeFilterState
Mar 10, 2023
40403d9
update set_state to RangeFilterState
Mar 10, 2023
ef72422
some cleanup
Mar 13, 2023
e15a994
modify FilterStatesMatrix
Mar 13, 2023
936508d
fix bug in FilterState constructors
Mar 13, 2023
baf4be5
modify FilterStatesSE
Mar 13, 2023
f200921
fix bug in FilterStates
Mar 13, 2023
cda999f
escape FilterStates set_filter_state_impl for empty teal_slices
Mar 13, 2023
a88827b
enhance new api
Mar 13, 2023
1d7839b
expand new api
Mar 13, 2023
d410795
clean up in FilterStatesMAE
Mar 13, 2023
1d8bd26
reform new api
Mar 13, 2023
7df10d6
modify FilterStatesMAE
Mar 13, 2023
e773126
add extras argument in FilterState constructors
Mar 14, 2023
115e0f6
improve get_state methods in FilterStates*
Mar 14, 2023
eaddb28
expand api
Mar 14, 2023
65de4b7
modify FilteredDatasetMAE
Mar 14, 2023
1f4bdcb
minor corrections
Mar 14, 2023
77fc218
provide general handling of prefixed dataname
Mar 14, 2023
387c488
convert state to teal_slices upon entry in FilteredData
Mar 15, 2023
f5522d8
move method set_keep_inf to super FilterStates
Mar 16, 2023
aaefb21
modify set_state in FilterState
Mar 16, 2023
0970bfa
remove set_state from RangeFilterState and ChoicesFilterState
Mar 16, 2023
75db40d
modify set_state in EmptyFilterState
Mar 16, 2023
a874c3f
modify FilterStates set_filter_state_impl
Mar 16, 2023
290b5b9
modify FilterStates* set_filter_state
Mar 16, 2023
75cd58a
modify FilteredDataset* set_filter_state
Mar 16, 2023
86a40f2
modify FilteredData set_filter_state
Mar 16, 2023
6c66964
expand new api
Mar 16, 2023
1770962
modify teal_slice(s) print methods
Mar 16, 2023
4ef2c23
clean up
Mar 16, 2023
395bc10
extras as equal teal_slice elements
Mar 16, 2023
d5c2f7d
remove varlabel argument from FilterState
Mar 16, 2023
c2528b7
remove dataname_prefixed from private fields and formals
Mar 16, 2023
d8b5ca5
clean up new api
Mar 16, 2023
8a38839
modify removing filter states
Mar 16, 2023
705bbcb
amend documentation
Mar 17, 2023
e383b00
build documentation
Mar 17, 2023
68f7a55
update documentation
Mar 17, 2023
56594a2
apply code review
Mar 17, 2023
a711d36
bug fix
Mar 17, 2023
86878a7
fix docs
Mar 17, 2023
4c8b8b3
amend pkgdown
Mar 17, 2023
b4609e9
some bugfixes
Mar 17, 2023
ddcb62b
some more bug fixes
Mar 20, 2023
4ff5074
yet more bug fixes
Mar 20, 2023
c8020dd
another bug fix
Mar 20, 2023
e8279d0
code comments
Mar 20, 2023
2a9e2db
code comments
Mar 20, 2023
ea9e3d7
proper bug fix
Mar 20, 2023
52c5c9f
apply review comments
Mar 20, 2023
39ac992
add argument checks
Mar 21, 2023
2f9be22
bug fix and clean up of internals
Mar 21, 2023
03178e5
Limited choices@187 new api@filter panel refactor@main (#225)
BLAZEWIM Mar 22, 2023
2035cf2
post-merge bug fix
Mar 22, 2023
bf301ba
modify FilterState constructor and set_state
Mar 22, 2023
ca1c950
bug fix
Mar 22, 2023
0a31d71
Update FilterState.R
BLAZEWIM Mar 22, 2023
fc43e5f
choices cleaned up
Mar 24, 2023
d9f49ce
Merge branch '187_new_api@filter_panel_refactor@main' of https://gith…
Mar 24, 2023
dbc5176
choices parked
Mar 24, 2023
275a6a1
date and datetime
Mar 24, 2023
9ac18cb
empty
Mar 24, 2023
fdbbe8b
rangeFS
Mar 24, 2023
c09e408
Merge branch 'filter_panel_refactor@main' into 187_new_api@filter_pan…
BLAZEWIM Mar 24, 2023
c204ed4
Update FilterState.R
BLAZEWIM Mar 24, 2023
0ecb215
cosmetics
Mar 24, 2023
ae94e29
Merge branch '187_new_api@filter_panel_refactor@main' of https://gith…
Mar 24, 2023
a1ba8a7
remove bs345
Mar 24, 2023
965d47d
self to private
Mar 24, 2023
be8d4d6
set_state call to parent init, bugfixes
Mar 27, 2023
4a51cfc
rewind
Mar 29, 2023
5e40511
bug fix
Mar 29, 2023
1a546e8
amend documentation
Mar 29, 2023
076317b
fixes and cleanups
Mar 30, 2023
eed3450
fix documentation
Mar 30, 2023
261ab76
format bugfix
Mar 31, 2023
64c7331
log trace bug fix
Mar 31, 2023
05d4852
tests for choices
Mar 31, 2023
2c5f48e
fix bug in as.teal_slices
Mar 31, 2023
0ac6ed0
add result check in as.teal_slices
Mar 31, 2023
02a21be
fix bug in [.teal_slices
Mar 31, 2023
5da0dfb
add unit tests for teal_slice and friends
Mar 31, 2023
5672ac0
Merge branch '187_new_api@filter_panel_refactor@main' of github.com:i…
Mar 31, 2023
eb3f0e1
dealing with posixlt
Apr 3, 2023
5ff68c4
date test part 1"
Apr 3, 2023
2e2379b
add checkts to teal_slice functions
Apr 3, 2023
8919513
add unit tests for teal_slice functions
Apr 3, 2023
2254716
fix style and bug
Apr 3, 2023
3d5efc4
modify FilterState enable
Apr 3, 2023
70bb864
datetime tests
Apr 3, 2023
634173d
empty fs tests
Apr 3, 2023
f246819
labels corrected
Apr 3, 2023
dee4e86
move global variable to zzz.R
Apr 4, 2023
0126e04
amend assertions in filter_var
Apr 4, 2023
e676841
amend FilterState enable method
Apr 4, 2023
cb9f387
amend unit tests for FilterState
Apr 4, 2023
3d025fc
logical
Apr 4, 2023
cff98cc
Merge branch '187_new_api@filter_panel_refactor@main' of https://gith…
Apr 4, 2023
165356a
range fs tests
Apr 4, 2023
7484265
fix bug in set_filter_states_impl
Apr 4, 2023
86161e4
Merge branch '187_new_api@filter_panel_refactor@main' of github.com:i…
Apr 4, 2023
cf4ebb0
modify FiterStates state_list_remove
Apr 4, 2023
7a17795
modify FiterStates get_filter_count
Apr 4, 2023
854cd85
clean up
Apr 4, 2023
da0f2f8
fix unit tests for FilterStates
Apr 4, 2023
97a7702
clean up
Apr 4, 2023
64f0022
fix tests for DefaultFilteredDataset
Apr 4, 2023
477187e
modify get_filter_count methods across classes
Apr 4, 2023
5e86617
modify FilteredData get_filter_state
Apr 4, 2023
5f3cb29
amend documentation
Apr 4, 2023
207eb19
fix unit tests for FilteredData
Apr 4, 2023
813844d
remove pipe from code
Apr 4, 2023
8c3f5a9
add convenience funciton for unit test
Apr 4, 2023
02c3979
fix unit tests for filter_panel_api
Apr 4, 2023
bcc3d1a
fix unit tests for LogicalFilterState
Apr 4, 2023
f3a68d0
fix unit tests for FilteredDataset
Apr 4, 2023
c777e60
fix unit tests for MAEFilterStates
Apr 4, 2023
6c8bb7b
fix unit tests for MAEFilteredDataset
Apr 4, 2023
a5ffcfb
se filter states tests
Apr 5, 2023
0242c84
logging warnings in set_state per review
Apr 5, 2023
bc161e7
warning for emopty remove added
Apr 5, 2023
097bfd3
Merge branch '187_new_api@filter_panel_refactor@main' of https://gith…
Apr 5, 2023
f867410
fix unit tests for MatrixFilterStates
Apr 5, 2023
c80162b
modify warning message
Apr 5, 2023
63e80a1
modify tests for FilterStatesSE
Apr 5, 2023
1bd7c2f
fix tests for FilteredData, ctd.
Apr 5, 2023
df8252d
typo
Apr 5, 2023
75c0a94
suppress warning
Apr 5, 2023
981530f
suppress warning
Apr 5, 2023
5634590
suppress warning
Apr 5, 2023
c88fb30
review unit tests - FilteredData
Apr 5, 2023
cb512a3
update tests for FilteredData
Apr 5, 2023
f1a91ff
review tests for calls_combine_by
Apr 5, 2023
0ea38dd
review tests for check_simple_name
Apr 5, 2023
9769b64
review tests for FilterStateChoices
Apr 5, 2023
d2c694a
review tests for count_labels
Apr 6, 2023
b4d845f
review tests for FilterStateDate
Apr 6, 2023
9f502f9
update tests for DateFilterState
Apr 6, 2023
e1be6ab
update tests for DateFilterState again
Apr 6, 2023
5a816c6
update tests for DatetimeFilterState
Apr 6, 2023
d223bbb
bug fix in unit tests
Apr 6, 2023
3ba0d55
add unit tests for teal_slice
Apr 6, 2023
d711a4c
minor adjustments
Apr 6, 2023
b715d48
review unit tests for RangeFilterState
Apr 6, 2023
3df9cd6
review unit tests for EmptyFilterState (tbc)
Apr 6, 2023
1ab3165
review unit tests for LogicalFilterState
Apr 7, 2023
aa66096
modify FilterState set_state
Apr 7, 2023
0e9e152
move format method from FilterState to ChoicesFilterState
Apr 7, 2023
a6b7014
amend tests for ChoicesFilterState
Apr 7, 2023
988a1c3
review tests for FilterState
Apr 7, 2023
db254b7
update argument check in LogicalFilterState
Apr 7, 2023
c4940be
drop redundant tests in FilterState children
Apr 7, 2023
50923c5
review tests for DefaultFilteredDataset
Apr 7, 2023
1a0e6b6
review filters for MAEFilteredDataset
Apr 7, 2023
0f94d96
review tests for FilteredDataset
Apr 7, 2023
f0aa299
clean up
Apr 8, 2023
fe5d2a6
modify format methods for FilterStates*
Apr 8, 2023
1246d48
review tests for FilterStates*
Apr 8, 2023
0644ef0
modify format methods in FilterState*
Apr 8, 2023
06bd766
update unit tests for FilterState* format
Apr 8, 2023
e9646dd
review tests for init_filter_state
Apr 8, 2023
d10bf5b
add test for SEFilterstates
Apr 11, 2023
ec5f8fa
add tests for wrapper functions
Apr 11, 2023
f90ac3c
add unit tests for FilterState utils
Apr 11, 2023
ebe1ae2
review tests for FilteredData
Apr 11, 2023
230e697
add test for adjust_states
Apr 11, 2023
350d371
gather unit test for utils in one file
Apr 11, 2023
734c15c
remove function resolve_state
Apr 11, 2023
bf01634
add format methods for teal_slice and teal_slices
Apr 11, 2023
ad3d06c
add unit test for teal_slice
Apr 11, 2023
c44a801
amend documentation
Apr 11, 2023
468d416
bug fix in DateFilterState
Apr 11, 2023
af95bca
add unit tests to FilterState* set_choices
Apr 11, 2023
092daef
typo fix
Apr 11, 2023
72f4ffc
Merge branch 'filter_panel_refactor@main' into 187_new_api@filter_pan…
BLAZEWIM Apr 12, 2023
2cb6946
remove superfluous unit test
Apr 12, 2023
11a9826
remove superfluous lines
Apr 12, 2023
6dbb054
add format method for LogicalFilterState
Apr 12, 2023
f94f460
add unit tests
Apr 12, 2023
8e7cd6b
styling
Apr 12, 2023
83d2066
calls combine by for future
Apr 12, 2023
05d2148
reorder tests
Apr 13, 2023
546a83b
fix bug in tests
Apr 13, 2023
8b0adba
amend documentation
Apr 13, 2023
7464632
fix bug in LogicalFilterState format
Apr 14, 2023
94cda0f
fix bug in RangeFilterState histogram
Apr 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Generated by roxygen2: do not edit by hand

S3method("[",teal_slices)
S3method(c,teal_slice)
S3method(c,teal_slices)
S3method(format,teal_slice)
S3method(format,teal_slices)
S3method(get_supported_filter_varnames,FilteredDataset)
S3method(get_supported_filter_varnames,MAEFilteredDataset)
S3method(get_supported_filter_varnames,default)
Expand All @@ -20,16 +25,17 @@ S3method(init_filtered_data,TealData)
S3method(init_filtered_data,default)
S3method(init_filtered_dataset,MultiAssayExperiment)
S3method(init_filtered_dataset,data.frame)
S3method(resolve_state,default)
S3method(resolve_state,default_filter)
S3method(resolve_state,list)
S3method(print,teal_slice)
S3method(print,teal_slices)
S3method(variable_types,DFrame)
S3method(variable_types,DataTable)
S3method(variable_types,data.frame)
S3method(variable_types,default)
S3method(variable_types,matrix)
export(FilterPanelAPI)
export(clear_filter_states)
export(filter_settings)
export(filter_var)
export(get_filter_expr)
export(get_filter_state)
export(init_filter_states)
Expand Down
32 changes: 20 additions & 12 deletions R/FilterPanelAPI.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#' isolate(fpa$get_filter_state())
#'
#' # set a filter state
#' isolate(
#' set_filter_state(
#' fpa,
#' list(iris = list(Species = list(selected = "setosa", keep_na = TRUE)))
#' set_filter_state(
#' fpa,
#' filter_settings(
#' filter_var(dataname = "iris", varname = "Species", selected = "setosa", keep_na = TRUE)
#' )
#' )
#'
Expand All @@ -40,10 +40,12 @@
FilterPanelAPI <- R6::R6Class( # nolint
"FilterPanelAPI",
## __Public Methods ====

public = list(
#' @description
#' Initialize a `FilterPanelAPI` object
#' @param datasets (`FilteredData`) object.
#'
initialize = function(datasets) {
checkmate::assert_class(datasets, "FilteredData")
private$filtered_data <- datasets
Expand All @@ -56,16 +58,17 @@ FilterPanelAPI <- R6::R6Class( # nolint
#' The output list is a compatible input to `set_filter_state`.
#'
#' @return `list` with named elements corresponding to `FilteredDataset` objects with active filters.
#'
get_filter_state = function() {
private$filtered_data$get_filter_state()
},

#' @description
#' Sets active filter states.
#' @param filter (`named list`)\cr
#' nested list of filter selections applied to datasets.
#' @param filter (`teal_slices`)
#'
#' @return `NULL` invisibly
#'
#' @return `NULL`
set_filter_state = function(filter) {
if (private$filtered_data$get_filter_panel_active()) {
private$filtered_data$set_filter_state(filter)
Expand All @@ -77,10 +80,13 @@ FilterPanelAPI <- R6::R6Class( # nolint

#' @description
#' Remove one or more `FilterState` of a `FilteredDataset` in the `FilteredData` object.
#' @param filter (`named list`)\cr
#' nested list of filter selections applied to datasets.
#'
#' @return `NULL`
#' @param filter (`teal_slices`)\cr
#' specifying `FilterState` objects to remove;
#' `teal_slice`s may contain only `dataname` and `varname`, other elements are ignored
#'
#' @return `NULL` invisibly
#'
remove_filter_state = function(filter) {
if (private$filtered_data$get_filter_panel_active()) {
private$filtered_data$remove_filter_state(filter)
Expand All @@ -96,7 +102,7 @@ FilterPanelAPI <- R6::R6Class( # nolint
#' datanames to remove their `FilterStates`;
#' omit to remove all `FilterStates` in the `FilteredData` object
#'
#' @return `NULL`
#' @return `NULL` invisibly
#'
clear_filter_states = function(datanames) {
if (private$filtered_data$get_filter_panel_active()) {
Expand All @@ -107,14 +113,16 @@ FilterPanelAPI <- R6::R6Class( # nolint
}
invisible(NULL)
},

#' @description
#' Toggle the state of the global Filter Panel button by running `javascript` code
#' to click the toggle button with the `filter_panel_active` id suffix.
#' The button id is prefixed with the Filter Panel shiny namespace.
#' This button is observed in `srv_filter_panel` method that executes
#' `filter_panel_enable()` or `filter_panel_disable()` method depending on the toggle state.
#'
#' @return `NULL`
#' @return `NULL` invisibly
#'
filter_panel_toggle = function() {
shinyjs::runjs(
sprintf(
Expand Down
70 changes: 0 additions & 70 deletions R/FilterState-abstract.R

This file was deleted.

Loading