sisense.com

Widget Manifest Type

The manifest object used to register new widget types with Sisense.

NameTypeDescription
namestringWidget name.
familystringWidget family name.
styleEditorTemplatestringWidget editor template URL.
iconSmallstringWidget small icon URL. The icon should be a sprite file of two 24x24 icons.
hideNoResultsbooleanDefines whether the widget renders the default no result state.
noResultImgstringURL for an image representing the no result state of the widget.
noResultImgSmallstringURL for a small image representing the no result state of the widget.
optionsobjectDefault options object. The options object shares both common attributes along with widget-defined attributes.
sizingobjectDefault sizing that defines the various sizing attributes for the defined widget type.
directiveobjectAngularJS Directives used as an alternative rendering mechanism to the render method.
styleobjectEach widget type is defined with it’s own style object.
dataobjectWidget data manifest object.

Types

Options

Properties

NameTypeDescription
selectorbooleanIndicates if the widget should be a selector widget by default. Default = false.
disallowSelectorbooleanIndicates if the widget can act as a selector. Default = true.
dashboardFiltersModestringIndicates how the dashboard filters affect the widget: filter or highlight. Defaults to filter
triggersDomreadybooleanIndicates if the widget is triggering the DOM-ready event once it's DOM representation was added to the DOM in full.

Sizing

Properties

NameTypeDescription
minHeightintegerStates the minimum height to which the widget can shrink.
maxHeightintegerStates the maximum height to which the widget can grow.
minWidthintegerStates the minimum width to which the widget can shrink.
maxWidthintegerStates the maximum width to which the widget can grow.
heightintegerStates the default height set for a newly created widget of the defined type.

Directive

Properties

NameTypeDescription
desktopstringDesktop directive name and acts as the default name when the target device is not defined.
tabletstringTablet directive name, with the desktop attribute as default fallback.
mobilestringMobile directive name, with the desktop attribute as default fallback.

Data

Properties

NameTypeDescription
selectionstring[]States which of the widget's data panels to use for selection.
defaultQueryResultobjectDefines the default query result with which the widget is served.
buildQueryfunctionGets a basic query object and is responsible for building the query from the current state of the widget.
processResultfunctionPrepares the widget-specific query result from the given result data-table.
rankMetadatafunctionRanks the compatibility of the given metadata items with the widget.
populateMetadatafunctionImplements the widget meta-data population of the items.
getMesaureFilteredItemfunctionGets the data panel item on which the measure filter should be applied.
panelsobjectStates the data panels array with which the widget is

Functions

Some of the properties of the data object need or may be of function type. These functions have specific, strict input arguments and expected outputs. They are listed below:

buildQuery

buildQuery(widget, query)

Gets a basic query object and is responsible for building the query from the current state of the widget.

Arguments

NameTypeDescription
widgetobjectWidget model.
queryobjectQuery object to load widget metadata to.

Returns

query object

processResult

processResult(widget, queryResult)

Prepares the widget-specific query result from the given result data-table.

Arguments

NameTypeDescription
widgetobjectWidget model.
queryResultobjectData-set object.

Returns

Processed result object to be passed to the widget view.

rankMetadata

rankMetadata(items, type, subtype)

Ranks the compatibility of the given metadata items with the widget.

Arguments

NameTypeDescription
itemsobject[]Items to rank.
typestringWidget type (for use with multi-type manifests).
subtypestringWidget sub-type (for use with multi-sub-type manifests).

Returns

-1 = Items are not supported. 0 = Items are supported. 1 = The widget is a preferred visualization of the items. 2 = The widget is the best suited visualization for the items.

populateMetadata

populateMetadata(widget, items)

Implements the widget meta-data population of the items.

Arguments

NameTypeDescription
widgetobjectWidget model to populate items.
itemsobject[]Items to populate into the widget.

Returns

This function does not need to return anything.

getMesaureFilteredItem

getMesaureFilteredItem(widget)

Gets the data panel item on which the measure filter should be applied.

Arguments

NameTypeDescription
widgetobjectWidget model from where to get the item from.

Returns

The data panel item to be applied with the measure filter.

Data Panel

Properties

NameTypeDescription
namestringStates the name of the panel.
typestringStates the type of the panel.
noDragbooleanIndicates if data items can be dragged in/out to/from the panel.
itemAttributesstring[]Array of supported formatting attributes for the panel’s data items. Available values are color and size.
canDisableItemsbooleanDefines whether items on the panel can be disabled.
metadataobjectDefines the type of metadata this panel can work with
visibilityfunctionDynamically show/hides the panel.
defaultFormatterfunctionGenerates the default format object to be attached by default to panel items.
canMaskfunctionDetermines whether the item can be masked.
colorfunctionApplies custom coloring to every result cell.
sizefunctionApplies custom sizing to every result cell.
maskfunctionApplies custom masking to every result cell.
itemDisabledStateChangedfunctionTriggered when an item was enabled or disabled.
allowedColoringTypesfunctionDetermine which of the following coloring methods are supported by the given widget color, range, or condition.
itemAddedfunctionCalled when a new item is added to the panel.

Functions

Some of the properties of the data.panels[] object need or may be of function type. These functions have specific, strict input arguments and expected outputs. They are listed below:

visibility

visibility(widget)

Dynamically show/hides the panel.

Arguments

NameTypeDescription
widgetWidgetTriggering widget.

Returns

boolean value indicating whether the panel should be shown in the widget editor.

defaultFormatter

defaultFormatter(widget, item)

Generates the default format object to be attached by default to panel items.

Arguments

NameTypeDescription
widgetWidgetTriggering widget.
itemMetadataItemTriggering item.

Returns

Default formatting object.

{ type: "range", steps: 9, rangeMode: "auto" }

canMask

canMask(item)

Determines whether the item can be masked.

Arguments

NameTypeDescription
itemWidgetTriggering item.

Returns

boolean value indicating whether the item can be masked.

color

color(data, cell, item, widget)

Applies custom coloring to every result cell.

Arguments

NameTypeDescription
dataCell data.
cellTriggering cell.
itemMetadataItemMetadata item to which the given cell belongs.
widgetWidgetTriggering widget.

Returns

string color value

size

size(data, cell, item, widget, minvalue, maxvalue)

Applies custom sizing to every result cell.

Arguments

NameTypeDescription
dataCell data.
cellTriggering cell.
itemMetadataItemMetadata item to which the given cell belongs.
widgetWidgetTriggering widget.
minvalueMin value in the item's column.
maxvalueMax value in the item's column.

Returns

float number between 0 and 1

mask

mask(data, cell, item, widget)

Applies custom masking to every result cell.

Arguments

NameTypeDescription
dataCell data.
cellTriggering cell.
itemMetadataItemMetadata item to which the given cell belongs.
widgetWidgetTriggering widget.

Returns

string masked value

itemDisabledStateChanged

itemDisabledStateChanged(widget, item)

Triggered when an item was enabled or disabled.

Arguments

NameTypeDescription
widgetWidgetTriggering widget.
itemMetadataItemTriggering item.

Returns

This function does not need to return anything.

allowedColoringTypes

allowedColoringTypes(widget)

Determine which of the following coloring methods are supported by the given widget color, range, or condition.

Arguments

NameTypeDescription
widgetWidgetTriggering widget.

Returns

An object stating which coloring methods are supported.

{
    color: boolean,
    range: boolean,
    condition: boolean
}

itemAdded

itemAdded(widget, item)

Called when a new item is added to the panel.

Arguments

NameTypeDescription
widgetWidgetWidget triggering the callback.
itemMetadataItemAdded item.

Returns

This function does not need to return anything.


Data Panel Metadata

Properties

NameTypeDescription
typesstring[]Defines the JAQL types the panel can hold - measures and dimensions (I/E ["measures", "dimensions"] allows addition of both measures and dimensions.
maxitemsintegerDefines the maximal number of items the panel can hold.
mixedbooleanDefines whether the panel can mix both Measures and Dimensions.
sortablefunctionDetermine whether a given item in the given widget instance can be sorted.

Functions

Some of the properties of the data.panels[] object need or may be of function type. These functions have specific, strict input arguments and expected outputs. They are listed below:

sortable

sortable(widget, item)

Determine whether a given item in the given widget instance can be sorted.

Arguments

NameTypeDescription
widgetWidgetTriggering widget.
itemMetadataItemTriggering item.

Returns

boolean

Last Updated: