Select

Overview

List of configuration files

Filename

Short description

Format

Link to documentation

dashboard.view#SelectWidget

Defines the SelectWidget widget global settings

json

Link

Features

A Select Widget allows selecting one or many element from a list of options. After each modification, the widget emits its current selected option as an event.

There are different types of Select widgets:

  • Custom: options are defined as settings in the configuration

  • AnalyticsMeasure : options are defined by the configuration measures list and by the includeOptions and excludeOptions settings.

  • AnalyticsField : options are defined by the configuration fields list and by the includeOptions and excludeOptions settings.

  • ReportsTemplate: options are defined by the configuration reports templates list and by the includeOptions and excludeOptions settings.

  • Form: options are defined by the configuration forms list and by the includeValues and excludeValues settings.

  • AnalyticsAggregate: contains the list of aggregation functions available for charts widgets. List contains:

    • count: number of points

    • integral: computes the area under the curve per unit of time of subsequent non-null records

    • last: last element

    • mean: average value of all points

    • median: median value of all points

    • min: minimum value

    • max: maximum value

Each select type allows selecting multiple values, except for Form and AnalyticsAggregate which can only have one selected value.

../../../_images/osp-select-example.png

Multiple Settings

These settings can be applied to any Select widget allowing multiple values selection:

Setting

Usage

Type

Default value

defaultOptions

Select default options

string[]

multiple

Allows selecting more than one element

boolean

true

limitTags

Max number of elements displayed when multiple is true

number

2

Custom type

Following settings are exclusive to Custom Select:

Setting

Usage

Type

Default value

options

List of options

String[]

AnalyticsMeasure type & AnalyticsField type

Following settings are exclusive to AnalyticsMeasure, AnalyticsField, ReportsTemplate and Form:

Setting

Usage

Type

Default value

includeOptions

List of options to keep from the measure list

String[]

excludeOptions

List of options to remove from the measure list

String[]

Single Settings

These settings can be applied to any Select widget allowing only single values selection:

Setting

Usage

Type

Default value

defaultOption

Select default option

string

Examples

Custom type

{
    "type": "Select",
    "id": "e",
    "title": "",
    "selectWidgetSettings": {
        "type": "Custom",
        "multiple": false,
        "icon": "timeline",
        "options": ["Device 1", "Device 2", "Device 3"],
        "defaultOptions": ["Device 3"]
    }
}

AnalyticsMeasure type

{
    "type": "Select",
    "id": "c",
    "title": "",
    "selectWidgetSettings": {
        "type": "AnalyticsMeasure",
        "multiple": false,
        "icon": "device_hub"
    }
}

AnalyticsField type

{
    "type": "Select",
    "id": "d",
    "title": "",
    "selectWidgetSettings": {
        "type": "AnalyticsField",
        "multiple": true,
        "icon": "timeline",
        "limitTags": 3
    }
}

ReportsTemplate type

{
    "type": "Select",
    "id": "e",
    "title": "",
    "selectWidgetSettings": {
        "type": "ReportsTemplate",
        "multiple": true,
        "icon": "picture_as_pdf",
        "limitTags": 1
    }
}

Form type

{
    "type": "Select",
    "id": "e",
    "title": "",
    "selectWidgetSettings": {
        "type": "Form",
        "icon": "code"
    }
}

AnalyticsAggregate type

{
    "type": "Select",
    "id": "e",
    "title": "",
    "selectWidgetSettings": {
        "type": "AnalyticsAggregate",
        "icon": "functions"
    }
}

Events

emit

The Select widget sends these events :

  • select: Sends selected option for Custom type

  • measure: Sends selected option for AnalyticsMeasure type

  • field: Sends selected option for AnalyticsField type

  • template: Sends selected option for ReportsTemplate type

  • formSet: Sends selected option for Form type

  • aggregateFunction: Sends selected option for AnalyticsAggregate

listen

The Select widget can process these events :

  • select: Sets selected option for Custom type

  • measure: Sets selected option for AnalyticsMeasure type

  • field: Sets selected option for AnalyticsField type

  • template: Sets selected option for ReportsTemplate type

  • formSet: Sets selected option for Form type

  • aggregateFunction: Sets selected option for AnalyticsAggregate

  • restore: Restores defaults values