ExplorerClass: Explorer Class

Description Methods UI list Server function

Description

R6Class, whose instantiations represent individual behaviour of a specific group of elements inside the explorer module. For creating your own explorer class see the explorer class vignette: vignette("explorer_class", package = "shinyExplorer").

Methods

new(id, ui, server, label = NULL, on_remove = function(node) NULL)

Initialise a new object of class ExplorerClass.

id Unique id.
ui A list of UI functions. See 'UI list' for details.
server Module server function. See 'Server function' for return list elements that get handled by explorer and explorer_body.
label Character vector of labels associated with this class. The id is always treated as a label as well. Different explorer classes can't share the same ids but they can have common labels.

UI list

The argument ui receives a named list of ui functions - these are functions taking at least an argument id and returning pseudo-HTML. The following names are handled by explorer:

contextmenu_item_ui Function returning a contextmenu_item, which is displayed in the contextmenu, if this explorer_class is addable in the explorer or explorer_selector. Clicking on this contextmenu_item usually adds a new node of this explorer class as a child node to the contextmenued node.
specific_contextmenu_items_ui Function returning a tagList of contextmenu_items. These contextmenu items are part of the contextmenu which is displayed upon contextmenuing a node of this explorer class.

These functions only provide the layout of the items. The functionality must be implemented in the server function.

Server function

The following (and only these) return list elements are handled by explorer and explorer_body:

selectable_classes_r Reactive returning a character vector containing the ids of explorer_classes who can be added to the explorer, if the current explorer_class has id = id. Returning NULL results in no possible selection. Returning of "" results in possible selection of all explorer_classes. If the server function does not return this reactive, all explorer_classes are selectable.
icon_r Reactive returning a icon, which is displayed in the explorer_body.
on_remove Function, which is called just before a node of this explorer class is removed from a tree. This function receives the target node as the only argument.

DavidBarke/shinyExplorer documentation built on Aug. 28, 2020, 8:54 p.m.