chmNewFunction | R Documentation |
This function creates a new Javascript function object for adding to a Next Generation Clustered Heat Map menu.
chmNewFunction( name, description, implementation, extraParams = NULL, requires = NULL, global = FALSE )
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.) |
An object of class ngchmJS
ngchmJS
chmAddMenuItem()
chmBindFunction()
chmRegisterFunction()
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.