# Widget Manifest Type
The manifest object used to register new widget types with Sisense.
Name | Type | Description |
---|---|---|
name | string | Widget name. |
family | string | Widget family name. |
styleEditorTemplate | string | Widget editor template URL. |
iconSmall | string | Widget small icon URL. The icon should be a sprite file of two 24x24 icons. |
hideNoResults | boolean | Defines whether the widget renders the default no result state. |
noResultImg | string | URL for an image representing the no result state of the widget. |
noResultImgSmall | string | URL for a small image representing the no result state of the widget. |
options | object | Default options object. The options object shares both common attributes along with widget-defined attributes. |
sizing | object | Default sizing that defines the various sizing attributes for the defined widget type. |
directive | object | AngularJS Directives used as an alternative rendering mechanism to the render method. |
style | object | Each widget type is defined with it’s own style object. |
data | object | Widget data manifest object. |
# Types
# Options
Properties
Name | Type | Description |
---|---|---|
selector | boolean | Indicates if the widget should be a selector widget by default. Default = false. |
disallowSelector | boolean | Indicates if the widget can act as a selector. Default = true. |
dashboardFiltersMode | string | Indicates how the dashboard filters affect the widget: filter or highlight . Defaults to filter |
triggersDomready | boolean | Indicates if the widget is triggering the DOM-ready event once it's DOM representation was added to the DOM in full. |
# Sizing
Properties
Name | Type | Description |
---|---|---|
minHeight | integer | States the minimum height to which the widget can shrink. |
maxHeight | integer | States the maximum height to which the widget can grow. |
minWidth | integer | States the minimum width to which the widget can shrink. |
maxWidth | integer | States the maximum width to which the widget can grow. |
height | integer | States the default height set for a newly created widget of the defined type. |
# Directive
Properties
Name | Type | Description |
---|---|---|
desktop | string | Desktop directive name and acts as the default name when the target device is not defined. |
tablet | string | Tablet directive name, with the desktop attribute as default fallback. |
mobile | string | Mobile directive name, with the desktop attribute as default fallback. |
# Data
Properties
Name | Type | Description |
---|---|---|
selection | string[] | States which of the widget's data panels to use for selection. |
defaultQueryResult | object | Defines the default query result with which the widget is served. |
buildQuery | function | Gets a basic query object and is responsible for building the query from the current state of the widget. |
processResult | function | Prepares the widget-specific query result from the given result data-table. |
rankMetadata | function | Ranks the compatibility of the given metadata items with the widget. |
populateMetadata | function | Implements the widget meta-data population of the items. |
getMesaureFilteredItem | function | Gets the data panel item on which the measure filter should be applied. |
panels | object | States 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
Name | Type | Description |
---|---|---|
widget | object | Widget model. |
query | object | Query 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
Name | Type | Description |
---|---|---|
widget | object | Widget model. |
queryResult | object | Data-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
Name | Type | Description |
---|---|---|
items | object[] | Items to rank. |
type | string | Widget type (for use with multi-type manifests). |
subtype | string | Widget 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
Name | Type | Description |
---|---|---|
widget | object | Widget model to populate items. |
items | object[] | 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
Name | Type | Description |
---|---|---|
widget | object | Widget model from where to get the item from. |
Returns
The data panel item to be applied with the measure filter.
# Data Panel
Properties
Name | Type | Description |
---|---|---|
name | string | States the name of the panel. |
type | string | States the type of the panel. |
noDrag | boolean | Indicates if data items can be dragged in/out to/from the panel. |
itemAttributes | string[] | Array of supported formatting attributes for the panel’s data items. Available values are color and size. |
canDisableItems | boolean | Defines whether items on the panel can be disabled. |
metadata | object | Defines the type of metadata this panel can work with |
visibility | function | Dynamically show/hides the panel. |
defaultFormatter | function | Generates the default format object to be attached by default to panel items. |
canMask | function | Determines whether the item can be masked. |
color | function | Applies custom coloring to every result cell. |
size | function | Applies custom sizing to every result cell. |
mask | function | Applies custom masking to every result cell. |
itemDisabledStateChanged | function | Triggered when an item was enabled or disabled. |
allowedColoringTypes | function | Determine which of the following coloring methods are supported by the given widget color, range, or condition. |
itemAdded | function | Called 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
Name | Type | Description |
---|---|---|
widget | Widget | Triggering 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
Name | Type | Description |
---|---|---|
widget | Widget | Triggering widget. |
item | MetadataItem | Triggering item. |
Returns
Default formatting object.
{ type: "range", steps: 9, rangeMode: "auto" }
# canMask
canMask(item)
Determines whether the item can be masked.
Arguments
Name | Type | Description |
---|---|---|
item | Widget | Triggering 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
Name | Type | Description |
---|---|---|
data | Cell data. | |
cell | Triggering cell. | |
item | MetadataItem | Metadata item to which the given cell belongs. |
widget | Widget | Triggering widget. |
Returns
string
color value
# size
size(data, cell, item, widget, minvalue, maxvalue)
Applies custom sizing to every result cell.
Arguments
Name | Type | Description |
---|---|---|
data | Cell data. | |
cell | Triggering cell. | |
item | MetadataItem | Metadata item to which the given cell belongs. |
widget | Widget | Triggering widget. |
minvalue | Min value in the item's column. | |
maxvalue | Max 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
Name | Type | Description |
---|---|---|
data | Cell data. | |
cell | Triggering cell. | |
item | MetadataItem | Metadata item to which the given cell belongs. |
widget | Widget | Triggering widget. |
Returns
string
masked value
# itemDisabledStateChanged
itemDisabledStateChanged(widget, item)
Triggered when an item was enabled or disabled.
Arguments
Name | Type | Description |
---|---|---|
widget | Widget | Triggering widget. |
item | MetadataItem | Triggering 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
Name | Type | Description |
---|---|---|
widget | Widget | Triggering 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
Name | Type | Description |
---|---|---|
widget | Widget | Widget triggering the callback. |
item | MetadataItem | Added item. |
Returns
This function does not need to return anything.
# Data Panel Metadata
Properties
Name | Type | Description |
---|---|---|
types | string[] | Defines the JAQL types the panel can hold - measures and dimensions (I/E ["measures", "dimensions"] allows addition of both measures and dimensions. |
maxitems | integer | Defines the maximal number of items the panel can hold. |
mixed | boolean | Defines whether the panel can mix both Measures and Dimensions. |
sortable | function | Determine 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
Name | Type | Description |
---|---|---|
widget | Widget | Triggering widget. |
item | MetadataItem | Triggering item. |
Returns
boolean