gadgets_developer: Functions to implement AnVIL gadget interfaces

.gadget_runR Documentation

Functions to implement AnVIL gadget interfaces

Description

Functions documented on this page are primarily intended for package developers wishing to implement gadgets (graphical interfaces) to navigating AnVIL-generated tables.

.gadget_run() presents the user with a tibble-navigating gadget, returning the value of DONE_FUN if a row of the tibble is selected, or NULL.

Usage

.gadget_run(title, tibble, DONE_FUN)

Arguments

title

character(1) (required) title to appear at the base of the gadget, e.g., "AnVIL Workspaces".

tibble

a tibble or data.frame to be displayed in the gadget.

DONE_FUN

a function of two arguments, tibble and row_selected. The tibble is the tibble provided as an argument to .gadget_run(). row_selected is the row selected in the gadget by the user. The function is only invoked when the user selects a valid row.

Value

.gadget_run() returns the result of DONE_FUN() if a row has been selected by the user, or NULL if no row is selected (the user presses Cancel, or Done prior to selecting any row).

Examples

## Not run: 
tibble <- avworkspaces()
DONE_FUN <- function(tibble, row_selected) {
    selected <- slice(tibble, row_selected)
    with(selected, paste0(namespace, "/", name))
}
.gadget_run("AnVIL Example", tibble, DONE_FUN)

## End(Not run)

Bioconductor/AnVIL documentation built on Dec. 21, 2024, 6:17 a.m.