single-select-generics {iSEE}R Documentation

Generics for controlling single selections

Description

A panel can create a single selection on either the rows or columns and transmit this selection to another panel for use as an aesthetic parameter. For example, users can click on a RowTable to select a gene of interest, and then the panel can transmit the identities of that row to another panel for coloring by that selected gene's expression. This suite of generics controls the behavior of these single selections.

Specifying the nature of the selection

Given an instance of the Panel class x, .singleSelectionDimension(x) should return a string specifying whether the selection contains a single "feature", "sample", or if the Panel in x does not perform single selections at all ("none"). The output should be constant for all instances of x.

Obtaining the selected element

.singleSelectionValue(x, contents) should return a string specifying the selected row or column. If no row or column is selected, it should return NULL.

contents is any arbitrary structure set by the rendering expression in .renderOutput for x. This should contain all of the information necessary to determine the name of the selected row/column. For example, a data.frame of coordinates is stored by DotPlots to identify the point selected by a brush/lasso.

Indicating the receiving slots

.singleSelectionSlots(x) should return a list with one internal list for each slot in x that might respond to a single selection from a transmitting panel. This internal list should contain at least entries with the following names:

The paradigm here is that the interface will contain two selectInput elements, one for each of the param and source slots. It is possible for users to manually alter the choice in the param's selectInput; it is also possible for users to specify a transmitting panel via the source's selectInput, which will then trigger automatic updates to the chosen entry in the param's selectInput when the transmitter's single selection changes.

Developers are strongly recommended to follow the above paradigm. In fact, the observers to perform these updates are automatically set up by .createObservers,Panel-method if the internal list also contains the following named entries:

Author(s)

Aaron Lun


[Package iSEE version 2.0.0 Index]