sisense.com

Global Interface: window.prism

The prism global is available on the window scope anywhere within the Sisense web client, providing access to global APIs.

Example:

// Access the current Sisense version:
console.log(prism.version);

Properties

NameTypeDescriptionExample
versionstringCurrent Sisense version'8.1.1.10050'
platformstringCurrent platform'desktop'
proxyurlstringIf set, the proxy URL''
activeDashboardDashboardWhen viewing a dashboard or widget, a reference to the current Dashboard object
activeWidgetWidgetWhen viewing a widget (in widget editor), a reference to the current Widget object
brandBrandingConfigurationWhite-labeling feature settings
constsGlobalConstantsGlobal constants
featuresFeatureConfiguration[]Current feature flags
globalizationGlobalizationConfigurationCurrent globalization settings
userUserCurrent user information

Methods

debugging.GetJaql

debugging.GetJaql(widget) → string

Get a Widget's JAQL query, including applicable Dashboard-level filters

Arguments

NameTypeDescriptionExample
widgetWidgetWidget to get

Returns

A string representing a JSON-stringified JAQL query.

Example

console.log(prism.debugging.GetJaql(prism.activeWidget));

debugging.GetSql

debugging.GetSql(widget) → string

Generate a SQL query from the provided Widget, including applicable Dashboard-level filters.

Arguments

NameTypeDescriptionExample
widgetWidgetWidget to get

Returns

A string of the SQL query.

Example

console.log(prism.debugging.GetSql(prism.activeWidget));

getApi

getApi(apiName) → object

Access point for new client APIs.

Arguments

NameTypeDescriptionExample
apiNamestringName of API module to retrieve'api.v1.header'

Returns

An API module instance.

Example

var header = prism.getApi('api.v1.header');

on

on(eventName, eventHandler)

Subscribe to a global event

Arguments

NameTypeDescriptionExample
eventNamestringEvent to register to'beforemenu'
eventHandlerfunctionEvent handler function

Returns

N/A

Example

prism.on('beforemenu', function () {
    console.log('a menu was opened');
});

registerWidget

registerWidget(widgetName, manifest)

Register a new widget type (visualization) for use in Dashboards.

Arguments

NameTypeDescriptionExample
widgetNamestringUnique widget type name'funnelWidget'
manifestWidgetManifestObject describing the widget type (see reference)

Returns

N/A

Example

prism.registerWidget('myWidget', {
    // Widget manifest
});

Events

apploaded

Fired when the whole Sisense Web Application is loaded.

Arguments

N/A

beforemenu

Fired before every menu is opened and allows the removal of existing menu items and the addition of custom menu items.

Available menu names to customize:

  • datapoint
  • dashboard
  • widget
  • widgetindashboard
  • widget-metadataitem
  • widget-metadataitem-sort
  • widget-metadataitem-type
  • databrowser-field
  • databrowser-formula
  • formula-metadataitem
  • dashboard-filter

Arguments

NameTypeDescription
evEventObject describing the event
argsObjectEvent arguments
args.uiObjectMenu UI properties
args.settingsObjectMenu configuration
args.settings.itemsMenuItem[]Array of menu items
args.settings.namestringMenu name (used to identify which menu was opened)

Example

prism.on('beforemenu', (ev, args) => {
    if (args.settings.name === 'widget') {
        console.log('widget menu was opened!');
    }
});

beforewidgetmenu

Fired when clicking the widget menu while in Edit Widget mode.

Arguments

NameTypeDescription
widgetWidgetWidget instance.
itemsobject[]Array of items to be displayed.
elementDOMElementSource element that triggers. the event.
cancelbooleanDetermines whether the menu is displayed or not.

beforewidgetindashboardmenu

Fired when clicking the widget's menu while viewing a dashboard.

Arguments

NameTypeDescription
widgetWidgetWidget instance.
itemsobject[]Array of items to be displayed.
elementDOMElementSource element that triggers. the event.
cancelbooleanDetermines whether the menu is displayed or not.

homeloaded

Fired when the home page in the Sisense Web Application is loaded.

Arguments

N/A

widgetloaded

Fired when a widget model was loaded to the widget editor.

Arguments

NameTypeDescription
widgetWidgetWidget instance.

unwidgetloaded

Fired when a dashboard model was unloaded from the widget editor.

Arguments

NameTypeDescription
widgetWidgetWidget instance.

beforedashboardloaded

Fired before a dashboard JSON is loaded into a dashboard model.

Arguments

NameTypeDescription
dashboardDashboardDashboard instance.

dashboardloaded

Fired when a dashboard model is loaded into the environment.

Arguments

NameTypeDescription
dashboardDashboardDashboard instance.

dashboardunloaded

Fired when a dashboard model is unloaded from the environment.

Arguments

NameTypeDescription
dashboardDashboardDashboard instance.

Sub-types

Branding Configuration

An object containing the branding/white-labeling configuration

Example

{
  "dummy": {
    "small": null,
    "large": null
  },
  "contactUsText": null,
  "emails": {
    "passwordRecoverySubject": null,
    "createdUserSubject": null,
    "senderEmail": null,
    "shareWithExistingUserSubject": null,
    "transferOwnership": null,
    "shareWithNewUserSubject": null,
    "senderName": null,
    "newUserInviteSubject": null,
    "templates_directory": null
  },
  "homePage": null,
  "logo": {
    "tablet": {
      "large": null,
      "small": null
    },
    "phone": {
      "small": null,
      "large": null
    },
    "desktop": {
      "large": null,
      "small": null
    }
  },
  "activationTitle": null,
  "forumUrl": null,
  "poweredBySisense": true,
  "homePageConfig": {
    "marketingPart": null,
    "documentationLink": null,
    "tutorialsLink": null,
    "hideSearchInNavver": "true"
  },
  "favicon": null,
  "loginTitle": null,
  "documentationUrl": null,
  "pageTitle": null,
  "activationSubtitle": null,
  "loginSubtitle": null,
  "copyrightText": null,
  "enabled": true
}

Global Constants

An object containing various global constants used within the Sisense UI application

Properties

NameTypeDescriptionExample
nullValuestringA string to replace null values with'N\\A'

Example

{
  "nullValue": "N\\A"
}

Feature Configuration

An object representing a feature flag - indicating whether a Sisense feature is turned on or off.

Properties

NameTypeDescriptionExample
keystringFeature name'alerting'
activebooleanIs Feature turned ontrue

Example

[
    { "key":"alerting",  "active":true  },
    { "key":"liveQuery", "active":false },
    { "key":"embedCode", "active":false }
]

Globalization Configuration

An object defining configuration for globalization

Properties

NameTypeDescriptionExample
languagestringCurrent language'en-US'
localization.autoDetectEnabledbooleanShould language be detected automaticallytrue
localization.defaultstringDefault configured languageen-US

Example

{
    "language": "en-US",
    "localization": {
        "autoDetectEnabled": true,
        "default": "en-US"
    }
}
Last Updated: