View source: R/dualDrilldown.R
dualDrilldownServer | R Documentation |
Drilldown component with two different modes of disply and linked up to two different inputs
dualDrilldownServer(
id,
cdata = reactive(NULL),
colorby,
factorx = function(x) is.factor(cdata()[[x]]),
ignorev = "ID",
src1 = reactive(NULL),
src2 = reactive(NULL)
)
id |
Character ID for specifying namespace, see |
cdata |
A |
colorby |
A named list where name matches the (factor) variable in |
factorx |
Optional, a function that returns a boolean for whether
a variable should be plotted as factor when given the variable name.
Useful when for some reason factor variables are numeric or character instead of already factor-encoded.
By default, variables are merely checked using |
ignorev |
A character vector of variables such as IDs to exclude from selection for plotting. Defaults to "ID". |
src1 |
Reactive data from "source 1". |
src2 |
Reactive data from "source 2". |
The drilldown component is, at its simplest, a selectInput
through which
variables can be selected for adaptive visualization as a boxplot or scatterplot output
(depending on whether one or two variables are selected, respectively).
However, optional complexity can be added to the component by making it listen to
two other sources – two independent higher-level components
that can update this component's selectInput
,
analogous to the poor drilldown having two bosses telling it what data they want reported.
Thus the "dual" describes both how the drilldown renders in two different ways
as well as being able to be controlled by up to two different sources.
A default factor grouping variable is required and passed into the aesthetics.
If there were no default factor grouping variable,
it would be unclear how to generate the boxplot view when only one variable is selected.
It should also be possible to specify multiple variables to be used for grouping
(which the user can switch between), but this isn't implemented yet.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.