ARCAPI Functions

The extension JS module has access to an 'arcapi' object, which supports the following functions:

ARCAPI Functions
FunctionDescription
arcapi.addScripts()Adds script elements.
arcapi.addStyles()Adds style elements.
arcapi.chartId()Returns the id DOM element.
arcapi.dataResult()Returns the data result object and gives access to the raw data for plotting the visual.
arcapi.getParameters()Returns information on all current parameters.
arcapi.getSetting()Returns the value of the specified setting.
arcapi.sendParameters()Forwards parameter definitions to other visuals in the app.
arcapi.settings()Returns information on all current settings.

arcapi.addScripts()

Adds script elements for the additional styles specified in the filepaths array. The function cb is invoked after load completes.

Syntax:

arcapi.addScripts(
  filepaths, 
  cb);

Parameters:

  • filepaths -- an array that specifies the additional styles.
  • cb -- call-back function that is invoked after the load is completed.

arcapi.addStyles()

Adds style elements for the additional styles specified in the filepaths array. The function cb is invoked after load completes.

Syntax:

arcapi.addStyles(
  filepaths, 
  cb);

Parameters:

  • filepaths -- an array that specifies the additional styles.
  • cb -- call-back function that is invoked after the load is completed.

arcapi.chartId()

Returns the id attribute of the DOM element used to draw the visual.

Usage:

$("#" + arcapi.chartId())

Returns a jquery selector to the DOM element.

arcapi.dataResult()

Returns data result object that gives the extension access to the raw data used to plot the visual. This object supports the arc.data.result interface.

Syntax:

arcapi.dataResult();

arcapi.getParameters()

Returns a hash that contains key-value mappings for all current parameters.

Syntax:

arcapi.getParameters(
  params_hash);

Parameters:

  • params_hash -- hash definition.

arcapi.getSetting()

Returns the value of the specified setting.

Syntax:

arcapi.getSetting(
  settingName);

Parameters:

  • settingName -- name of setting.

arcapi.sendParameters()

Accepts a hash definition, and sends out the keys and values of the hash as parameters to other visuals in the app.

Syntax:

arcapi.sendParameters(
  params_hash);

Parameters:

  • params_hash -- hash definition.

arcapi.settings()

Returns an array of objects, with id of a setting, and value of that setting.

The order of the array is specified by the JS extension's settings() function.

Syntax:

arcapi.Settings();