Skip to contents

InputPanel module that handles inputs based on an input function like: shiny::selectInput(), shinyWidgets::pickerInput(), etc.

Details

The assigned input values are accessible in the reactive values inputValues field. Other modules may trigger off these reactive values with i.e. shiny::observeEvent().

Super class

ShinyModule -> InputPanel

Active bindings

parentNamespace

(character(1)) Namespace of the parent module.

funs

(list()) Named list of xInput functions used list(funA = shiny::selectInput).

args

(list()) Named list of arguments used by xInput functions list(funA = list(inputId = "name", label = "name")).

inputValues

(reactiveValues) Values passed from the input fields.

Methods

Inherited methods


InputPanel$new()

Initializer method

Usage

InputPanel$new(funs, args, growDirection = "vertical", ...)

Arguments

funs

(list()) Named list of xInput functions used list(funA = shiny::selectInput).

args

(list()) Named list of arguments used by xInput functions list(funA = list(inputId = "name", label = "name"))

growDirection

The direction in which this component will be placed, either "horizontal" or "vertical" (default)

...

Additional parameters to set fields from the ShinyModule parent.

Returns

(invisible(self))


InputPanel$validate()

Validation method

Usage

InputPanel$validate()

Returns

(self)


InputPanel$update()

Updates the input variables using the provided update functions supplied in updateFuns

Usage

InputPanel$update(fun, name, ...)

Arguments

fun

(funciton) Update function to use i.e. shiny::updateSelectInput

name

(character(1)) Name of the update function and argument set to use.

...

Arguments that are used by the supplied function. inputId should now be provided, as it is derived from the name argument.

Returns

(invisible(self))


InputPanel$clone()

The objects of this class are cloneable with this method.

Usage

InputPanel$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

library(DarwinShinyModules)

inputPanel <- InputPanel$new(
  funs = list(
    select = shiny::selectInput,
    text = shiny::textInput
  ),
  args = list(
    select = list(inputId = "select", choices = c("a", "b"), label = "select"),
    text = list(inputId = "text", label = "text")
  )
)

if (interactive()) {
  preview(inputPanel)
}