single-select-generics: Generics for controlling single selections

Description Specifying the nature of the selection Obtaining the selected element Indicating the receiving slots Author(s)

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 panel's single selection would contain a "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 in x that is to be transmitted to other panels. If no row or column is selected, it should return NULL.

contents is any arbitrary structure returned by .generateOutput for x in the field of the same name. 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) controls how x should respond to a single selection. It should return a list of lists, where each internal list describes a set of slots 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:

For each set of responsive slots, the expected paradigm is that the user interface will contain two selectInput elements, one for each of the param and source slots. Users are free to manually alter the choice of feature/sample in the param's selectInput. Users are also allowed to change the identity of the transmitting panel via the source's selectInput, which will automatically update 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


iSEE documentation built on Feb. 3, 2021, 2:01 a.m.