chmNewFunction: Create a new Javascript function for adding to a NGCHM menu.

chmNewFunctionR Documentation

Create a new Javascript function for adding to a NGCHM menu.

Description

This function creates a new Javascript function object for adding to a Next Generation Clustered Heat Map menu.

Usage

chmNewFunction(
  name,
  description,
  implementation,
  extraParams = NULL,
  requires = NULL,
  global = FALSE
)

Arguments

name

The name of the Javascript function

description

A short description of the Javascript function

implementation

A string containing the javascript code required to define the function. When called the function is passed a list of selected values (e.g. labels). Additional parameters can be declared before the values parameter and must be resolved through currying (binding) before the function is used in menus.

extraParams

An optional list of extra parameters. (Default NULL.)

requires

An optional vector of (custom) Javascript function names that this function requires.

global

A logical: TRUE if should be defined globally, not within a customization section. (Default FALSE.)

Value

An object of class ngchmJS

See Also

ngchmJS

chmAddMenuItem()

chmBindFunction()

chmRegisterFunction()

Examples

alertFn <- chmNewFunction ("showAlert", "Display the parameter in an alert box",
                           "function showAlert(label) { alert(label); }", global=TRUE)
dbLookup <- chmNewFunction ("dbLookup", "Lookup the parameter in a database",
                            "function showAlert(database, label) { alert(database[label]); }",
                            c("database"))


bmbroom/NGCHMR documentation built on April 18, 2022, 6:52 p.m.