diff --git a/DESCRIPTION b/DESCRIPTION index 58e37917e..355e1784f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -80,4 +80,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.3 +Config/roxygen2/version: 8.0.0 diff --git a/man/ChoicesFilterState.Rd b/man/ChoicesFilterState.Rd index c66b86cee..ce94785a6 100644 --- a/man/ChoicesFilterState.Rd +++ b/man/ChoicesFilterState.Rd @@ -116,113 +116,114 @@ if (interactive()) { } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterState]{teal.slice::FilterState}} -> \code{ChoicesFilterState} +\code{\link[teal.slice:FilterState]{FilterState}} -> \code{ChoicesFilterState} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-ChoicesFilterState-new}{\code{ChoicesFilterState$new()}} -\item \href{#method-ChoicesFilterState-get_call}{\code{ChoicesFilterState$get_call()}} -\item \href{#method-ChoicesFilterState-clone}{\code{ChoicesFilterState$clone()}} -} + \itemize{ + \item \href{#method-ChoicesFilterState-initialize}{\code{ChoicesFilterState$new()}} + \item \href{#method-ChoicesFilterState-get_call}{\code{ChoicesFilterState$get_call()}} + \item \href{#method-ChoicesFilterState-clone}{\code{ChoicesFilterState$clone()}} + } } -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-ChoicesFilterState-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{ChoicesFilterState$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ChoicesFilterState-initialize}{}}} +\subsection{\code{ChoicesFilterState$new()}}{ + Initialize a \code{FilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{ChoicesFilterState$new( x, x_reactive = reactive(NULL), slice, extract_type = character(0) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{character}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{character}) variable to be filtered.} - -\item{\code{x_reactive}}{(\code{reactive}) + \item{\code{x_reactive}}{(\code{reactive}) returning vector of the same type as \code{x}. Is used to update counts following the change in values of the filtered dataset. If it is set to \code{reactive(NULL)} then counts based on filtered dataset are not shown.} - -\item{\code{slice}}{(\code{teal_slice}) + \item{\code{slice}}{(\code{teal_slice}) specification of this filter state. \code{teal_slice} is stored in the object and \code{set_state} directly manipulates values within \code{teal_slice}. \code{get_state} returns \code{teal_slice} object which can be reused in other places. Note that \code{teal_slice} is a \code{reactiveValues}, which means it has reference semantics, i.e. changes made to an object are automatically reflected in all places that refer to the same \code{teal_slice}.} - -\item{\code{extract_type}}{(\code{character}) + \item{\code{extract_type}}{(\code{character}) specifying whether condition calls should be prefixed by \code{dataname}. Possible values: \itemize{ \item \code{character(0)} (default) \code{varname} in the condition call will not be prefixed \item \code{"list"} \code{varname} in the condition call will be returned as \verb{$} \item \code{"matrix"} \code{varname} in the condition call will be returned as \verb{[, ]} }} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{ChoicesFilterState}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{ChoicesFilterState}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-ChoicesFilterState-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Returns reproducible condition call for current selection. +\subsection{\code{ChoicesFilterState$get_call()}}{ + Returns reproducible condition call for current selection. For this class returned call looks like \verb{ \%in\% c()} with optional \verb{is.na()}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{ChoicesFilterState$get_call(dataname)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{ChoicesFilterState$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{(\code{character(1)}) name of data set; defaults to \code{private$get_dataname()}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{call} or \code{NULL} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{(\code{character(1)}) name of data set; defaults to \code{private$get_dataname()}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{call} or \code{NULL} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-ChoicesFilterState-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{ChoicesFilterState$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{ChoicesFilterState$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{ChoicesFilterState$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/DFFilterStates.Rd b/man/DFFilterStates.Rd index 9db2bb8e8..f8a567e95 100644 --- a/man/DFFilterStates.Rd +++ b/man/DFFilterStates.Rd @@ -156,92 +156,90 @@ if (interactive()) { } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterStates]{teal.slice::FilterStates}} -> \code{DFFilterStates} +\code{\link[teal.slice:FilterStates]{FilterStates}} -> \code{DFFilterStates} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-DFFilterStates-new}{\code{DFFilterStates$new()}} -\item \href{#method-DFFilterStates-clone}{\code{DFFilterStates$clone()}} + \itemize{ + \item \href{#method-DFFilterStates-initialize}{\code{DFFilterStates$new()}} + \item \href{#method-DFFilterStates-clone}{\code{DFFilterStates$clone()}} + } } -} -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-DFFilterStates-new}{}}} -\subsection{Method \code{new()}}{ -Initializes \code{DFFilterStates} object by setting \code{dataname} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-DFFilterStates-initialize}{}}} +\subsection{\code{DFFilterStates$new()}}{ + Initializes \code{DFFilterStates} object by setting \code{dataname} and initializing \code{state_list} (\code{shiny::reactiveVal}). This class contains a single \code{state_list} with no specified name, which means that when calling the subset function associated with this class (\code{dplyr::filter}), a list of conditions is passed to unnamed arguments (\code{...}). -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DFFilterStates$new( + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DFFilterStates$new( data, data_reactive = function(sid = "") NULL, dataname, datalabel = NULL, keys = character(0) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{data}}{(\code{data.frame}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{data}}{(\code{data.frame}) the \code{R} object which \code{dplyr::filter} function will be applied on.} - -\item{\code{data_reactive}}{(\verb{function(sid)}) + \item{\code{data_reactive}}{(\verb{function(sid)}) should return a \code{data.frame} object or \code{NULL}. This object is needed for the \code{FilterState} counts being updated on a change in filters. If function returns \code{NULL} then filtered counts are not shown. Function has to have \code{sid} argument being a character.} - -\item{\code{dataname}}{(\code{character}) + \item{\code{dataname}}{(\code{character}) name of the data used in the \emph{subset expression}. Passed to the function argument attached to this \code{FilterStates}.} - -\item{\code{datalabel}}{(\code{character(1)}) optional + \item{\code{datalabel}}{(\code{character(1)}) optional text label.} - -\item{\code{keys}}{(\code{character}) + \item{\code{keys}}{(\code{character}) key column names.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DFFilterStates-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DFFilterStates$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{DFFilterStates$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DFFilterStates$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/DataframeFilteredDataset.Rd b/man/DataframeFilteredDataset.Rd index a676cf3bd..873d4305b 100644 --- a/man/DataframeFilteredDataset.Rd +++ b/man/DataframeFilteredDataset.Rd @@ -5,8 +5,6 @@ \alias{DataframeFilteredDataset} \title{The \code{DataframeFilteredDataset} \code{R6} class} \description{ -The \code{DataframeFilteredDataset} \code{R6} class - The \code{DataframeFilteredDataset} \code{R6} class } \examples{ @@ -37,45 +35,44 @@ isolate(dataset$get_filter_state()) } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilteredDataset]{teal.slice::FilteredDataset}} -> \code{DataframeFilteredDataset} +\code{\link[teal.slice:FilteredDataset]{FilteredDataset}} -> \code{DataframeFilteredDataset} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-DataframeFilteredDataset-new}{\code{DataframeFilteredDataset$new()}} -\item \href{#method-DataframeFilteredDataset-get_call}{\code{DataframeFilteredDataset$get_call()}} -\item \href{#method-DataframeFilteredDataset-set_filter_state}{\code{DataframeFilteredDataset$set_filter_state()}} -\item \href{#method-DataframeFilteredDataset-remove_filter_state}{\code{DataframeFilteredDataset$remove_filter_state()}} -\item \href{#method-DataframeFilteredDataset-ui_add}{\code{DataframeFilteredDataset$ui_add()}} -\item \href{#method-DataframeFilteredDataset-get_filter_overview}{\code{DataframeFilteredDataset$get_filter_overview()}} -\item \href{#method-DataframeFilteredDataset-clone}{\code{DataframeFilteredDataset$clone()}} -} -} -\if{html}{\out{ -
Inherited methods + \itemize{ + \item \href{#method-DataframeFilteredDataset-initialize}{\code{DataframeFilteredDataset$new()}} + \item \href{#method-DataframeFilteredDataset-get_call}{\code{DataframeFilteredDataset$get_call()}} + \item \href{#method-DataframeFilteredDataset-set_filter_state}{\code{DataframeFilteredDataset$set_filter_state()}} + \item \href{#method-DataframeFilteredDataset-remove_filter_state}{\code{DataframeFilteredDataset$remove_filter_state()}} + \item \href{#method-DataframeFilteredDataset-ui_add}{\code{DataframeFilteredDataset$ui_add()}} + \item \href{#method-DataframeFilteredDataset-get_filter_overview}{\code{DataframeFilteredDataset$get_filter_overview()}} + \item \href{#method-DataframeFilteredDataset-clone}{\code{DataframeFilteredDataset$clone()}} + } +} +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-new}{}}} -\subsection{Method \code{new()}}{ -Initializes this \code{DataframeFilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DataframeFilteredDataset$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-initialize}{}}} +\subsection{\code{DataframeFilteredDataset$new()}}{ + Initializes this \code{DataframeFilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DataframeFilteredDataset$new( dataset, dataname, keys = character(0), @@ -83,162 +80,169 @@ Initializes this \code{DataframeFilteredDataset} object. parent = NULL, join_keys = character(0), label = character(0) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataset}}{(\code{data.frame}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataset}}{(\code{data.frame}) single \code{data.frame} for which filters are rendered.} - -\item{\code{dataname}}{(\code{character(1)}) + \item{\code{dataname}}{(\code{character(1)}) syntactically valid name given to the dataset.} - -\item{\code{keys}}{(\code{character}) optional + \item{\code{keys}}{(\code{character}) optional vector of primary key column names.} - -\item{\code{parent_name}}{(\code{character(1)}) + \item{\code{parent_name}}{(\code{character(1)}) name of the parent dataset.} - -\item{\code{parent}}{(\code{reactive}) + \item{\code{parent}}{(\code{reactive}) that returns a filtered \code{data.frame} from other \code{FilteredDataset} named \code{parent_name}. Passing \code{parent} results in a \code{reactive} link that causes re-filtering of this \code{dataset} based on the changes in \code{parent}.} - -\item{\code{join_keys}}{(\code{character}) + \item{\code{join_keys}}{(\code{character}) vector of names of columns in this dataset to join with \code{parent} dataset. If column names in the parent do not match these, they should be given as the names of this vector.} - -\item{\code{label}}{(\code{character(1)}) + \item{\code{label}}{(\code{character(1)}) label to describe the dataset.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{DataframeFilteredDataset}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{DataframeFilteredDataset}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Gets the subset expression. +\subsection{\code{DataframeFilteredDataset$get_call()}}{ + Gets the subset expression. This function returns subset expressions equivalent to selected items within each of \code{filter_states}. Configuration of the expressions is constant and depends on \code{filter_states} type and order which are set during initialization. This class contains single \code{FilterStates} which contains single \code{state_list} and all \code{FilterState} objects apply to one argument (\code{...}) in a \code{dplyr::filter} call. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DataframeFilteredDataset$get_call(sid = "")}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{sid}}{(\code{character}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DataframeFilteredDataset$get_call(sid = "")} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{sid}}{(\code{character}) when specified, the method returns code containing conditions calls of \code{FilterState} objects with \code{sid} different to that of this \code{sid} argument.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Either a \code{list} of length 1 containing a filter \code{call}, or \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Either a \code{list} of length 1 containing a filter \code{call}, or \code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -Set filter state. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DataframeFilteredDataset$set_filter_state(state)}\if{html}{\out{
}} +\subsection{\code{DataframeFilteredDataset$set_filter_state()}}{ + Set filter state. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DataframeFilteredDataset$set_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-remove_filter_state}{}}} -\subsection{Method \code{remove_filter_state()}}{ -Remove one or more \code{FilterState} form a \code{FilteredDataset}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DataframeFilteredDataset$remove_filter_state(state)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices}) +\subsection{\code{DataframeFilteredDataset$remove_filter_state()}}{ + Remove one or more \code{FilterState} form a \code{FilteredDataset}. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DataframeFilteredDataset$remove_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices}) specifying \code{FilterState} objects to remove; \code{teal_slice}s may contain only \code{dataname} and \code{varname}, other elements are ignored} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-ui_add}{}}} -\subsection{Method \code{ui_add()}}{ -UI module to add filter variable for this dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DataframeFilteredDataset$ui_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{DataframeFilteredDataset$ui_add()}}{ + UI module to add filter variable for this dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DataframeFilteredDataset$ui_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-get_filter_overview}{}}} -\subsection{Method \code{get_filter_overview()}}{ -Creates row for filter overview in the form of \cr +\subsection{\code{DataframeFilteredDataset$get_filter_overview()}}{ + Creates row for filter overview in the form of \cr \code{dataname -- observations (remaining/total)} - data.frame -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DataframeFilteredDataset$get_filter_overview()}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DataframeFilteredDataset$get_filter_overview()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{data.frame}. + } } -\subsection{Returns}{ -A \code{data.frame}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DataframeFilteredDataset-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DataframeFilteredDataset$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{DataframeFilteredDataset$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DataframeFilteredDataset$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/DateFilterState.Rd b/man/DateFilterState.Rd index 836a1e615..a7c42e747 100644 --- a/man/DateFilterState.Rd +++ b/man/DateFilterState.Rd @@ -110,113 +110,114 @@ if (interactive()) { } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterState]{teal.slice::FilterState}} -> \code{DateFilterState} +\code{\link[teal.slice:FilterState]{FilterState}} -> \code{DateFilterState} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-DateFilterState-new}{\code{DateFilterState$new()}} -\item \href{#method-DateFilterState-get_call}{\code{DateFilterState$get_call()}} -\item \href{#method-DateFilterState-clone}{\code{DateFilterState$clone()}} -} + \itemize{ + \item \href{#method-DateFilterState-initialize}{\code{DateFilterState$new()}} + \item \href{#method-DateFilterState-get_call}{\code{DateFilterState$get_call()}} + \item \href{#method-DateFilterState-clone}{\code{DateFilterState$clone()}} + } } -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-DateFilterState-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DateFilterState$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-DateFilterState-initialize}{}}} +\subsection{\code{DateFilterState$new()}}{ + Initialize a \code{FilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DateFilterState$new( x, x_reactive = reactive(NULL), slice, extract_type = character(0) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{Date}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{Date}) variable to be filtered.} - -\item{\code{x_reactive}}{(\code{reactive}) + \item{\code{x_reactive}}{(\code{reactive}) returning vector of the same type as \code{x}. Is used to update counts following the change in values of the filtered dataset. If it is set to \code{reactive(NULL)} then counts based on filtered dataset are not shown.} - -\item{\code{slice}}{(\code{teal_slice}) + \item{\code{slice}}{(\code{teal_slice}) specification of this filter state. \code{teal_slice} is stored in the object and \code{set_state} directly manipulates values within \code{teal_slice}. \code{get_state} returns \code{teal_slice} object which can be reused in other places. Note that \code{teal_slice} is a \code{reactiveValues}, which means it has reference semantics, i.e. changes made to an object are automatically reflected in all places that refer to the same \code{teal_slice}.} - -\item{\code{extract_type}}{(\code{character}) + \item{\code{extract_type}}{(\code{character}) specifying whether condition calls should be prefixed by \code{dataname}. Possible values: \itemize{ \item \code{character(0)} (default) \code{varname} in the condition call will not be prefixed \item \code{"list"} \code{varname} in the condition call will be returned as \verb{$} \item \code{"matrix"} \code{varname} in the condition call will be returned as \verb{[, ]} }} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{DateFilterState}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{DateFilterState}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DateFilterState-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Returns reproducible condition call for current selection. +\subsection{\code{DateFilterState$get_call()}}{ + Returns reproducible condition call for current selection. For this class returned call looks like \verb{ >= & <= } with optional \verb{is.na()}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DateFilterState$get_call(dataname)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DateFilterState$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{(\code{character(1)}) containing possibly prefixed name of data set} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{call} or \code{NULL} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{(\code{character(1)}) containing possibly prefixed name of data set} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{call} or \code{NULL} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DateFilterState-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DateFilterState$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{DateFilterState$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DateFilterState$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/DatetimeFilterState.Rd b/man/DatetimeFilterState.Rd index 6410f9e34..04f843baa 100644 --- a/man/DatetimeFilterState.Rd +++ b/man/DatetimeFilterState.Rd @@ -116,117 +116,118 @@ if (interactive()) { } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterState]{teal.slice::FilterState}} -> \code{DatetimeFilterState} +\code{\link[teal.slice:FilterState]{FilterState}} -> \code{DatetimeFilterState} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-DatetimeFilterState-new}{\code{DatetimeFilterState$new()}} -\item \href{#method-DatetimeFilterState-get_call}{\code{DatetimeFilterState$get_call()}} -\item \href{#method-DatetimeFilterState-clone}{\code{DatetimeFilterState$clone()}} -} + \itemize{ + \item \href{#method-DatetimeFilterState-initialize}{\code{DatetimeFilterState$new()}} + \item \href{#method-DatetimeFilterState-get_call}{\code{DatetimeFilterState$get_call()}} + \item \href{#method-DatetimeFilterState-clone}{\code{DatetimeFilterState$clone()}} + } } -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-DatetimeFilterState-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterState} object. This class +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-DatetimeFilterState-initialize}{}}} +\subsection{\code{DatetimeFilterState$new()}}{ + Initialize a \code{FilterState} object. This class has an extra field, \code{private$timezone}, which is set to \code{Sys.timezone()} by default. However, in case when using this module in \code{teal} app, one needs timezone of the app user. App user timezone is taken from \code{session$userData$timezone} and is set only if object is initialized in \code{shiny}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DatetimeFilterState$new( + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DatetimeFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{POSIXct} or \code{POSIXlt}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{POSIXct} or \code{POSIXlt}) variable to be filtered.} - -\item{\code{x_reactive}}{(\code{reactive}) + \item{\code{x_reactive}}{(\code{reactive}) returning vector of the same type as \code{x}. Is used to update counts following the change in values of the filtered dataset. If it is set to \code{reactive(NULL)} then counts based on filtered dataset are not shown.} - -\item{\code{extract_type}}{(\code{character}) + \item{\code{extract_type}}{(\code{character}) specifying whether condition calls should be prefixed by \code{dataname}. Possible values: \itemize{ \item \code{character(0)} (default) \code{varname} in the condition call will not be prefixed \item \code{"list"} \code{varname} in the condition call will be returned as \verb{$} \item \code{"matrix"} \code{varname} in the condition call will be returned as \verb{[, ]} }} - -\item{\code{slice}}{(\code{teal_slice}) + \item{\code{slice}}{(\code{teal_slice}) specification of this filter state. \code{teal_slice} is stored in the object and \code{set_state} directly manipulates values within \code{teal_slice}. \code{get_state} returns \code{teal_slice} object which can be reused in other places. Note that \code{teal_slice} is a \code{reactiveValues}, which means it has reference semantics, i.e. changes made to an object are automatically reflected in all places that refer to the same \code{teal_slice}.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{DatetimeFilterState}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{DatetimeFilterState}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DatetimeFilterState-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Returns reproducible condition call for current selection. +\subsection{\code{DatetimeFilterState$get_call()}}{ + Returns reproducible condition call for current selection. For this class returned call looks like \verb{ >= as.POSIXct() & <= )} with optional \verb{is.na()}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DatetimeFilterState$get_call(dataname)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DatetimeFilterState$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{call} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{call} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DatetimeFilterState-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DatetimeFilterState$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{DatetimeFilterState$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DatetimeFilterState$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/DefaultFilteredDataset.Rd b/man/DefaultFilteredDataset.Rd index ef56db702..e3ef4186a 100644 --- a/man/DefaultFilteredDataset.Rd +++ b/man/DefaultFilteredDataset.Rd @@ -20,235 +20,247 @@ isolate(ds$get_call()) } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilteredDataset]{teal.slice::FilteredDataset}} -> \code{DefaultFilteredDataset} +\code{\link[teal.slice:FilteredDataset]{FilteredDataset}} -> \code{DefaultFilteredDataset} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-DefaultFilteredDataset-new}{\code{DefaultFilteredDataset$new()}} -\item \href{#method-DefaultFilteredDataset-format}{\code{DefaultFilteredDataset$format()}} -\item \href{#method-DefaultFilteredDataset-get_call}{\code{DefaultFilteredDataset$get_call()}} -\item \href{#method-DefaultFilteredDataset-get_filter_state}{\code{DefaultFilteredDataset$get_filter_state()}} -\item \href{#method-DefaultFilteredDataset-set_filter_state}{\code{DefaultFilteredDataset$set_filter_state()}} -\item \href{#method-DefaultFilteredDataset-clear_filter_states}{\code{DefaultFilteredDataset$clear_filter_states()}} -\item \href{#method-DefaultFilteredDataset-get_filter_overview}{\code{DefaultFilteredDataset$get_filter_overview()}} -\item \href{#method-DefaultFilteredDataset-ui_active}{\code{DefaultFilteredDataset$ui_active()}} -\item \href{#method-DefaultFilteredDataset-ui_add}{\code{DefaultFilteredDataset$ui_add()}} -\item \href{#method-DefaultFilteredDataset-clone}{\code{DefaultFilteredDataset$clone()}} -} -} -\if{html}{\out{ -
Inherited methods + \itemize{ + \item \href{#method-DefaultFilteredDataset-initialize}{\code{DefaultFilteredDataset$new()}} + \item \href{#method-DefaultFilteredDataset-format}{\code{DefaultFilteredDataset$format()}} + \item \href{#method-DefaultFilteredDataset-get_call}{\code{DefaultFilteredDataset$get_call()}} + \item \href{#method-DefaultFilteredDataset-get_filter_state}{\code{DefaultFilteredDataset$get_filter_state()}} + \item \href{#method-DefaultFilteredDataset-set_filter_state}{\code{DefaultFilteredDataset$set_filter_state()}} + \item \href{#method-DefaultFilteredDataset-clear_filter_states}{\code{DefaultFilteredDataset$clear_filter_states()}} + \item \href{#method-DefaultFilteredDataset-get_filter_overview}{\code{DefaultFilteredDataset$get_filter_overview()}} + \item \href{#method-DefaultFilteredDataset-ui_active}{\code{DefaultFilteredDataset$ui_active()}} + \item \href{#method-DefaultFilteredDataset-ui_add}{\code{DefaultFilteredDataset$ui_add()}} + \item \href{#method-DefaultFilteredDataset-clone}{\code{DefaultFilteredDataset$clone()}} + } +} +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-new}{}}} -\subsection{Method \code{new()}}{ -Initializes this \code{DefaultFilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$new(dataset, dataname, label = character(0))}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataset}}{any type of object; will not be filtered.} - -\item{\code{dataname}}{(\code{character(1)}) +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-initialize}{}}} +\subsection{\code{DefaultFilteredDataset$new()}}{ + Initializes this \code{DefaultFilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$new(dataset, dataname, label = character(0))} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataset}}{any type of object; will not be filtered.} + \item{\code{dataname}}{(\code{character(1)}) syntactically valid name given to the dataset.} - -\item{\code{label}}{(\code{character(1)}) + \item{\code{label}}{(\code{character(1)}) label to describe the dataset.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{DefaultFilteredDataset}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{DefaultFilteredDataset}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-format}{}}} -\subsection{Method \code{format()}}{ -Returns a formatted string representing this \code{DefaultFilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$format(show_all, trim_lines = FALSE)}\if{html}{\out{
}} +\subsection{\code{DefaultFilteredDataset$format()}}{ + Returns a formatted string representing this \code{DefaultFilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$format(show_all, trim_lines = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{show_all}}{(\code{logical(1)}) for method consistency, ignored.} + \item{\code{trim_lines}}{(\code{logical(1)}) flag specifying whether to trim lines if class names are too long.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + The formatted string. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{show_all}}{(\code{logical(1)}) for method consistency, ignored.} - -\item{\code{trim_lines}}{(\code{logical(1)}) flag specifying whether to trim lines if class names are too long.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -The formatted string. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-get_call}{}}} -\subsection{Method \code{get_call()}}{ -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$get_call(sid)}\if{html}{\out{
}} +\subsection{\code{DefaultFilteredDataset$get_call()}}{ + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$get_call(sid)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{sid}}{(\code{character(1)}) for method consistency, ignored.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{sid}}{(\code{character(1)}) for method consistency, ignored.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-get_filter_state}{}}} -\subsection{Method \code{get_filter_state()}}{ -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$get_filter_state()}\if{html}{\out{
}} +\subsection{\code{DefaultFilteredDataset$get_filter_state()}}{ + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$get_filter_state()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$set_filter_state(state)}\if{html}{\out{
}} +\subsection{\code{DefaultFilteredDataset$set_filter_state()}}{ + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$set_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices}) for method consistency, ignored.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices}) for method consistency, ignored.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-clear_filter_states}{}}} -\subsection{Method \code{clear_filter_states()}}{ -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$clear_filter_states(force)}\if{html}{\out{
}} +\subsection{\code{DefaultFilteredDataset$clear_filter_states()}}{ + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$clear_filter_states(force)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{force}}{(\code{logical(1)}) for method consistency, ignored.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{force}}{(\code{logical(1)}) for method consistency, ignored.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-get_filter_overview}{}}} -\subsection{Method \code{get_filter_overview()}}{ -Creates row for filter overview in the form of \cr +\subsection{\code{DefaultFilteredDataset$get_filter_overview()}}{ + Creates row for filter overview in the form of \cr \code{dataname} - unsupported data class -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$get_filter_overview()}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$get_filter_overview()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{data.frame}. + } } -\subsection{Returns}{ -A \code{data.frame}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-ui_active}{}}} -\subsection{Method \code{ui_active()}}{ -Overwrites parent method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$ui_active(id, allow_add)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{DefaultFilteredDataset$ui_active()}}{ + Overwrites parent method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$ui_active(id, allow_add)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{allow_add}}{(ignored)} -} -\if{html}{\out{
}} -} -\subsection{Details}{ -Blank UI module that would list active filter states for this dataset. + \item{\code{allow_add}}{(ignored)} + } + \if{html}{\out{
}} + } + \subsection{Details}{ + Blank UI module that would list active filter states for this dataset. + } + \subsection{Returns}{ + An empty \code{div}. + } } -\subsection{Returns}{ -An empty \code{div}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-ui_add}{}}} -\subsection{Method \code{ui_add()}}{ -Overwrites parent method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$ui_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{DefaultFilteredDataset$ui_add()}}{ + Overwrites parent method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$ui_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} -} -\if{html}{\out{
}} -} -\subsection{Details}{ -Blank UI module that would list active filter states for this dataset. + } + \if{html}{\out{
}} + } + \subsection{Details}{ + Blank UI module that would list active filter states for this dataset. + } + \subsection{Returns}{ + An empty \code{div}. + } } -\subsection{Returns}{ -An empty \code{div}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-DefaultFilteredDataset-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{DefaultFilteredDataset$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{DefaultFilteredDataset$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{DefaultFilteredDataset$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/EmptyFilterState.Rd b/man/EmptyFilterState.Rd index 09f31b2c6..e06405342 100644 --- a/man/EmptyFilterState.Rd +++ b/man/EmptyFilterState.Rd @@ -26,112 +26,113 @@ isolate(filter_state$get_call()) } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterState]{teal.slice::FilterState}} -> \code{EmptyFilterState} +\code{\link[teal.slice:FilterState]{FilterState}} -> \code{EmptyFilterState} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-EmptyFilterState-new}{\code{EmptyFilterState$new()}} -\item \href{#method-EmptyFilterState-get_call}{\code{EmptyFilterState$get_call()}} -\item \href{#method-EmptyFilterState-clone}{\code{EmptyFilterState$clone()}} -} + \itemize{ + \item \href{#method-EmptyFilterState-initialize}{\code{EmptyFilterState$new()}} + \item \href{#method-EmptyFilterState-get_call}{\code{EmptyFilterState$get_call()}} + \item \href{#method-EmptyFilterState-clone}{\code{EmptyFilterState$clone()}} + } } -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-EmptyFilterState-new}{}}} -\subsection{Method \code{new()}}{ -Initialize \code{EmptyFilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{EmptyFilterState$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-EmptyFilterState-initialize}{}}} +\subsection{\code{EmptyFilterState$new()}}{ + Initialize \code{EmptyFilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{EmptyFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{vector}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{vector}) variable to be filtered,} - -\item{\code{x_reactive}}{(\code{reactive}) + \item{\code{x_reactive}}{(\code{reactive}) returning vector of the same type as \code{x}. Is used to update counts following the change in values of the filtered dataset. If it is set to \code{reactive(NULL)} then counts based on filtered dataset are not shown.} - -\item{\code{extract_type}}{(\code{character}) + \item{\code{extract_type}}{(\code{character}) specifying whether condition calls should be prefixed by \code{dataname}. Possible values: \itemize{ \item \code{character(0)} (default) \code{varname} in the condition call will not be prefixed \item \code{"list"} \code{varname} in the condition call will be returned as \verb{$} \item \code{"matrix"} \code{varname} in the condition call will be returned as \verb{[, ]} }} - -\item{\code{slice}}{(\code{teal_slice}) + \item{\code{slice}}{(\code{teal_slice}) specification of this filter state. \code{teal_slice} is stored in the object and \code{set_state} directly manipulates values within \code{teal_slice}. \code{get_state} returns \code{teal_slice} object which can be reused in other places. Note that \code{teal_slice} is a \code{reactiveValues}, which means it has reference semantics, i.e. changes made to an object are automatically reflected in all places that refer to the same \code{teal_slice}.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{EmptyFilterState}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{EmptyFilterState}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-EmptyFilterState-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Returns reproducible condition call for current selection relevant for selected variable type. +\subsection{\code{EmptyFilterState$get_call()}}{ + Returns reproducible condition call for current selection relevant for selected variable type. Uses internal reactive values, hence must be called in reactive or isolated context. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{EmptyFilterState$get_call(dataname)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{EmptyFilterState$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{logical(1)} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{logical(1)} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-EmptyFilterState-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{EmptyFilterState$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{EmptyFilterState$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{EmptyFilterState$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/FilterPanelAPI.Rd b/man/FilterPanelAPI.Rd index 778ceff02..250ae5436 100644 --- a/man/FilterPanelAPI.Rd +++ b/man/FilterPanelAPI.Rd @@ -44,127 +44,139 @@ isolate(fpa$get_filter_state()) } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-FilterPanelAPI-new}{\code{FilterPanelAPI$new()}} -\item \href{#method-FilterPanelAPI-get_filter_state}{\code{FilterPanelAPI$get_filter_state()}} -\item \href{#method-FilterPanelAPI-set_filter_state}{\code{FilterPanelAPI$set_filter_state()}} -\item \href{#method-FilterPanelAPI-remove_filter_state}{\code{FilterPanelAPI$remove_filter_state()}} -\item \href{#method-FilterPanelAPI-clear_filter_states}{\code{FilterPanelAPI$clear_filter_states()}} -\item \href{#method-FilterPanelAPI-clone}{\code{FilterPanelAPI$clone()}} -} + \itemize{ + \item \href{#method-FilterPanelAPI-initialize}{\code{FilterPanelAPI$new()}} + \item \href{#method-FilterPanelAPI-get_filter_state}{\code{FilterPanelAPI$get_filter_state()}} + \item \href{#method-FilterPanelAPI-set_filter_state}{\code{FilterPanelAPI$set_filter_state()}} + \item \href{#method-FilterPanelAPI-remove_filter_state}{\code{FilterPanelAPI$remove_filter_state()}} + \item \href{#method-FilterPanelAPI-clear_filter_states}{\code{FilterPanelAPI$clear_filter_states()}} + \item \href{#method-FilterPanelAPI-clone}{\code{FilterPanelAPI$clone()}} + } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-FilterPanelAPI-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterPanelAPI} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterPanelAPI$new(datasets)}\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-FilterPanelAPI-initialize}{}}} +\subsection{\code{FilterPanelAPI$new()}}{ + Initialize a \code{FilterPanelAPI} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterPanelAPI$new(datasets)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{datasets}}{(\code{FilteredData})} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{datasets}}{(\code{FilteredData})} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterPanelAPI-get_filter_state}{}}} -\subsection{Method \code{get_filter_state()}}{ -Gets the reactive values from the active \code{FilterState} objects of the \code{FilteredData} object. +\subsection{\code{FilterPanelAPI$get_filter_state()}}{ + Gets the reactive values from the active \code{FilterState} objects of the \code{FilteredData} object. Gets all active filters in the form of a nested list. The output list is a compatible input to \code{set_filter_state}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterPanelAPI$get_filter_state()}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterPanelAPI$get_filter_state()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{list} with named elements corresponding to \code{FilteredDataset} objects with active filters. + } } -\subsection{Returns}{ -\code{list} with named elements corresponding to \code{FilteredDataset} objects with active filters. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterPanelAPI-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -Sets active filter states. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterPanelAPI$set_filter_state(filter)}\if{html}{\out{
}} +\subsection{\code{FilterPanelAPI$set_filter_state()}}{ + Sets active filter states. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterPanelAPI$set_filter_state(filter)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{filter}}{(\code{teal_slices})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{filter}}{(\code{teal_slices})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterPanelAPI-remove_filter_state}{}}} -\subsection{Method \code{remove_filter_state()}}{ -Remove one or more \code{FilterState} of a \code{FilteredDataset} in the \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterPanelAPI$remove_filter_state(filter)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{filter}}{(\code{teal_slices}) +\subsection{\code{FilterPanelAPI$remove_filter_state()}}{ + Remove one or more \code{FilterState} of a \code{FilteredDataset} in the \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterPanelAPI$remove_filter_state(filter)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{filter}}{(\code{teal_slices}) specifying \code{FilterState} objects to remove; \code{teal_slice}s may contain only \code{dataname} and \code{varname}, other elements are ignored} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterPanelAPI-clear_filter_states}{}}} -\subsection{Method \code{clear_filter_states()}}{ -Remove all \code{FilterStates} of the \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterPanelAPI$clear_filter_states(datanames)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{datanames}}{(\code{character}) +\subsection{\code{FilterPanelAPI$clear_filter_states()}}{ + Remove all \code{FilterStates} of the \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterPanelAPI$clear_filter_states(datanames)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{datanames}}{(\code{character}) \code{datanames} to remove their \code{FilterStates}; omit to remove all \code{FilterStates} in the \code{FilteredData} object} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterPanelAPI-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterPanelAPI$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{FilterPanelAPI$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterPanelAPI$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/FilterState.Rd b/man/FilterState.Rd index d06584e34..2584c0ab9 100644 --- a/man/FilterState.Rd +++ b/man/FilterState.Rd @@ -45,225 +45,239 @@ Modifying a \code{FilterState} object is possible in three scenarios: \keyword{internal} \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-FilterState-new}{\code{FilterState$new()}} -\item \href{#method-FilterState-destroy}{\code{FilterState$destroy()}} -\item \href{#method-FilterState-format}{\code{FilterState$format()}} -\item \href{#method-FilterState-print}{\code{FilterState$print()}} -\item \href{#method-FilterState-set_state}{\code{FilterState$set_state()}} -\item \href{#method-FilterState-get_state}{\code{FilterState$get_state()}} -\item \href{#method-FilterState-get_call}{\code{FilterState$get_call()}} -\item \href{#method-FilterState-server}{\code{FilterState$server()}} -\item \href{#method-FilterState-ui}{\code{FilterState$ui()}} -\item \href{#method-FilterState-clone}{\code{FilterState$clone()}} -} + \itemize{ + \item \href{#method-FilterState-initialize}{\code{FilterState$new()}} + \item \href{#method-FilterState-destroy}{\code{FilterState$destroy()}} + \item \href{#method-FilterState-format}{\code{FilterState$format()}} + \item \href{#method-FilterState-print}{\code{FilterState$print()}} + \item \href{#method-FilterState-set_state}{\code{FilterState$set_state()}} + \item \href{#method-FilterState-get_state}{\code{FilterState$get_state()}} + \item \href{#method-FilterState-get_call}{\code{FilterState$get_call()}} + \item \href{#method-FilterState-server}{\code{FilterState$server()}} + \item \href{#method-FilterState-ui}{\code{FilterState$ui()}} + \item \href{#method-FilterState-clone}{\code{FilterState$clone()}} + } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-FilterState-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-FilterState-initialize}{}}} +\subsection{\code{FilterState$new()}}{ + Initialize a \code{FilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$new( x, x_reactive = reactive(NULL), slice, extract_type = character(0) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{vector}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{vector}) variable to be filtered.} - -\item{\code{x_reactive}}{(\code{reactive}) + \item{\code{x_reactive}}{(\code{reactive}) returning vector of the same type as \code{x}. Is used to update counts following the change in values of the filtered dataset. If it is set to \code{reactive(NULL)} then counts based on filtered dataset are not shown.} - -\item{\code{slice}}{(\code{teal_slice}) + \item{\code{slice}}{(\code{teal_slice}) specification of this filter state. \code{teal_slice} is stored in the object and \code{set_state} directly manipulates values within \code{teal_slice}. \code{get_state} returns \code{teal_slice} object which can be reused in other places. Note that \code{teal_slice} is a \code{reactiveValues}, which means it has reference semantics, i.e. changes made to an object are automatically reflected in all places that refer to the same \code{teal_slice}.} - -\item{\code{extract_type}}{(\code{character}) + \item{\code{extract_type}}{(\code{character}) specifying whether condition calls should be prefixed by \code{dataname}. Possible values: \itemize{ \item \code{character(0)} (default) \code{varname} in the condition call will not be prefixed \item \code{"list"} \code{varname} in the condition call will be returned as \verb{$} \item \code{"matrix"} \code{varname} in the condition call will be returned as \verb{[, ]} }} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{FilterState}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{FilterState}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-destroy}{}}} -\subsection{Method \code{destroy()}}{ -Destroys a \code{FilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$destroy()}\if{html}{\out{
}} +\subsection{\code{FilterState$destroy()}}{ + Destroys a \code{FilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$destroy()} + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-format}{}}} -\subsection{Method \code{format()}}{ -Returns a formatted string representing this \code{FilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$format(show_all = FALSE, trim_lines = TRUE)}\if{html}{\out{
}} +\subsection{\code{FilterState$format()}}{ + Returns a formatted string representing this \code{FilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$format(show_all = FALSE, trim_lines = TRUE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}} + \item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{character(1)} the formatted string + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}} - -\item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{character(1)} the formatted string -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-print}{}}} -\subsection{Method \code{print()}}{ -Prints this \code{FilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$print(...)}\if{html}{\out{
}} +\subsection{\code{FilterState$print()}}{ + Prints this \code{FilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$print(...)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{...}}{additional arguments} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{...}}{additional arguments} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-set_state}{}}} -\subsection{Method \code{set_state()}}{ -Sets mutable parameters of the filter state. +\subsection{\code{FilterState$set_state()}}{ + Sets mutable parameters of the filter state. \itemize{ \item \code{fixed} state is prevented from changing state \item \code{anchored} state is prevented from removing state } -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$set_state(state)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$set_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slice})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{self} invisibly + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slice})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{self} invisibly -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-get_state}{}}} -\subsection{Method \code{get_state()}}{ -Returns a complete description of the filter state. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$get_state()}\if{html}{\out{
}} +\subsection{\code{FilterState$get_state()}}{ + Returns a complete description of the filter state. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$get_state()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{teal_slice} object. + } } -\subsection{Returns}{ -A \code{teal_slice} object. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Returns reproducible condition call for current selection relevant +\subsection{\code{FilterState$get_call()}}{ + Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive and must be executed in reactive or isolated context. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$get_call()}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$get_call()} + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-server}{}}} -\subsection{Method \code{server()}}{ -\code{shiny} module server. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$server(id, remove_callback)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilterState$server()}}{ + \code{shiny} module server. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$server(id, remove_callback)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{remove_callback}}{(\code{function}) + \item{\code{remove_callback}}{(\code{function}) callback to handle removal of this \code{FilterState} object from \code{state_list}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Reactive expression signaling that remove button has been clicked. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Reactive expression signaling that remove button has been clicked. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-ui}{}}} -\subsection{Method \code{ui()}}{ -\code{shiny} UI module. +\subsection{\code{FilterState$ui()}}{ + \code{shiny} UI module. The UI for this class contains simple message stating that it is not supported. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$ui(id, parent_id = "cards")}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$ui(id, parent_id = "cards")} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{parent_id}}{(\code{character(1)}) id of the \code{FilterStates} card container} -} -\if{html}{\out{
}} -} + \item{\code{parent_id}}{(\code{character(1)}) id of the \code{FilterStates} card container} + } + \if{html}{\out{
}} + } } + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterState-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterState$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{FilterState$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterState$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/FilterStateExpr.Rd b/man/FilterStateExpr.Rd index d3c6344f8..e3eb478ac 100644 --- a/man/FilterStateExpr.Rd +++ b/man/FilterStateExpr.Rd @@ -68,210 +68,227 @@ if (interactive()) { \keyword{internal} \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-FilterStateExpr-new}{\code{FilterStateExpr$new()}} -\item \href{#method-FilterStateExpr-destroy}{\code{FilterStateExpr$destroy()}} -\item \href{#method-FilterStateExpr-format}{\code{FilterStateExpr$format()}} -\item \href{#method-FilterStateExpr-print}{\code{FilterStateExpr$print()}} -\item \href{#method-FilterStateExpr-get_state}{\code{FilterStateExpr$get_state()}} -\item \href{#method-FilterStateExpr-set_state}{\code{FilterStateExpr$set_state()}} -\item \href{#method-FilterStateExpr-get_call}{\code{FilterStateExpr$get_call()}} -\item \href{#method-FilterStateExpr-server}{\code{FilterStateExpr$server()}} -\item \href{#method-FilterStateExpr-ui}{\code{FilterStateExpr$ui()}} -\item \href{#method-FilterStateExpr-clone}{\code{FilterStateExpr$clone()}} -} + \itemize{ + \item \href{#method-FilterStateExpr-initialize}{\code{FilterStateExpr$new()}} + \item \href{#method-FilterStateExpr-destroy}{\code{FilterStateExpr$destroy()}} + \item \href{#method-FilterStateExpr-format}{\code{FilterStateExpr$format()}} + \item \href{#method-FilterStateExpr-print}{\code{FilterStateExpr$print()}} + \item \href{#method-FilterStateExpr-get_state}{\code{FilterStateExpr$get_state()}} + \item \href{#method-FilterStateExpr-set_state}{\code{FilterStateExpr$set_state()}} + \item \href{#method-FilterStateExpr-get_call}{\code{FilterStateExpr$get_call()}} + \item \href{#method-FilterStateExpr-server}{\code{FilterStateExpr$server()}} + \item \href{#method-FilterStateExpr-ui}{\code{FilterStateExpr$ui()}} + \item \href{#method-FilterStateExpr-clone}{\code{FilterStateExpr$clone()}} + } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-FilterStateExpr-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterStateExpr} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$new(slice)}\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-FilterStateExpr-initialize}{}}} +\subsection{\code{FilterStateExpr$new()}}{ + Initialize a \code{FilterStateExpr} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$new(slice)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{slice}}{(\code{teal_slice_expr})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{FilterStateExpr}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{slice}}{(\code{teal_slice_expr})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{FilterStateExpr}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-destroy}{}}} -\subsection{Method \code{destroy()}}{ -Destroys a \code{FilterStateExpr} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$destroy()}\if{html}{\out{
}} +\subsection{\code{FilterStateExpr$destroy()}}{ + Destroys a \code{FilterStateExpr} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$destroy()} + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-format}{}}} -\subsection{Method \code{format()}}{ -Returns a formatted string representing this \code{FilterStateExpr} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)}\if{html}{\out{
}} +\subsection{\code{FilterStateExpr$format()}}{ + Returns a formatted string representing this \code{FilterStateExpr} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$format(show_all = FALSE, trim_lines = TRUE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}} + \item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{character(1)} the formatted string + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}} - -\item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{character(1)} the formatted string -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-print}{}}} -\subsection{Method \code{print()}}{ -Prints this \code{FilterStateExpr} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$print(...)}\if{html}{\out{
}} +\subsection{\code{FilterStateExpr$print()}}{ + Prints this \code{FilterStateExpr} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$print(...)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{...}}{arguments passed to the \code{format} method} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{...}}{arguments passed to the \code{format} method} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-get_state}{}}} -\subsection{Method \code{get_state()}}{ -Returns a complete description of this filter state. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$get_state()}\if{html}{\out{
}} +\subsection{\code{FilterStateExpr$get_state()}}{ + Returns a complete description of this filter state. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$get_state()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{teal_slice} object. + } } -\subsection{Returns}{ -A \code{teal_slice} object. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-set_state}{}}} -\subsection{Method \code{set_state()}}{ -Does nothing. Exists for compatibility. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$set_state(state)}\if{html}{\out{
}} +\subsection{\code{FilterStateExpr$set_state()}}{ + Does nothing. Exists for compatibility. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$set_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slice})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{self}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slice})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{self}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Get reproducible call. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$get_call(dataname)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{(\code{ignored}) for a consistency with \code{FilterState} +\subsection{\code{FilterStateExpr$get_call()}}{ + Get reproducible call. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{(\code{ignored}) for a consistency with \code{FilterState} Returns reproducible condition call for current selection relevant for selected variable type. Method is using internal reactive values which makes it reactive and must be executed in reactive or isolated context.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{call} or \code{NULL} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{call} or \code{NULL} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-server}{}}} -\subsection{Method \code{server()}}{ -\code{shiny} module server. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$server(id, remove_callback)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilterStateExpr$server()}}{ + \code{shiny} module server. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$server(id, remove_callback)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{remove_callback}}{(\code{function}) + \item{\code{remove_callback}}{(\code{function}) callback to handle removal of this \code{FilterState} object from \code{state_list}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Reactive expression signaling that the remove button has been clicked. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Reactive expression signaling that the remove button has been clicked. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-ui}{}}} -\subsection{Method \code{ui()}}{ -\code{shiny} module UI. +\subsection{\code{FilterStateExpr$ui()}}{ + \code{shiny} module UI. The UI for this class contains simple message stating that it is not supported. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$ui(id, parent_id = "cards")}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$ui(id, parent_id = "cards")} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{parent_id}}{(\code{character(1)}) + \item{\code{parent_id}}{(\code{character(1)}) id of the \code{FilterStates} card container.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStateExpr-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStateExpr$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{FilterStateExpr$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStateExpr$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/FilterStates.Rd b/man/FilterStates.Rd index 8c145348b..acd77ed86 100644 --- a/man/FilterStates.Rd +++ b/man/FilterStates.Rd @@ -22,100 +22,102 @@ Currently implemented for \code{data.frame}, \code{matrix}, \keyword{internal} \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-FilterStates-new}{\code{FilterStates$new()}} -\item \href{#method-FilterStates-destroy}{\code{FilterStates$destroy()}} -\item \href{#method-FilterStates-format}{\code{FilterStates$format()}} -\item \href{#method-FilterStates-get_call}{\code{FilterStates$get_call()}} -\item \href{#method-FilterStates-print}{\code{FilterStates$print()}} -\item \href{#method-FilterStates-remove_filter_state}{\code{FilterStates$remove_filter_state()}} -\item \href{#method-FilterStates-get_filter_state}{\code{FilterStates$get_filter_state()}} -\item \href{#method-FilterStates-set_filter_state}{\code{FilterStates$set_filter_state()}} -\item \href{#method-FilterStates-clear_filter_states}{\code{FilterStates$clear_filter_states()}} -\item \href{#method-FilterStates-ui_active}{\code{FilterStates$ui_active()}} -\item \href{#method-FilterStates-srv_active}{\code{FilterStates$srv_active()}} -\item \href{#method-FilterStates-ui_add}{\code{FilterStates$ui_add()}} -\item \href{#method-FilterStates-srv_add}{\code{FilterStates$srv_add()}} -\item \href{#method-FilterStates-clone}{\code{FilterStates$clone()}} -} + \itemize{ + \item \href{#method-FilterStates-initialize}{\code{FilterStates$new()}} + \item \href{#method-FilterStates-destroy}{\code{FilterStates$destroy()}} + \item \href{#method-FilterStates-format}{\code{FilterStates$format()}} + \item \href{#method-FilterStates-get_call}{\code{FilterStates$get_call()}} + \item \href{#method-FilterStates-print}{\code{FilterStates$print()}} + \item \href{#method-FilterStates-remove_filter_state}{\code{FilterStates$remove_filter_state()}} + \item \href{#method-FilterStates-get_filter_state}{\code{FilterStates$get_filter_state()}} + \item \href{#method-FilterStates-set_filter_state}{\code{FilterStates$set_filter_state()}} + \item \href{#method-FilterStates-clear_filter_states}{\code{FilterStates$clear_filter_states()}} + \item \href{#method-FilterStates-ui_active}{\code{FilterStates$ui_active()}} + \item \href{#method-FilterStates-srv_active}{\code{FilterStates$srv_active()}} + \item \href{#method-FilterStates-ui_add}{\code{FilterStates$ui_add()}} + \item \href{#method-FilterStates-srv_add}{\code{FilterStates$srv_add()}} + \item \href{#method-FilterStates-clone}{\code{FilterStates$clone()}} + } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-FilterStates-new}{}}} -\subsection{Method \code{new()}}{ -Initializes \code{FilterStates} object by setting +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-FilterStates-initialize}{}}} +\subsection{\code{FilterStates$new()}}{ + Initializes \code{FilterStates} object by setting \code{dataname}, and \code{datalabel}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$new( + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$new( data, data_reactive = function(sid = "") NULL, dataname, datalabel = NULL -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{data}}{(\code{data.frame} or \code{MultiAssayExperiment} or \code{SummarizedExperiment} or \code{matrix}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{data}}{(\code{data.frame} or \code{MultiAssayExperiment} or \code{SummarizedExperiment} or \code{matrix}) the \code{R} object which \code{subset} function is applied on.} - -\item{\code{data_reactive}}{(\verb{function(sid)}) + \item{\code{data_reactive}}{(\verb{function(sid)}) should return an object of the same type as \code{data} object or \code{NULL}. This object is needed for the \code{FilterState} counts being updated on a change in filters. If function returns \code{NULL} then filtered counts are not shown. Function has to have \code{sid} argument being a character.} - -\item{\code{dataname}}{(\code{character(1)}) + \item{\code{dataname}}{(\code{character(1)}) name of the dataset, used in the subset expression. Passed to the function argument attached to this \code{FilterStates}.} - -\item{\code{datalabel}}{(\code{character(1)}) optional + \item{\code{datalabel}}{(\code{character(1)}) optional text label.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{FilterStates}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{FilterStates}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-destroy}{}}} -\subsection{Method \code{destroy()}}{ -Destroys a \code{FilterStates} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$destroy()}\if{html}{\out{
}} +\subsection{\code{FilterStates$destroy()}}{ + Destroys a \code{FilterStates} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$destroy()} + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-format}{}}} -\subsection{Method \code{format()}}{ -Returns a formatted string representing this \code{FilterStates} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$format(show_all = FALSE, trim_lines = TRUE)}\if{html}{\out{
}} +\subsection{\code{FilterStates$format()}}{ + Returns a formatted string representing this \code{FilterStates} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$format(show_all = FALSE, trim_lines = TRUE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slices}} + \item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slices}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{character(1)} the formatted string + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slices}} - -\item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slices}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{character(1)} the formatted string -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Filter call +\subsection{\code{FilterStates$get_call()}}{ + Filter call Builds \emph{subset expression} from condition calls generated by \code{FilterState}. The \code{lhs} of the expression is a \code{dataname_prefixed}, where word prefixed refers to @@ -150,223 +152,245 @@ dataname[[element]] <- subset(dataname[[element]], subset = col == "x") }\if{html}{\out{}} If no filters are applied, \code{NULL} is returned to avoid no-op calls such as \code{dataname <- dataname}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$get_call(sid = "")}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{sid}}{(\code{character}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$get_call(sid = "")} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{sid}}{(\code{character}) when specified then method returns code containing condition calls (logical predicates) of \code{FilterState} objects which \code{"sid"} attribute is different than this \code{sid} argument.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{call} or \code{NULL} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{call} or \code{NULL} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-print}{}}} -\subsection{Method \code{print()}}{ -Prints this \code{FilterStates} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$print(...)}\if{html}{\out{
}} +\subsection{\code{FilterStates$print()}}{ + Prints this \code{FilterStates} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$print(...)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{...}}{additional arguments passed to \code{format}.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{...}}{additional arguments passed to \code{format}.} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-remove_filter_state}{}}} -\subsection{Method \code{remove_filter_state()}}{ -Remove one or more \code{FilterState}s from the \code{state_list} along with their UI elements. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$remove_filter_state(state)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices}) +\subsection{\code{FilterStates$remove_filter_state()}}{ + Remove one or more \code{FilterState}s from the \code{state_list} along with their UI elements. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$remove_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices}) specifying \code{FilterState} objects to remove; \code{teal_slice}s may contain only \code{dataname} and \code{varname}, other elements are ignored} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-get_filter_state}{}}} -\subsection{Method \code{get_filter_state()}}{ -Gets reactive values from active \code{FilterState} objects. +\subsection{\code{FilterStates$get_filter_state()}}{ + Gets reactive values from active \code{FilterState} objects. Get active filter state from \code{FilterState} objects stored in \code{state_list}(s). The output is a list compatible with input to \code{self$set_filter_state}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$get_filter_state()}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$get_filter_state()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{teal_slices}. + } } -\subsection{Returns}{ -Object of class \code{teal_slices}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -Sets active \code{FilterState} objects. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$set_filter_state(state)}\if{html}{\out{
}} +\subsection{\code{FilterStates$set_filter_state()}}{ + Sets active \code{FilterState} objects. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$set_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Function that raises an error. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -Function that raises an error. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-clear_filter_states}{}}} -\subsection{Method \code{clear_filter_states()}}{ -Remove all \code{FilterState} objects from this \code{FilterStates} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$clear_filter_states(force = FALSE)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{force}}{(\code{logical(1)}) +\subsection{\code{FilterStates$clear_filter_states()}}{ + Remove all \code{FilterState} objects from this \code{FilterStates} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$clear_filter_states(force = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{force}}{(\code{logical(1)}) flag specifying whether to include anchored filter states.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-ui_active}{}}} -\subsection{Method \code{ui_active()}}{ -\code{shiny} UI definition that stores \code{FilterState} UI elements. +\subsection{\code{FilterStates$ui_active()}}{ + \code{shiny} UI definition that stores \code{FilterState} UI elements. Populated with elements created with \code{renderUI} in the module server. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$ui_active(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$ui_active(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-srv_active}{}}} -\subsection{Method \code{srv_active()}}{ -\code{shiny} server module. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$srv_active(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilterStates$srv_active()}}{ + \code{shiny} server module. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$srv_active(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-ui_add}{}}} -\subsection{Method \code{ui_add()}}{ -\code{shiny} UI module to add filter variable. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$ui_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilterStates$ui_add()}}{ + \code{shiny} UI module to add filter variable. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$ui_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-srv_add}{}}} -\subsection{Method \code{srv_add()}}{ -\code{shiny} server module to add filter variable. +\subsection{\code{FilterStates$srv_add()}}{ + \code{shiny} server module to add filter variable. This module controls available choices to select as a filter variable. Once selected, a variable is removed from available choices. Removing a filter variable adds it back to available choices. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$srv_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$srv_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilterStates-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilterStates$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{FilterStates$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilterStates$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/FilteredData.Rd b/man/FilteredData.Rd index d288e8ce6..014783cf7 100644 --- a/man/FilteredData.Rd +++ b/man/FilteredData.Rd @@ -95,170 +95,179 @@ isolate(datasets$get_filter_state()) \keyword{internal} \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-FilteredData-new}{\code{FilteredData$new()}} -\item \href{#method-FilteredData-destroy}{\code{FilteredData$destroy()}} -\item \href{#method-FilteredData-datanames}{\code{FilteredData$datanames()}} -\item \href{#method-FilteredData-get_datalabel}{\code{FilteredData$get_datalabel()}} -\item \href{#method-FilteredData-set_available_teal_slices}{\code{FilteredData$set_available_teal_slices()}} -\item \href{#method-FilteredData-get_available_teal_slices}{\code{FilteredData$get_available_teal_slices()}} -\item \href{#method-FilteredData-get_call}{\code{FilteredData$get_call()}} -\item \href{#method-FilteredData-get_data}{\code{FilteredData$get_data()}} -\item \href{#method-FilteredData-get_join_keys}{\code{FilteredData$get_join_keys()}} -\item \href{#method-FilteredData-get_filter_overview}{\code{FilteredData$get_filter_overview()}} -\item \href{#method-FilteredData-get_keys}{\code{FilteredData$get_keys()}} -\item \href{#method-FilteredData-set_dataset}{\code{FilteredData$set_dataset()}} -\item \href{#method-FilteredData-set_join_keys}{\code{FilteredData$set_join_keys()}} -\item \href{#method-FilteredData-get_filter_state}{\code{FilteredData$get_filter_state()}} -\item \href{#method-FilteredData-format}{\code{FilteredData$format()}} -\item \href{#method-FilteredData-print}{\code{FilteredData$print()}} -\item \href{#method-FilteredData-set_filter_state}{\code{FilteredData$set_filter_state()}} -\item \href{#method-FilteredData-remove_filter_state}{\code{FilteredData$remove_filter_state()}} -\item \href{#method-FilteredData-clear_filter_states}{\code{FilteredData$clear_filter_states()}} -\item \href{#method-FilteredData-ui_filter_panel}{\code{FilteredData$ui_filter_panel()}} -\item \href{#method-FilteredData-srv_filter_panel}{\code{FilteredData$srv_filter_panel()}} -\item \href{#method-FilteredData-ui_active}{\code{FilteredData$ui_active()}} -\item \href{#method-FilteredData-srv_active}{\code{FilteredData$srv_active()}} -\item \href{#method-FilteredData-ui_overview}{\code{FilteredData$ui_overview()}} -\item \href{#method-FilteredData-srv_overview}{\code{FilteredData$srv_overview()}} -\item \href{#method-FilteredData-clone}{\code{FilteredData$clone()}} -} + \itemize{ + \item \href{#method-FilteredData-initialize}{\code{FilteredData$new()}} + \item \href{#method-FilteredData-destroy}{\code{FilteredData$destroy()}} + \item \href{#method-FilteredData-datanames}{\code{FilteredData$datanames()}} + \item \href{#method-FilteredData-get_datalabel}{\code{FilteredData$get_datalabel()}} + \item \href{#method-FilteredData-set_available_teal_slices}{\code{FilteredData$set_available_teal_slices()}} + \item \href{#method-FilteredData-get_available_teal_slices}{\code{FilteredData$get_available_teal_slices()}} + \item \href{#method-FilteredData-get_call}{\code{FilteredData$get_call()}} + \item \href{#method-FilteredData-get_data}{\code{FilteredData$get_data()}} + \item \href{#method-FilteredData-get_join_keys}{\code{FilteredData$get_join_keys()}} + \item \href{#method-FilteredData-get_filter_overview}{\code{FilteredData$get_filter_overview()}} + \item \href{#method-FilteredData-get_keys}{\code{FilteredData$get_keys()}} + \item \href{#method-FilteredData-set_dataset}{\code{FilteredData$set_dataset()}} + \item \href{#method-FilteredData-set_join_keys}{\code{FilteredData$set_join_keys()}} + \item \href{#method-FilteredData-get_filter_state}{\code{FilteredData$get_filter_state()}} + \item \href{#method-FilteredData-format}{\code{FilteredData$format()}} + \item \href{#method-FilteredData-print}{\code{FilteredData$print()}} + \item \href{#method-FilteredData-set_filter_state}{\code{FilteredData$set_filter_state()}} + \item \href{#method-FilteredData-remove_filter_state}{\code{FilteredData$remove_filter_state()}} + \item \href{#method-FilteredData-clear_filter_states}{\code{FilteredData$clear_filter_states()}} + \item \href{#method-FilteredData-ui_filter_panel}{\code{FilteredData$ui_filter_panel()}} + \item \href{#method-FilteredData-srv_filter_panel}{\code{FilteredData$srv_filter_panel()}} + \item \href{#method-FilteredData-ui_active}{\code{FilteredData$ui_active()}} + \item \href{#method-FilteredData-srv_active}{\code{FilteredData$srv_active()}} + \item \href{#method-FilteredData-ui_overview}{\code{FilteredData$ui_overview()}} + \item \href{#method-FilteredData-srv_overview}{\code{FilteredData$srv_overview()}} + \item \href{#method-FilteredData-clone}{\code{FilteredData$clone()}} + } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-FilteredData-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$new(data_objects, join_keys = teal.data::join_keys())}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{data_objects}}{(\verb{named list}) +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-FilteredData-initialize}{}}} +\subsection{\code{FilteredData$new()}}{ + Initialize a \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$new(data_objects, join_keys = teal.data::join_keys())} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{data_objects}}{(\verb{named list}) List of data objects. Names of the list will be used as \code{dataname} for respective datasets.} - -\item{\code{join_keys}}{(\code{join_keys}) optional joining keys, see \code{\link[teal.data:join_keys]{teal.data::join_keys()}}.} -} -\if{html}{\out{
}} -} + \item{\code{join_keys}}{(\code{join_keys}) optional joining keys, see \code{\link[teal.data:join_keys]{teal.data::join_keys()}}.} + } + \if{html}{\out{
}} + } } + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-destroy}{}}} -\subsection{Method \code{destroy()}}{ -Destroys a \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$destroy()}\if{html}{\out{
}} +\subsection{\code{FilteredData$destroy()}}{ + Destroys a \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$destroy()} + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-datanames}{}}} -\subsection{Method \code{datanames()}}{ -Gets \code{datanames}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$datanames()}\if{html}{\out{
}} -} - -\subsection{Details}{ -The \code{datanames} are returned in the order in which they must be evaluated (in case of dependencies). +\subsection{\code{FilteredData$datanames()}}{ + Gets \code{datanames}. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$datanames()} + \if{html}{\out{
}} + } + \subsection{Details}{ + The \code{datanames} are returned in the order in which they must be evaluated (in case of dependencies). + } + \subsection{Returns}{ + Character vector. + } } -\subsection{Returns}{ -Character vector. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_datalabel}{}}} -\subsection{Method \code{get_datalabel()}}{ -Gets data label for the dataset. +\subsection{\code{FilteredData$get_datalabel()}}{ + Gets data label for the dataset. Useful to display in \verb{Show R Code}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_datalabel(dataname)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_datalabel(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{(\code{character(1)}) name of the dataset} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Character string. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{(\code{character(1)}) name of the dataset} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -Character string. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-set_available_teal_slices}{}}} -\subsection{Method \code{set_available_teal_slices()}}{ -Set list of external filter states available for activation. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$set_available_teal_slices(x)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{reactive}) +\subsection{\code{FilteredData$set_available_teal_slices()}}{ + Set list of external filter states available for activation. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$set_available_teal_slices(x)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{reactive}) should return \code{teal_slices}} -} -\if{html}{\out{
}} -} -\subsection{Details}{ -Unlike adding new filter from the column, these filters can come with some prespecified settings. + } + \if{html}{\out{
}} + } + \subsection{Details}{ + Unlike adding new filter from the column, these filters can come with some prespecified settings. \code{teal_slices} are wrapped in a \code{reactive} so they can be updated from elsewhere in the app. Filters passed in \code{x} are limited to those that can be set for this \code{FilteredData} object, i.e. they have the correct \code{dataname} and \code{varname} (waived \code{teal_slice_fixed} as they do not have \code{varname}). List is accessible in \code{ui/srv_active} through \code{ui/srv_available_filters}. + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_available_teal_slices}{}}} -\subsection{Method \code{get_available_teal_slices()}}{ -Get list of filter states available for this object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_available_teal_slices()}\if{html}{\out{
}} -} - -\subsection{Details}{ -All \code{teal_slice} objects that have been created since the beginning of the app session +\subsection{\code{FilteredData$get_available_teal_slices()}}{ + Get list of filter states available for this object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_available_teal_slices()} + \if{html}{\out{
}} + } + \subsection{Details}{ + All \code{teal_slice} objects that have been created since the beginning of the app session are stored in one \code{teal_slices} object. This returns a subset of that \code{teal_slices}, describing filter states that can be set for this object. + } + \subsection{Returns}{ + \code{reactive} that returns \code{teal_slices}. + } } -\subsection{Returns}{ -\code{reactive} that returns \code{teal_slices}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Gets a \code{call} to filter the dataset according to the filter state. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_call(dataname)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{(\code{character(1)}) name of the dataset} -} -\if{html}{\out{
}} -} -\subsection{Details}{ -It returns a \code{call} to filter the dataset only, assuming the +\subsection{\code{FilteredData$get_call()}}{ + Gets a \code{call} to filter the dataset according to the filter state. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{(\code{character(1)}) name of the dataset} + } + \if{html}{\out{
}} + } + \subsection{Details}{ + It returns a \code{call} to filter the dataset only, assuming the other (filtered) datasets it depends on are available. Together with \code{self$datanames()} which returns the datasets in the correct @@ -272,428 +281,456 @@ capturing a function call). The filtered dataset has the name given by \code{self$filtered_dataname(dataname)} This can be used for the \verb{Show R Code} generation. + } + \subsection{Returns}{ + A list of \code{call}s. + } } -\subsection{Returns}{ -A list of \code{call}s. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_data}{}}} -\subsection{Method \code{get_data()}}{ -Gets filtered or unfiltered dataset. +\subsection{\code{FilteredData$get_data()}}{ + Gets filtered or unfiltered dataset. For \code{filtered = FALSE}, the original data set with \code{set_data} is returned including all attributes. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_data(dataname, filtered = TRUE)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_data(dataname, filtered = TRUE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{(\code{character(1)}) name of the dataset.} + \item{\code{filtered}}{(\code{logical(1)}) whether to return a filtered or unfiltered dataset.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + A data object, a \code{data.frame} or a \code{MultiAssayExperiment}. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{(\code{character(1)}) name of the dataset.} - -\item{\code{filtered}}{(\code{logical(1)}) whether to return a filtered or unfiltered dataset.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -A data object, a \code{data.frame} or a \code{MultiAssayExperiment}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_join_keys}{}}} -\subsection{Method \code{get_join_keys()}}{ -Get join keys between two datasets. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_join_keys()}\if{html}{\out{
}} +\subsection{\code{FilteredData$get_join_keys()}}{ + Get join keys between two datasets. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_join_keys()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{join_keys} + } } -\subsection{Returns}{ -\code{join_keys} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_filter_overview}{}}} -\subsection{Method \code{get_filter_overview()}}{ -Creates filter overview table to be displayed in the application. +\subsection{\code{FilteredData$get_filter_overview()}}{ + Creates filter overview table to be displayed in the application. One row is created per dataset, according to the \code{get_filter_overview} methods of the contained \code{FilteredDataset} objects. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_filter_overview(datanames)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_filter_overview(datanames)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{datanames}}{(\code{character}) vector of dataset names.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{data.frame} listing the numbers of observations in all datasets. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{datanames}}{(\code{character}) vector of dataset names.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -A \code{data.frame} listing the numbers of observations in all datasets. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_keys}{}}} -\subsection{Method \code{get_keys()}}{ -Get keys for the dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_keys(dataname)}\if{html}{\out{
}} +\subsection{\code{FilteredData$get_keys()}}{ + Get keys for the dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_keys(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{(\code{character(1)}) name of the dataset.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Character vector of key column names. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{(\code{character(1)}) name of the dataset.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -Character vector of key column names. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-set_dataset}{}}} -\subsection{Method \code{set_dataset()}}{ -Adds a dataset to this \code{FilteredData}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$set_dataset(data, dataname)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{data}}{(\code{data.frame} or \code{MultiAssayExperiment}) +\subsection{\code{FilteredData$set_dataset()}}{ + Adds a dataset to this \code{FilteredData}. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$set_dataset(data, dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{data}}{(\code{data.frame} or \code{MultiAssayExperiment}) data to be filtered.} - -\item{\code{dataname}}{(\code{character(1)}) + \item{\code{dataname}}{(\code{character(1)}) the name of the \code{dataset} to be added to this object.} -} -\if{html}{\out{
}} -} -\subsection{Details}{ -\code{set_dataset} creates a \code{FilteredDataset} object which keeps \code{dataset} for the filtering purpose. + } + \if{html}{\out{
}} + } + \subsection{Details}{ + \code{set_dataset} creates a \code{FilteredDataset} object which keeps \code{dataset} for the filtering purpose. If this data has a parent specified in the \code{join_keys} object stored in \code{private$join_keys} then created \code{FilteredDataset} (child) gets linked with other \code{FilteredDataset} (parent). "Child" dataset return filtered data then dependent on the reactive filtered data of the "parent". See more in documentation of \code{parent} argument in \code{DataframeFilteredDataset} constructor. + } + \subsection{Returns}{ + \code{self}, invisibly. + } } -\subsection{Returns}{ -\code{self}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-set_join_keys}{}}} -\subsection{Method \code{set_join_keys()}}{ -Set the \code{join_keys}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$set_join_keys(join_keys)}\if{html}{\out{
}} +\subsection{\code{FilteredData$set_join_keys()}}{ + Set the \code{join_keys}. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$set_join_keys(join_keys)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{join_keys}}{(\code{join_keys}), see \code{\link[teal.data:join_keys]{teal.data::join_keys()}}.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{self}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{join_keys}}{(\code{join_keys}), see \code{\link[teal.data:join_keys]{teal.data::join_keys()}}.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{self}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-get_filter_state}{}}} -\subsection{Method \code{get_filter_state()}}{ -Gets states of all contained \code{FilterState} objects. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$get_filter_state()}\if{html}{\out{
}} +\subsection{\code{FilteredData$get_filter_state()}}{ + Gets states of all contained \code{FilterState} objects. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$get_filter_state()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{teal_slices} object. + } } -\subsection{Returns}{ -A \code{teal_slices} object. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-format}{}}} -\subsection{Method \code{format()}}{ -Returns a formatted string representing this \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$format(show_all = FALSE, trim_lines = TRUE)}\if{html}{\out{
}} +\subsection{\code{FilteredData$format()}}{ + Returns a formatted string representing this \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$format(show_all = FALSE, trim_lines = TRUE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} + \item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{character(1)} the formatted string. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} - -\item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{character(1)} the formatted string. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-print}{}}} -\subsection{Method \code{print()}}{ -Prints this \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$print(...)}\if{html}{\out{
}} +\subsection{\code{FilteredData$print()}}{ + Prints this \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$print(...)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{...}}{additional arguments passed to \code{format}.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{...}}{additional arguments passed to \code{format}.} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -Sets active filter states. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$set_filter_state(state)}\if{html}{\out{
}} +\subsection{\code{FilteredData$set_filter_state()}}{ + Sets active filter states. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$set_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-remove_filter_state}{}}} -\subsection{Method \code{remove_filter_state()}}{ -Removes one or more \code{FilterState} from a \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$remove_filter_state(state)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices}) +\subsection{\code{FilteredData$remove_filter_state()}}{ + Removes one or more \code{FilterState} from a \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$remove_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices}) specifying \code{FilterState} objects to remove; \code{teal_slice}s may contain only \code{dataname} and \code{varname}, other elements are ignored.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-clear_filter_states}{}}} -\subsection{Method \code{clear_filter_states()}}{ -Remove all \code{FilterStates} of a \code{FilteredDataset} or all \code{FilterStates} of a \code{FilteredData} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{datanames}}{(\code{character}) +\subsection{\code{FilteredData$clear_filter_states()}}{ + Remove all \code{FilterStates} of a \code{FilteredDataset} or all \code{FilterStates} of a \code{FilteredData} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$clear_filter_states(datanames = self$datanames(), force = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{datanames}}{(\code{character}) names of datasets for which to remove all filter states. Defaults to all datasets in this \code{FilteredData} object.} - -\item{\code{force}}{(\code{logical(1)}) + \item{\code{force}}{(\code{logical(1)}) flag specifying whether to include anchored filter states.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-ui_filter_panel}{}}} -\subsection{Method \code{ui_filter_panel()}}{ -top-level \code{shiny} module for the filter panel in the \code{teal} app. +\subsection{\code{FilteredData$ui_filter_panel()}}{ + top-level \code{shiny} module for the filter panel in the \code{teal} app. Contains 1) filter overview panel, 2) filter active panel, and 3) add filters panel. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$ui_filter_panel(id, active_datanames = self$datanames)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$ui_filter_panel(id, active_datanames = self$datanames)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{active_datanames}}{(\code{reactive}) + \item{\code{active_datanames}}{(\code{reactive}) defining subset of \code{self$datanames()} to be displayed.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-srv_filter_panel}{}}} -\subsection{Method \code{srv_filter_panel()}}{ -Server function for filter panel. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$srv_filter_panel(id, active_datanames = self$datanames)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilteredData$srv_filter_panel()}}{ + Server function for filter panel. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$srv_filter_panel(id, active_datanames = self$datanames)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{active_datanames}}{(\code{function} or \code{reactive}) + \item{\code{active_datanames}}{(\code{function} or \code{reactive}) returning \code{datanames} that should be shown on the filter panel. Must be a subset of the \code{datanames} in this \code{FilteredData}. If the function returns \code{NULL} (as opposed to \code{character(0)}), the filter panel will be hidden.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-ui_active}{}}} -\subsection{Method \code{ui_active()}}{ -Server module responsible for displaying active filters. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$ui_active(id, active_datanames = self$datanames)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilteredData$ui_active()}}{ + Server module responsible for displaying active filters. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$ui_active(id, active_datanames = self$datanames)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{active_datanames}}{(\code{reactive}) + \item{\code{active_datanames}}{(\code{reactive}) defining subset of \code{self$datanames()} to be displayed.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-srv_active}{}}} -\subsection{Method \code{srv_active()}}{ -Server module responsible for displaying active filters. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$srv_active(id, active_datanames = self$datanames)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilteredData$srv_active()}}{ + Server module responsible for displaying active filters. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$srv_active(id, active_datanames = self$datanames)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{active_datanames}}{(\code{reactive}) + \item{\code{active_datanames}}{(\code{reactive}) defining subset of \code{self$datanames()} to be displayed.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-ui_overview}{}}} -\subsection{Method \code{ui_overview()}}{ -Creates the UI definition for the module showing counts for each dataset +\subsection{\code{FilteredData$ui_overview()}}{ + Creates the UI definition for the module showing counts for each dataset contrasting the filtered to the full unfiltered dataset. Per dataset, it displays the number of rows/observations in each dataset, the number of unique subjects. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$ui_overview(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$ui_overview(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-srv_overview}{}}} -\subsection{Method \code{srv_overview()}}{ -Server function to display the number of records in the filtered and unfiltered +\subsection{\code{FilteredData$srv_overview()}}{ + Server function to display the number of records in the filtered and unfiltered data. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$srv_overview(id, active_datanames = self$datanames)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$srv_overview(id, active_datanames = self$datanames)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} - -\item{\code{active_datanames}}{(\code{reactive}) + \item{\code{active_datanames}}{(\code{reactive}) returning \code{datanames} that should be shown on the filter panel, must be a subset of the \code{datanames} argument provided to \code{ui_filter_panel}; if the function returns \code{NULL} (as opposed to \code{character(0)}), the filter panel will be hidden.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredData-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredData$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{FilteredData$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredData$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/FilteredDataset.Rd b/man/FilteredDataset.Rd index c4c8f6fdd..b7cd40d3b 100644 --- a/man/FilteredDataset.Rd +++ b/man/FilteredDataset.Rd @@ -14,365 +14,397 @@ components of the dataset. \keyword{internal} \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-FilteredDataset-new}{\code{FilteredDataset$new()}} -\item \href{#method-FilteredDataset-destroy}{\code{FilteredDataset$destroy()}} -\item \href{#method-FilteredDataset-format}{\code{FilteredDataset$format()}} -\item \href{#method-FilteredDataset-print}{\code{FilteredDataset$print()}} -\item \href{#method-FilteredDataset-clear_filter_states}{\code{FilteredDataset$clear_filter_states()}} -\item \href{#method-FilteredDataset-get_call}{\code{FilteredDataset$get_call()}} -\item \href{#method-FilteredDataset-get_filter_state}{\code{FilteredDataset$get_filter_state()}} -\item \href{#method-FilteredDataset-set_filter_state}{\code{FilteredDataset$set_filter_state()}} -\item \href{#method-FilteredDataset-get_dataname}{\code{FilteredDataset$get_dataname()}} -\item \href{#method-FilteredDataset-get_dataset}{\code{FilteredDataset$get_dataset()}} -\item \href{#method-FilteredDataset-get_filter_overview}{\code{FilteredDataset$get_filter_overview()}} -\item \href{#method-FilteredDataset-get_keys}{\code{FilteredDataset$get_keys()}} -\item \href{#method-FilteredDataset-get_dataset_label}{\code{FilteredDataset$get_dataset_label()}} -\item \href{#method-FilteredDataset-ui_active}{\code{FilteredDataset$ui_active()}} -\item \href{#method-FilteredDataset-srv_active}{\code{FilteredDataset$srv_active()}} -\item \href{#method-FilteredDataset-ui_add}{\code{FilteredDataset$ui_add()}} -\item \href{#method-FilteredDataset-srv_add}{\code{FilteredDataset$srv_add()}} -\item \href{#method-FilteredDataset-clone}{\code{FilteredDataset$clone()}} -} + \itemize{ + \item \href{#method-FilteredDataset-initialize}{\code{FilteredDataset$new()}} + \item \href{#method-FilteredDataset-destroy}{\code{FilteredDataset$destroy()}} + \item \href{#method-FilteredDataset-format}{\code{FilteredDataset$format()}} + \item \href{#method-FilteredDataset-print}{\code{FilteredDataset$print()}} + \item \href{#method-FilteredDataset-clear_filter_states}{\code{FilteredDataset$clear_filter_states()}} + \item \href{#method-FilteredDataset-get_call}{\code{FilteredDataset$get_call()}} + \item \href{#method-FilteredDataset-get_filter_state}{\code{FilteredDataset$get_filter_state()}} + \item \href{#method-FilteredDataset-set_filter_state}{\code{FilteredDataset$set_filter_state()}} + \item \href{#method-FilteredDataset-get_dataname}{\code{FilteredDataset$get_dataname()}} + \item \href{#method-FilteredDataset-get_dataset}{\code{FilteredDataset$get_dataset()}} + \item \href{#method-FilteredDataset-get_filter_overview}{\code{FilteredDataset$get_filter_overview()}} + \item \href{#method-FilteredDataset-get_keys}{\code{FilteredDataset$get_keys()}} + \item \href{#method-FilteredDataset-get_dataset_label}{\code{FilteredDataset$get_dataset_label()}} + \item \href{#method-FilteredDataset-ui_active}{\code{FilteredDataset$ui_active()}} + \item \href{#method-FilteredDataset-srv_active}{\code{FilteredDataset$srv_active()}} + \item \href{#method-FilteredDataset-ui_add}{\code{FilteredDataset$ui_add()}} + \item \href{#method-FilteredDataset-srv_add}{\code{FilteredDataset$srv_add()}} + \item \href{#method-FilteredDataset-clone}{\code{FilteredDataset$clone()}} + } } \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-FilteredDataset-new}{}}} -\subsection{Method \code{new()}}{ -Initializes this \code{FilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-FilteredDataset-initialize}{}}} +\subsection{\code{FilteredDataset$new()}}{ + Initializes this \code{FilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$new( dataset, dataname, keys = character(0), label = attr(dataset, "label", exact = TRUE) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataset}}{any object} - -\item{\code{dataname}}{(\code{character(1)}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataset}}{any object} + \item{\code{dataname}}{(\code{character(1)}) syntactically valid name given to the dataset.} - -\item{\code{keys}}{(\code{character}) optional + \item{\code{keys}}{(\code{character}) optional vector of primary key column names.} - -\item{\code{label}}{(\code{character(1)}) + \item{\code{label}}{(\code{character(1)}) label to describe the dataset.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{FilteredDataset}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{FilteredDataset}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-destroy}{}}} -\subsection{Method \code{destroy()}}{ -Destroys a \code{FilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$destroy()}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$destroy()}}{ + Destroys a \code{FilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$destroy()} + \if{html}{\out{
}} + } } -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-format}{}}} -\subsection{Method \code{format()}}{ -Returns a formatted string representing this \code{FilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$format()}}{ + Returns a formatted string representing this \code{FilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$format(show_all = FALSE, trim_lines = TRUE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} + \item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + The formatted character string. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{show_all}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} - -\item{\code{trim_lines}}{(\code{logical(1)}) passed to \code{format.teal_slice}.} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -The formatted character string. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-print}{}}} -\subsection{Method \code{print()}}{ -Prints this \code{FilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$print(...)}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$print()}}{ + Prints this \code{FilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$print(...)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{...}}{additional arguments passed to \code{format}.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{...}}{additional arguments passed to \code{format}.} -} -\if{html}{\out{
}} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-clear_filter_states}{}}} -\subsection{Method \code{clear_filter_states()}}{ -Removes all filter items applied to this dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$clear_filter_states(force = FALSE)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{force}}{(\code{logical(1)}) +\subsection{\code{FilteredDataset$clear_filter_states()}}{ + Removes all filter items applied to this dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$clear_filter_states(force = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{force}}{(\code{logical(1)}) flag specifying whether to include anchored filter states.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Gets a filter expression. +\subsection{\code{FilteredDataset$get_call()}}{ + Gets a filter expression. This function returns filter calls equivalent to selected items within each of \code{filter_states}. Configuration of the calls is constant and depends on \code{filter_states} type and order which are set during initialization. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$get_call(sid = "")}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{sid}}{(\code{character}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$get_call(sid = "")} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{sid}}{(\code{character}) when specified, the method returns code containing conditions calls of \code{FilterState} objects with \code{sid} different to this \code{sid} argument.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Either a \code{list} of filter \code{call}s, or \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Either a \code{list} of filter \code{call}s, or \code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-get_filter_state}{}}} -\subsection{Method \code{get_filter_state()}}{ -Gets states of all contained \code{FilterState} objects. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$get_filter_state()}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$get_filter_state()}}{ + Gets states of all contained \code{FilterState} objects. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$get_filter_state()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{teal_slices} object. + } } -\subsection{Returns}{ -A \code{teal_slices} object. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -Set filter state. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$set_filter_state(state)}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$set_filter_state()}}{ + Set filter state. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$set_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Virtual method, returns nothing and raises error. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -Virtual method, returns nothing and raises error. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-get_dataname}{}}} -\subsection{Method \code{get_dataname()}}{ -Gets the name of the dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$get_dataname()}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$get_dataname()}}{ + Gets the name of the dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$get_dataname()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A character string. + } } -\subsection{Returns}{ -A character string. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-get_dataset}{}}} -\subsection{Method \code{get_dataset()}}{ -Gets the dataset object in this \code{FilteredDataset}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$get_dataset(filtered = FALSE)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{filtered}}{(\code{logical(1)})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -The stored dataset. If \code{data.frame} or \code{MultiAssayExperiment}, +\subsection{\code{FilteredDataset$get_dataset()}}{ + Gets the dataset object in this \code{FilteredDataset}. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$get_dataset(filtered = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{filtered}}{(\code{logical(1)})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + The stored dataset. If \code{data.frame} or \code{MultiAssayExperiment}, either raw or as a reactive with current filters applied (depending on \code{filtered}). + } } -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-get_filter_overview}{}}} -\subsection{Method \code{get_filter_overview()}}{ -Get filter overview of a dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$get_filter_overview()}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$get_filter_overview()}}{ + Get filter overview of a dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$get_filter_overview()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + Virtual method, returns nothing and raises an error. + } } -\subsection{Returns}{ -Virtual method, returns nothing and raises an error. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-get_keys}{}}} -\subsection{Method \code{get_keys()}}{ -Gets the key columns for this dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$get_keys()}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$get_keys()}}{ + Gets the key columns for this dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$get_keys()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + Character vector of variable names + } } -\subsection{Returns}{ -Character vector of variable names -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-get_dataset_label}{}}} -\subsection{Method \code{get_dataset_label()}}{ -Gets the dataset label. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$get_dataset_label()}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$get_dataset_label()}}{ + Gets the dataset label. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$get_dataset_label()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + Character string. + } } -\subsection{Returns}{ -Character string. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-ui_active}{}}} -\subsection{Method \code{ui_active()}}{ -\code{shiny} module containing active filters for a dataset, along with a title and a remove button. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$ui_active(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilteredDataset$ui_active()}}{ + \code{shiny} module containing active filters for a dataset, along with a title and a remove button. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$ui_active(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-srv_active}{}}} -\subsection{Method \code{srv_active()}}{ -Server module for a dataset active filters. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$srv_active(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilteredDataset$srv_active()}}{ + Server module for a dataset active filters. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$srv_active(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-ui_add}{}}} -\subsection{Method \code{ui_add()}}{ -UI module to add filter variable for this dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$ui_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{FilteredDataset$ui_add()}}{ + UI module to add filter variable for this dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$ui_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Virtual method, returns nothing and raises error. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Virtual method, returns nothing and raises error. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-srv_add}{}}} -\subsection{Method \code{srv_add()}}{ -Server module to add filter variable for this dataset. +\subsection{\code{FilteredDataset$srv_add()}}{ + Server module to add filter variable for this dataset. For this class \code{srv_add} calls multiple modules of the same name from \code{FilterStates} as \code{MAEFilteredDataset} contains one \code{FilterStates} object for \code{colData} and one for each experiment. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$srv_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$srv_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-FilteredDataset-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{FilteredDataset$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{FilteredDataset$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{FilteredDataset$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/LogicalFilterState.Rd b/man/LogicalFilterState.Rd index fff5d41d9..1f58c89c1 100644 --- a/man/LogicalFilterState.Rd +++ b/man/LogicalFilterState.Rd @@ -96,112 +96,113 @@ if (interactive()) { } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterState]{teal.slice::FilterState}} -> \code{LogicalFilterState} +\code{\link[teal.slice:FilterState]{FilterState}} -> \code{LogicalFilterState} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-LogicalFilterState-new}{\code{LogicalFilterState$new()}} -\item \href{#method-LogicalFilterState-get_call}{\code{LogicalFilterState$get_call()}} -\item \href{#method-LogicalFilterState-clone}{\code{LogicalFilterState$clone()}} -} + \itemize{ + \item \href{#method-LogicalFilterState-initialize}{\code{LogicalFilterState$new()}} + \item \href{#method-LogicalFilterState-get_call}{\code{LogicalFilterState$get_call()}} + \item \href{#method-LogicalFilterState-clone}{\code{LogicalFilterState$clone()}} + } } -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-LogicalFilterState-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterState} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{LogicalFilterState$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-LogicalFilterState-initialize}{}}} +\subsection{\code{LogicalFilterState$new()}}{ + Initialize a \code{FilterState} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{LogicalFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{logical}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{logical}) variable to be filtered.} - -\item{\code{x_reactive}}{(\code{reactive}) + \item{\code{x_reactive}}{(\code{reactive}) returning vector of the same type as \code{x}. Is used to update counts following the change in values of the filtered dataset. If it is set to \code{reactive(NULL)} then counts based on filtered dataset are not shown.} - -\item{\code{extract_type}}{(\code{character}) + \item{\code{extract_type}}{(\code{character}) specifying whether condition calls should be prefixed by \code{dataname}. Possible values: \itemize{ \item \code{character(0)} (default) \code{varname} in the condition call will not be prefixed \item \code{"list"} \code{varname} in the condition call will be returned as \verb{$} \item \code{"matrix"} \code{varname} in the condition call will be returned as \verb{[, ]} }} - -\item{\code{slice}}{(\code{teal_slice}) + \item{\code{slice}}{(\code{teal_slice}) specification of this filter state. \code{teal_slice} is stored in the object and \code{set_state} directly manipulates values within \code{teal_slice}. \code{get_state} returns \code{teal_slice} object which can be reused in other places. Note that \code{teal_slice} is a \code{reactiveValues}, which means it has reference semantics, i.e. changes made to an object are automatically reflected in all places that refer to the same \code{teal_slice}.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{LogicalFilterState}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{LogicalFilterState}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-LogicalFilterState-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Returns reproducible condition call for current selection. +\subsection{\code{LogicalFilterState$get_call()}}{ + Returns reproducible condition call for current selection. For \code{LogicalFilterState} it's a \verb{!} or \verb{} and optionally \verb{is.na()} -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{LogicalFilterState$get_call(dataname)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{LogicalFilterState$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{call} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{call} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-LogicalFilterState-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{LogicalFilterState$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{LogicalFilterState$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{LogicalFilterState$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/MAEFilterStates.Rd b/man/MAEFilterStates.Rd index 3f17874fc..ae66f07f5 100644 --- a/man/MAEFilterStates.Rd +++ b/man/MAEFilterStates.Rd @@ -9,91 +9,88 @@ Handles filter states in a \code{MultiAssayExperiment}. } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterStates]{teal.slice::FilterStates}} -> \code{MAEFilterStates} +\code{\link[teal.slice:FilterStates]{FilterStates}} -> \code{MAEFilterStates} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-MAEFilterStates-new}{\code{MAEFilterStates$new()}} -\item \href{#method-MAEFilterStates-clone}{\code{MAEFilterStates$clone()}} + \itemize{ + \item \href{#method-MAEFilterStates-initialize}{\code{MAEFilterStates$new()}} + \item \href{#method-MAEFilterStates-clone}{\code{MAEFilterStates$clone()}} + } } -} -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-MAEFilterStates-new}{}}} -\subsection{Method \code{new()}}{ -Initialize \code{MAEFilterStates} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilterStates$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-MAEFilterStates-initialize}{}}} +\subsection{\code{MAEFilterStates$new()}}{ + Initialize \code{MAEFilterStates} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilterStates$new( data, data_reactive = function(sid = "") NULL, dataname, datalabel = "subjects", keys = character(0) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{data}}{(\code{MultiAssayExperiment}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{data}}{(\code{MultiAssayExperiment}) the \code{R} object which \code{MultiAssayExperiment::subsetByColData} function is applied on.} - -\item{\code{data_reactive}}{(\verb{function(sid)}) + \item{\code{data_reactive}}{(\verb{function(sid)}) should return a \code{MultiAssayExperiment} object or \code{NULL}. This object is needed for the \code{FilterState} counts being updated on a change in filters. If function returns \code{NULL} then filtered counts are not shown. Function has to have \code{sid} argument being a character.} - -\item{\code{dataname}}{(\code{character(1)}) + \item{\code{dataname}}{(\code{character(1)}) name of the data used in the subset expression. Passed to the function argument attached to this \code{FilterStates}.} - -\item{\code{datalabel}}{(\code{character(1)}) optional + \item{\code{datalabel}}{(\code{character(1)}) optional text label.} - -\item{\code{keys}}{(\code{character}) + \item{\code{keys}}{(\code{character}) key column names.} - -\item{\code{varlabels}}{(\code{character}) + \item{\code{varlabels}}{(\code{character}) labels of the variables used in this object.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-MAEFilterStates-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilterStates$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{MAEFilterStates$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilterStates$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/MAEFilteredDataset.Rd b/man/MAEFilteredDataset.Rd index c746b0c4a..45955696f 100644 --- a/man/MAEFilteredDataset.Rd +++ b/man/MAEFilteredDataset.Rd @@ -5,8 +5,6 @@ \alias{MAEFilteredDataset} \title{\code{MAEFilteredDataset} \code{R6} class} \description{ -\code{MAEFilteredDataset} \code{R6} class - \code{MAEFilteredDataset} \code{R6} class } \examples{ @@ -38,165 +36,172 @@ isolate(dataset$get_filter_state()) } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilteredDataset]{teal.slice::FilteredDataset}} -> \code{MAEFilteredDataset} +\code{\link[teal.slice:FilteredDataset]{FilteredDataset}} -> \code{MAEFilteredDataset} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-MAEFilteredDataset-new}{\code{MAEFilteredDataset$new()}} -\item \href{#method-MAEFilteredDataset-set_filter_state}{\code{MAEFilteredDataset$set_filter_state()}} -\item \href{#method-MAEFilteredDataset-remove_filter_state}{\code{MAEFilteredDataset$remove_filter_state()}} -\item \href{#method-MAEFilteredDataset-ui_add}{\code{MAEFilteredDataset$ui_add()}} -\item \href{#method-MAEFilteredDataset-get_filter_overview}{\code{MAEFilteredDataset$get_filter_overview()}} -\item \href{#method-MAEFilteredDataset-clone}{\code{MAEFilteredDataset$clone()}} -} -} -\if{html}{\out{ -
Inherited methods + \itemize{ + \item \href{#method-MAEFilteredDataset-initialize}{\code{MAEFilteredDataset$new()}} + \item \href{#method-MAEFilteredDataset-set_filter_state}{\code{MAEFilteredDataset$set_filter_state()}} + \item \href{#method-MAEFilteredDataset-remove_filter_state}{\code{MAEFilteredDataset$remove_filter_state()}} + \item \href{#method-MAEFilteredDataset-ui_add}{\code{MAEFilteredDataset$ui_add()}} + \item \href{#method-MAEFilteredDataset-get_filter_overview}{\code{MAEFilteredDataset$get_filter_overview()}} + \item \href{#method-MAEFilteredDataset-clone}{\code{MAEFilteredDataset$clone()}} + } +} +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-MAEFilteredDataset-new}{}}} -\subsection{Method \code{new()}}{ -Initialize \code{MAEFilteredDataset} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilteredDataset$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-MAEFilteredDataset-initialize}{}}} +\subsection{\code{MAEFilteredDataset$new()}}{ + Initialize \code{MAEFilteredDataset} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilteredDataset$new( dataset, dataname, keys = character(0), label = character(0) -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataset}}{(\code{MulitiAssayExperiment}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataset}}{(\code{MulitiAssayExperiment}) single \code{MulitiAssayExperiment} for which filters are rendered.} - -\item{\code{dataname}}{(\code{character(1)}) + \item{\code{dataname}}{(\code{character(1)}) syntactically valid name given to the dataset.} - -\item{\code{keys}}{(\code{character}) optional + \item{\code{keys}}{(\code{character}) optional vector of primary key column names.} - -\item{\code{label}}{(\code{character(1)}) + \item{\code{label}}{(\code{character(1)}) label to describe the dataset.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{MAEFilteredDataset}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{MAEFilteredDataset}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-MAEFilteredDataset-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -Set filter state. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilteredDataset$set_filter_state(state)}\if{html}{\out{
}} +\subsection{\code{MAEFilteredDataset$set_filter_state()}}{ + Set filter state. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilteredDataset$set_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices})} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices})} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-MAEFilteredDataset-remove_filter_state}{}}} -\subsection{Method \code{remove_filter_state()}}{ -Remove one or more \code{FilterState} of a \code{MAEFilteredDataset}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilteredDataset$remove_filter_state(state)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices}) +\subsection{\code{MAEFilteredDataset$remove_filter_state()}}{ + Remove one or more \code{FilterState} of a \code{MAEFilteredDataset}. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilteredDataset$remove_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices}) specifying \code{FilterState} objects to remove; \code{teal_slice}s may contain only \code{dataname} and \code{varname}, other elements are ignored.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-MAEFilteredDataset-ui_add}{}}} -\subsection{Method \code{ui_add()}}{ -UI module to add filter variable for this dataset. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilteredDataset$ui_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{MAEFilteredDataset$ui_add()}}{ + UI module to add filter variable for this dataset. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilteredDataset$ui_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-MAEFilteredDataset-get_filter_overview}{}}} -\subsection{Method \code{get_filter_overview()}}{ -Creates row for filter overview in the form of \cr +\subsection{\code{MAEFilteredDataset$get_filter_overview()}}{ + Creates row for filter overview in the form of \cr \code{dataname -- observations (remaining/total) -- subjects (remaining/total)} - MAE -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilteredDataset$get_filter_overview()}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilteredDataset$get_filter_overview()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + A \code{data.frame}. + } } -\subsection{Returns}{ -A \code{data.frame}. -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-MAEFilteredDataset-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MAEFilteredDataset$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{MAEFilteredDataset$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MAEFilteredDataset$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/MatrixFilterStates.Rd b/man/MatrixFilterStates.Rd index 0806099d0..ce0e0fd51 100644 --- a/man/MatrixFilterStates.Rd +++ b/man/MatrixFilterStates.Rd @@ -9,84 +9,83 @@ Handles filter states in a \code{matrix}. } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterStates]{teal.slice::FilterStates}} -> \code{MatrixFilterStates} +\code{\link[teal.slice:FilterStates]{FilterStates}} -> \code{MatrixFilterStates} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-MatrixFilterStates-new}{\code{MatrixFilterStates$new()}} -\item \href{#method-MatrixFilterStates-clone}{\code{MatrixFilterStates$clone()}} + \itemize{ + \item \href{#method-MatrixFilterStates-initialize}{\code{MatrixFilterStates$new()}} + \item \href{#method-MatrixFilterStates-clone}{\code{MatrixFilterStates$clone()}} + } } -} -\if{html}{\out{ -
Inherited methods +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-MatrixFilterStates-new}{}}} -\subsection{Method \code{new()}}{ -Initialize \code{MatrixFilterStates} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MatrixFilterStates$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-MatrixFilterStates-initialize}{}}} +\subsection{\code{MatrixFilterStates$new()}}{ + Initialize \code{MatrixFilterStates} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MatrixFilterStates$new( data, data_reactive = function(sid = "") NULL, dataname, datalabel = NULL -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{data}}{(\code{matrix}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{data}}{(\code{matrix}) the \code{R} object which \code{subset} function is applied on.} - -\item{\code{data_reactive}}{(\verb{function(sid)}) + \item{\code{data_reactive}}{(\verb{function(sid)}) should return a \code{matrix} object or \code{NULL}. This object is needed for the \code{FilterState} counts being updated on a change in filters. If function returns \code{NULL} then filtered counts are not shown. Function has to have \code{sid} argument being a character.} - -\item{\code{dataname}}{(\code{character(1)}) + \item{\code{dataname}}{(\code{character(1)}) name of the data used in the subset expression. Passed to the function argument attached to this \code{FilterStates}.} - -\item{\code{datalabel}}{(\code{character(1)}) optional + \item{\code{datalabel}}{(\code{character(1)}) optional text label. Should be a name of experiment.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-MatrixFilterStates-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{MatrixFilterStates$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{MatrixFilterStates$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{MatrixFilterStates$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/RangeFilterState.Rd b/man/RangeFilterState.Rd index 8050d45b4..1d3e9b786 100644 --- a/man/RangeFilterState.Rd +++ b/man/RangeFilterState.Rd @@ -124,128 +124,131 @@ if (interactive()) { } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterState]{teal.slice::FilterState}} -> \code{RangeFilterState} +\code{\link[teal.slice:FilterState]{FilterState}} -> \code{RangeFilterState} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-RangeFilterState-new}{\code{RangeFilterState$new()}} -\item \href{#method-RangeFilterState-get_call}{\code{RangeFilterState$get_call()}} -\item \href{#method-RangeFilterState-get_keep_inf}{\code{RangeFilterState$get_keep_inf()}} -\item \href{#method-RangeFilterState-clone}{\code{RangeFilterState$clone()}} -} -} -\if{html}{\out{ -
Inherited methods + \itemize{ + \item \href{#method-RangeFilterState-initialize}{\code{RangeFilterState$new()}} + \item \href{#method-RangeFilterState-get_call}{\code{RangeFilterState$get_call()}} + \item \href{#method-RangeFilterState-get_keep_inf}{\code{RangeFilterState$get_keep_inf()}} + \item \href{#method-RangeFilterState-clone}{\code{RangeFilterState$clone()}} + } +} +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-RangeFilterState-new}{}}} -\subsection{Method \code{new()}}{ -Initialize a \code{FilterState} object for range selection. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{RangeFilterState$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-RangeFilterState-initialize}{}}} +\subsection{\code{RangeFilterState$new()}}{ + Initialize a \code{FilterState} object for range selection. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{RangeFilterState$new( x, x_reactive = reactive(NULL), extract_type = character(0), slice -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{x}}{(\code{numeric}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{x}}{(\code{numeric}) variable to be filtered.} - -\item{\code{x_reactive}}{(\code{reactive}) + \item{\code{x_reactive}}{(\code{reactive}) returning vector of the same type as \code{x}. Is used to update counts following the change in values of the filtered dataset. If it is set to \code{reactive(NULL)} then counts based on filtered dataset are not shown.} - -\item{\code{extract_type}}{(\code{character}) + \item{\code{extract_type}}{(\code{character}) specifying whether condition calls should be prefixed by \code{dataname}. Possible values: \itemize{ \item \code{character(0)} (default) \code{varname} in the condition call will not be prefixed \item \code{"list"} \code{varname} in the condition call will be returned as \verb{$} \item \code{"matrix"} \code{varname} in the condition call will be returned as \verb{[, ]} }} - -\item{\code{slice}}{(\code{teal_slice}) + \item{\code{slice}}{(\code{teal_slice}) specification of this filter state. \code{teal_slice} is stored in the object and \code{set_state} directly manipulates values within \code{teal_slice}. \code{get_state} returns \code{teal_slice} object which can be reused in other places. Note that \code{teal_slice} is a \code{reactiveValues}, which means it has reference semantics, i.e. changes made to an object are automatically reflected in all places that refer to the same \code{teal_slice}.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + Object of class \code{RangeFilterState}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -Object of class \code{RangeFilterState}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-RangeFilterState-get_call}{}}} -\subsection{Method \code{get_call()}}{ -Returns reproducible condition call for current selection. +\subsection{\code{RangeFilterState$get_call()}}{ + Returns reproducible condition call for current selection. For this class returned call looks like \verb{ >= & <= } with optional \verb{is.na()} and \verb{is.finite()}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{RangeFilterState$get_call(dataname)}\if{html}{\out{
}} + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{RangeFilterState$get_call(dataname)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{call} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{dataname}}{name of data set; defaults to \code{private$get_dataname()}} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{call} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-RangeFilterState-get_keep_inf}{}}} -\subsection{Method \code{get_keep_inf()}}{ -Returns current \code{keep_inf} selection. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{RangeFilterState$get_keep_inf()}\if{html}{\out{
}} +\subsection{\code{RangeFilterState$get_keep_inf()}}{ + Returns current \code{keep_inf} selection. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{RangeFilterState$get_keep_inf()} + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{logical(1)} + } } -\subsection{Returns}{ -\code{logical(1)} -} -} \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-RangeFilterState-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{RangeFilterState$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{RangeFilterState$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{RangeFilterState$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/SEFilterStates.Rd b/man/SEFilterStates.Rd index 46a0e7e81..1a98ae577 100644 --- a/man/SEFilterStates.Rd +++ b/man/SEFilterStates.Rd @@ -9,116 +9,117 @@ Handles filter states in a \code{SummaryExperiment}. } \keyword{internal} \section{Super class}{ -\code{\link[teal.slice:FilterStates]{teal.slice::FilterStates}} -> \code{SEFilterStates} +\code{\link[teal.slice:FilterStates]{FilterStates}} -> \code{SEFilterStates} } \section{Methods}{ \subsection{Public methods}{ -\itemize{ -\item \href{#method-SEFilterStates-new}{\code{SEFilterStates$new()}} -\item \href{#method-SEFilterStates-set_filter_state}{\code{SEFilterStates$set_filter_state()}} -\item \href{#method-SEFilterStates-ui_add}{\code{SEFilterStates$ui_add()}} -\item \href{#method-SEFilterStates-srv_add}{\code{SEFilterStates$srv_add()}} -\item \href{#method-SEFilterStates-clone}{\code{SEFilterStates$clone()}} -} -} -\if{html}{\out{ -
Inherited methods + \itemize{ + \item \href{#method-SEFilterStates-initialize}{\code{SEFilterStates$new()}} + \item \href{#method-SEFilterStates-set_filter_state}{\code{SEFilterStates$set_filter_state()}} + \item \href{#method-SEFilterStates-ui_add}{\code{SEFilterStates$ui_add()}} + \item \href{#method-SEFilterStates-srv_add}{\code{SEFilterStates$srv_add()}} + \item \href{#method-SEFilterStates-clone}{\code{SEFilterStates$clone()}} + } +} +\if{html}{\out{
Inherited methods -
-}} +
}} \if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-SEFilterStates-new}{}}} -\subsection{Method \code{new()}}{ -Initialize \code{SEFilterStates} object. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{SEFilterStates$new( +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-SEFilterStates-initialize}{}}} +\subsection{\code{SEFilterStates$new()}}{ + Initialize \code{SEFilterStates} object. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{SEFilterStates$new( data, data_reactive = function(sid = "") NULL, dataname, datalabel = NULL -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{data}}{(\code{SummarizedExperiment}) +)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{data}}{(\code{SummarizedExperiment}) the \code{R} object which \code{subset} function is applied on.} - -\item{\code{data_reactive}}{(\verb{function(sid)}) + \item{\code{data_reactive}}{(\verb{function(sid)}) should return a \code{SummarizedExperiment} object or \code{NULL}. This object is needed for the \code{FilterState} counts being updated on a change in filters. If function returns \code{NULL} then filtered counts are not shown. Function has to have \code{sid} argument being a character.} - -\item{\code{dataname}}{(\code{character(1)}) + \item{\code{dataname}}{(\code{character(1)}) name of the data used in the expression specified to the function argument attached to this \code{FilterStates}.} - -\item{\code{datalabel}}{(\code{character(1)}) optional + \item{\code{datalabel}}{(\code{character(1)}) optional text label. Should be the name of experiment.} + } + \if{html}{\out{
}} + } } -\if{html}{\out{
}} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-SEFilterStates-set_filter_state}{}}} -\subsection{Method \code{set_filter_state()}}{ -Set filter state. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{SEFilterStates$set_filter_state(state)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{state}}{(\code{teal_slices}) +\subsection{\code{SEFilterStates$set_filter_state()}}{ + Set filter state. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{SEFilterStates$set_filter_state(state)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{state}}{(\code{teal_slices}) \code{teal_slice} objects should contain the field \code{arg \%in\% c("subset", "select")}} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL}, invisibly. + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL}, invisibly. -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-SEFilterStates-ui_add}{}}} -\subsection{Method \code{ui_add()}}{ -\code{shiny} UI module to add filter variable. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{SEFilterStates$ui_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) +\subsection{\code{SEFilterStates$ui_add()}}{ + \code{shiny} UI module to add filter variable. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{SEFilterStates$ui_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{shiny.tag} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{shiny.tag} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-SEFilterStates-srv_add}{}}} -\subsection{Method \code{srv_add()}}{ -\code{shiny} server module to add filter variable. +\subsection{\code{SEFilterStates$srv_add()}}{ + \code{shiny} server module to add filter variable. Module controls available choices to select as a filter variable. Selected filter variable is being removed from available choices. @@ -126,37 +127,41 @@ Removed filter variable gets back to available choices. This module unlike other \code{FilterStates} classes manages two sets of filter variables - one for \code{colData} and another for \code{rowData}. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{SEFilterStates$srv_add(id)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{id}}{(\code{character(1)}) + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{SEFilterStates$srv_add(id)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{id}}{(\code{character(1)}) \code{shiny} module instance id.} + } + \if{html}{\out{
}} + } + \subsection{Returns}{ + \code{NULL} + } } -\if{html}{\out{
}} -} -\subsection{Returns}{ -\code{NULL} -} -} + \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-SEFilterStates-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{SEFilterStates$clone(deep = FALSE)}\if{html}{\out{
}} +\subsection{\code{SEFilterStates$clone()}}{ + The objects of this class are cloneable with this method. + \subsection{Usage}{ + \if{html}{\out{
}} + \preformatted{SEFilterStates$clone(deep = FALSE)} + \if{html}{\out{
}} + } + \subsection{Arguments}{ + \if{html}{\out{
}} + \describe{ + \item{\code{deep}}{Whether to make a deep clone.} + } + \if{html}{\out{
}} + } } -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} } diff --git a/man/teal.slice-package.Rd b/man/teal.slice-package.Rd index 67b537a67..e949c4037 100644 --- a/man/teal.slice-package.Rd +++ b/man/teal.slice-package.Rd @@ -22,6 +22,7 @@ Useful links: Authors: \itemize{ + \item Dawid Kaledkowski \email{dawid.kaledkowski@roche.com} (\href{https://orcid.org/0000-0001-9533-457X}{ORCID}) \item Pawel Rucki \email{pawel.rucki@roche.com} \item Aleksander Chlebowski \email{aleksander.chlebowski@contractors.roche.com} (\href{https://orcid.org/0000-0001-5018-6294}{ORCID}) \item Andre Verissimo \email{andre.verissimo@roche.com} (\href{https://orcid.org/0000-0002-2212-339X}{ORCID}) diff --git a/tests/testthat/test-DatetimeFilterState.R b/tests/testthat/test-DatetimeFilterState.R index 201352099..36be34248 100644 --- a/tests/testthat/test-DatetimeFilterState.R +++ b/tests/testthat/test-DatetimeFilterState.R @@ -284,6 +284,165 @@ testthat::test_that("format returns a properly formatted string representation", ) }) +# content_summary ---- +testthat::test_that("content_summary shows datetime range in summary-value span", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "summary-value\">2000-01-01 12:00:00") + testthat::expect_match(summary_html, "–") + testthat::expect_match(summary_html, "2000-01-01 12:00:09") +}) + +testthat::test_that("content_summary shows NA check icon when keep_na is TRUE and NA values exist", { + filter_state <- DatetimeFilterState$new( + c(posixct, NA), + slice = teal_slice(dataname = "data", varname = "variable", keep_na = TRUE) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "fa-check") + testthat::expect_match(summary_html, "text-success") +}) + +testthat::test_that("content_summary shows NA xmark icon when keep_na is FALSE and NA values exist", { + filter_state <- DatetimeFilterState$new( + c(posixct, NA), + slice = teal_slice( + dataname = "data", varname = "variable", keep_na = FALSE + ) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "fa-xmark") + testthat::expect_match(summary_html, "text-danger") +}) + +testthat::test_that("content_summary shows NA check icon when keep_na is NULL", { # nolint: line_length. + filter_state <- DatetimeFilterState$new( + c(posixct, NA), + slice = teal_slice(dataname = "data", varname = "variable") + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "fa-check") + testthat::expect_match(summary_html, "text-success") +}) + +testthat::test_that("content_summary omits NA span when data has no NA values", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "filter-card-summary-controls") + testthat::expect_no_match(summary_html, "fa-check") + testthat::expect_no_match(summary_html, "fa-xmark") +}) + +# ui_inputs ---- +testthat::test_that("ui_inputs renders start and end datetime pickers", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, 'id="test-selection_start"', fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-selection_end"', fixed = TRUE) +}) + +testthat::test_that("ui_inputs renders start and end reset buttons", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, 'id="test-start_date_reset"', fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-end_date_reset"', fixed = TRUE) +}) + +testthat::test_that("ui_inputs renders a 'to' separator between the two pickers", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "selection_start.*>to<.*selection_end") +}) + +testthat::test_that("ui_inputs renders the timepicker flag in the picker config", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, '"timepicker":true', fixed = TRUE) +}) + +testthat::test_that("ui_inputs applies input-sm class to both pickers", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match( + ui_html, + "selection_start.*input-sm.*selection_end.*input-sm" + ) +}) + +testthat::test_that("ui_inputs renders the filter_datelike_input layout wrapper", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "filter_datelike_input", fixed = TRUE) +}) + +testthat::test_that("ui_inputs renders keep NA checkbox when NA values exist", { + filter_state <- DatetimeFilterState$new( + c(posixct, NA), + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "Keep NA") +}) + +testthat::test_that("ui_inputs does not render keep NA checkbox when no NA values exist", { + filter_state <- DatetimeFilterState$new( + posixct, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_no_match(ui_html, "Keep NA") +}) + # print --- testthat::test_that("print returns a properly formatted string representation", { diff --git a/tests/testthat/test-DefaultFilteredDataset.R b/tests/testthat/test-DefaultFilteredDataset.R index 8c53b6776..4daf97579 100644 --- a/tests/testthat/test-DefaultFilteredDataset.R +++ b/tests/testthat/test-DefaultFilteredDataset.R @@ -58,6 +58,20 @@ testthat::test_that("clear_filter_state returns NULL", { fds <- DefaultFilteredDataset$new(letters, "character") testthat::expect_null(fds$clear_filter_states()) }) +# ui_active ---- +testthat::test_that("ui_active returns an empty div", { + fds <- DefaultFilteredDataset$new(letters, "character") + ui_html <- as.character(shiny::isolate(fds$ui_active("test"))) + testthat::expect_identical(ui_html, "
") +}) + +# ui_add ---- +testthat::test_that("ui_add returns an empty div", { + fds <- DefaultFilteredDataset$new(letters, "character") + ui_html <- as.character(shiny::isolate(fds$ui_add("test"))) + testthat::expect_identical(ui_html, "
") +}) + # get_filter_overview ---- testthat::test_that("get_filter_overview returns NULL", { fds <- DefaultFilteredDataset$new(letters, "character") diff --git a/tests/testthat/test-EmptyFilterState.R b/tests/testthat/test-EmptyFilterState.R index b512ce46e..8d4583233 100644 --- a/tests/testthat/test-EmptyFilterState.R +++ b/tests/testthat/test-EmptyFilterState.R @@ -1,3 +1,60 @@ +# ui_inputs ---- +testthat::test_that("EmptyFilterState ui_inputs renders 'Variable contains missing values only' span", { + filter_state <- EmptyFilterState$new( + NA, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "Variable contains missing values only", fixed = TRUE) +}) + +testthat::test_that("EmptyFilterState ui_inputs renders Keep NA checkbox when NA values exist", { + filter_state <- EmptyFilterState$new( + NA, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "Keep NA", fixed = TRUE) +}) + +testthat::test_that("EmptyFilterState ui_inputs renders namespaced keep_na checkbox input", { + filter_state <- EmptyFilterState$new( + NA, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, 'id="test-keep_na-value"', fixed = TRUE) +}) + +# content_summary ---- +testthat::test_that("content_summary returns a span with 'All empty' text", { + filter_state <- EmptyFilterState$new( + NA, + slice = teal_slice(dataname = "data", varname = "variable") + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "All empty", fixed = TRUE) +}) + +# cache_state ---- +testthat::test_that("cache_state raises an error if private$get_state() does not exist", { + filter_state <- EmptyFilterState$new( + NA, + slice = teal_slice(dataname = "data", varname = "variable", keep_na = FALSE) + ) + testthat::expect_error( + shiny::isolate(filter_state$.__enclos_env__$private$cache_state()) + ) +}) + # get_call ---- testthat::test_that("get_call of default EmptyFilterState returns NULL by default", { filter_state <- EmptyFilterState$new(NA, slice = teal_slice(dataname = "data", varname = "variable")) diff --git a/tests/testthat/test-FilteredData-utils.R b/tests/testthat/test-FilteredData-utils.R new file mode 100644 index 000000000..0aaf53760 --- /dev/null +++ b/tests/testthat/test-FilteredData-utils.R @@ -0,0 +1,106 @@ +capture_runjs_output <- function(fn, ...) { + captured_js <- NULL + testthat::with_mocked_bindings( + runjs = function(js_expr) { + captured_js <<- js_expr + invisible(NULL) + }, + fn(...), + .package = "shinyjs" + ) + captured_js +} + +# eval_expr_with_msg ---- +testthat::describe("eval_expr_with_msg", { + testthat::it("returns NULL invisibly on successful evaluation", { + test_env <- new.env() + assign_expr <- list(quote(result_value <- 1)) + testthat::expect_invisible(teal.slice:::eval_expr_with_msg(assign_expr, test_env)) + testthat::expect_null(teal.slice:::eval_expr_with_msg(assign_expr, test_env)) + }) + + testthat::it("evaluates expression into the provided environment", { + test_env <- new.env() + teal.slice:::eval_expr_with_msg(list(quote(assigned_value <- 42L)), test_env) + testthat::expect_identical(test_env$assigned_value, 42L) + }) + + testthat::it("error message includes the call header, deparsed call, and original error", { + test_env <- new.env() + failing_call <- quote(stop("something went wrong")) + error_msg <- tryCatch( + teal.slice:::eval_expr_with_msg(list(failing_call), test_env), + error = function(e) conditionMessage(e) + ) + testthat::expect_match(error_msg, "Filter call execution failed") + testthat::expect_match(error_msg, "stop\\(\"something went wrong\"\\)") + testthat::expect_match(error_msg, "something went wrong") + }) +}) + +# toggle_icon (two-way branch) ---- +testthat::describe("toggle_icon two-way JS expression", { + testthat::it("produces JS targeting the child of the button", { + generated_js <- capture_runjs_output( + teal.slice:::toggle_icon, "panel_toggle", c("fa-angle-down", "fa-angle-right") + ) + testthat::expect_match(generated_js, "#panel_toggle i", fixed = TRUE) + }) + + testthat::it("calls toggleClass with both icon classes space-separated", { + generated_js <- capture_runjs_output( + teal.slice:::toggle_icon, "panel_toggle", c("fa-angle-down", "fa-angle-right") + ) + testthat::expect_match( + generated_js, + "$('#panel_toggle i').toggleClass('fa-angle-down fa-angle-right');", + fixed = TRUE + ) + }) + + testthat::it("interpolates button_id and both icon classes correctly", { + generated_js <- capture_runjs_output( + teal.slice:::toggle_icon, "filter_btn", c("fa-eye", "fa-eye-slash") + ) + testthat::expect_match(generated_js, "#filter_btn", fixed = TRUE) + testthat::expect_match(generated_js, "fa-eye fa-eye-slash", fixed = TRUE) + }) +}) + +# toggle_title (two-way branch) ---- +testthat::describe("toggle_title two-way JS expression", { + testthat::it("produces JS that stores the button id as a variable", { + generated_js <- capture_runjs_output( + teal.slice:::toggle_title, "panel_toggle", c("Show panel", "Hide panel") + ) + testthat::expect_match(generated_js, "var button_id = 'a#panel_toggle'", fixed = TRUE) + }) + + testthat::it("reads the current title into a variable", { + generated_js <- capture_runjs_output( + teal.slice:::toggle_title, "panel_toggle", c("Show panel", "Hide panel") + ) + testthat::expect_match(generated_js, "var curr = $(button_id).attr('title')", fixed = TRUE) + }) + + testthat::it("sets title to titles[2] when current title matches titles[1]", { + generated_js <- capture_runjs_output( + teal.slice:::toggle_title, "panel_toggle", c("Show panel", "Hide panel") + ) + testthat::expect_match( + generated_js, + "if (curr == 'Show panel') { $(button_id).attr('title', 'Hide panel');", + fixed = TRUE + ) + }) + + testthat::it("interpolates button_id, titles[1], and titles[2] correctly", { + generated_js <- capture_runjs_output( + teal.slice:::toggle_title, "filter_btn", c("Open filters", "Close filters") + ) + testthat::expect_match(generated_js, "a#filter_btn", fixed = TRUE) + testthat::expect_match(generated_js, "'Open filters'", fixed = TRUE) + testthat::expect_match(generated_js, "'Close filters'", fixed = TRUE) + }) +}) diff --git a/tests/testthat/test-FilteredData.R b/tests/testthat/test-FilteredData.R index daaffe161..d5716a279 100644 --- a/tests/testthat/test-FilteredData.R +++ b/tests/testthat/test-FilteredData.R @@ -1267,3 +1267,50 @@ testthat::describe("test FilterStateExpr server", { ) }) }) + +# ui_active ---- +testthat::test_that("ui_active returns an accordion panel with expected structure", { + filtered_data <- FilteredData$new(list(iris = iris)) + ui_html <- as.character( + shiny::isolate(filtered_data$ui_active("test")) + ) + testthat::expect_match(ui_html, "Filter Data", fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-filter_active_vars_contents"', fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-remove_all_filters_ui"', fixed = TRUE) + testthat::expect_match(ui_html, "filters_active_count.*display: none") +}) + +testthat::test_that("ui_active renders a dataset-level active filter panel for each dataname", { + filtered_data <- FilteredData$new(list(iris = iris, mtcars = mtcars)) + ui_html <- as.character( + shiny::isolate(filtered_data$ui_active("test", active_datanames = function() c("iris", "mtcars"))) + ) + testthat::expect_match(ui_html, 'id="test-iris-container"', fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-mtcars-container"', fixed = TRUE) +}) + +# ui_overview ---- +testthat::test_that("ui_overview returns an accordion panel with expected structure", { + filtered_data <- FilteredData$new(list(iris = iris)) + ui_html <- as.character( + shiny::isolate(filtered_data$ui_overview("test")) + ) + testthat::expect_match(ui_html, "Active Filter Summary", fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-main_filter_accordion"', fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-filters_overview_contents"', fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-table"', fixed = TRUE) +}) + +# ui_available_filters ---- +testthat::test_that("ui_available_filters renders the expected structural elements", { + filtered_data <- FilteredData$new(list(iris = iris)) + ui_html <- as.character( + shiny::isolate( + filtered_data$.__enclos_env__$private$ui_available_filters("test") + ) + ) + testthat::expect_match(ui_html, 'id="test-available_menu"', fixed = TRUE) + testthat::expect_match(ui_html, "bi-plus-square", fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-checkbox"', fixed = TRUE) + testthat::expect_match(ui_html, 'id="test-show".*available-menu') +}) diff --git a/tests/testthat/test-LogicalFilterState.R b/tests/testthat/test-LogicalFilterState.R index 17b158283..638428424 100644 --- a/tests/testthat/test-LogicalFilterState.R +++ b/tests/testthat/test-LogicalFilterState.R @@ -1,4 +1,5 @@ logs <- as.logical(c(1, 0, 0, 0, 1, 1, 0, 1, 0, 1, NA)) +logs_no_na <- as.logical(c(1, 0, 0, 0, 1, 1, 0, 1, 0, 1)) # initialize ---- testthat::test_that("constructor accepts logical values", { @@ -139,6 +140,103 @@ testthat::test_that("get_call adds is.na(variable) to returned call if keep_na i ) }) +# is_any_filtered ---- +testthat::test_that("is_any_filtered returns TRUE when both logical values exist in the data", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable", selected = TRUE, keep_na = TRUE) + ) + testthat::expect_true( + shiny::isolate(filter_state$.__enclos_env__$private$is_any_filtered()) + ) +}) + + +testthat::test_that("is_any_filtered returns FALSE when one value in data, selected, NA kept", { + filter_state <- LogicalFilterState$new( + c(TRUE, TRUE, TRUE, NA), + slice = teal_slice( + dataname = "data", varname = "variable", selected = TRUE, keep_na = TRUE + ) + ) + testthat::expect_false( + shiny::isolate(filter_state$.__enclos_env__$private$is_any_filtered()) + ) +}) + +testthat::test_that("is_any_filtered returns TRUE when keep_na is FALSE and NA values exist", { + filter_state <- LogicalFilterState$new( + c(TRUE, TRUE, TRUE, NA), + slice = teal_slice(dataname = "data", varname = "variable", selected = TRUE, keep_na = FALSE) + ) + testthat::expect_true( + shiny::isolate(filter_state$.__enclos_env__$private$is_any_filtered()) + ) +}) + + +# ui_inputs ---- +testthat::test_that("ui_inputs renders radioButtons when multiple is FALSE", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable", multiple = FALSE) + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "shiny-input-radiogroup") + testthat::expect_no_match(ui_html, "shiny-input-checkboxgroup") +}) + +testthat::test_that("ui_inputs renders the expected component when multiple is TRUE", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice( + dataname = "data", varname = "variable", + multiple = TRUE, selected = c(TRUE, FALSE) + ) + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "shiny-input-checkboxgroup") + testthat::expect_no_match(ui_html, "shiny-input-radiogroup") +}) + +testthat::test_that("ui_inputs renders TRUE and FALSE as choice labels", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, 'value="TRUE"', fixed = TRUE) + testthat::expect_match(ui_html, 'value="FALSE"', fixed = TRUE) +}) + +testthat::test_that("ui_inputs renders keep NA checkbox when NA values exist", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_match(ui_html, "Keep NA") +}) + +testthat::test_that("ui_inputs does not render keep NA checkbox when no NA values exist", { + filter_state <- LogicalFilterState$new( + logs_no_na, + slice = teal_slice(dataname = "data", varname = "variable") + ) + ui_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$ui_inputs("test")) + ) + testthat::expect_no_match(ui_html, "Keep NA") +}) + # format ---- testthat::test_that("format accepts logical show_all", { filter_state <- LogicalFilterState$new(logs, slice = teal_slice(dataname = "data", varname = "variable")) @@ -177,6 +275,94 @@ testthat::test_that("format returns a properly formatted string representation", ) }) +# content_summary ---- +testthat::test_that("content_summary shows selected value in summary-value span", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable", selected = TRUE) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "summary-value\">TRUE") +}) + +testthat::test_that("content_summary shows FALSE as selected value", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable", selected = FALSE) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "summary-value\">FALSE") +}) + +testthat::test_that("content_summary shows comma-separated values when multiple are selected", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice( + dataname = "data", varname = "variable", + selected = c(TRUE, FALSE), multiple = TRUE + ) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "TRUE, FALSE") +}) + +testthat::test_that("content_summary shows NA check icon when keep_na is TRUE and NA values exist", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable", selected = TRUE, keep_na = TRUE) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "fa-check") + testthat::expect_match(summary_html, "text-success") +}) + +testthat::test_that("content_summary shows NA xmark icon when keep_na is FALSE and NA values exist", { + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice( + dataname = "data", varname = "variable", selected = TRUE, keep_na = FALSE + ) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "fa-xmark") + testthat::expect_match(summary_html, "text-danger") +}) + +testthat::test_that("content_summary shows NA check icon when keep_na is NULL", { # nolint + filter_state <- LogicalFilterState$new( + logs, + slice = teal_slice(dataname = "data", varname = "variable", selected = TRUE) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "fa-check") + testthat::expect_match(summary_html, "text-success") +}) + +testthat::test_that("content_summary omits NA span when data has no NA values", { + filter_state <- LogicalFilterState$new( + logs_no_na, + slice = teal_slice(dataname = "data", varname = "variable", selected = TRUE) + ) + summary_html <- as.character( + shiny::isolate(filter_state$.__enclos_env__$private$content_summary()) + ) + testthat::expect_match(summary_html, "filter-card-summary-controls") + testthat::expect_no_match(summary_html, "fa-check") + testthat::expect_no_match(summary_html, "fa-xmark") +}) + # print --- testthat::test_that("print returns a properly formatted string representation", { filter_state <- LogicalFilterState$new(logs, slice = teal_slice(dataname = "data", varname = "variable"))