Widget configuration
A widget configuration consist of three parts.
The widgetId
through which the widget can be placed on a dashboard, the itemView
/chart
that defines a title and a type.
The item_query
/aggregation_query
part defines the query that is sent to elastic in order to fetch the data.
Required Bundles
To use the default widgets that are part of the delivery it is necessary to require the corresponding bundles in the manifest.json
If custom widgets should be available, its bundles need to be added here, too. |
Example of a Widget Configuration:
"config": {
"dashboards": [
{
...
}
],
"widgets": [
{
"widgetId": "myAppStartsWidget",
"itemView": {
"title": "App starts in last hour",
"type": "Counter"
},
"item_query": {
"refresh": true,
"query": "event_name:App AND event_action:Started AND app_id:analyticssampleapp",
"time": {
"rangetype": "relative",
"relative": 60
}
}
}
]
}
The following property names may change during future releases. |
Item query widgets
These widgets display the results of a simple item query which are unmodified. The results may be displayed in a data table or a counter.
item_query
Defines the query that is sent against the elastic search index.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
refresh |
Boolean | Number |
no |
|
Whether to refresh the widget automatically or not.
If set to If set to a number it will refresh accordingly (Number in milliseconds). |
query |
String |
yes |
Defines the elastic search query.
For further info on syntax refer to Elastic docs . |
|
time |
JSON Object |
no |
Defines a timerange in milliseconds about which data should be respected in the query.
|
|
ignorePreProcessor |
Boolean |
no |
|
If In this way it is possible to control, if data restrictions on a dashboard should be applied to these widget/query |
itemView
Defines how the query results are displayed.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
title |
String |
yes |
Defines a title that is displayed above the widget |
|
subtitle |
String |
no |
Displays the functional description of the query of this widget. Info will be displayed when clicking the info icon in widget header (only table). |
|
type |
String |
yes |
Defines how the data are displayed. Possible values are:
|
Aggregierterte Query Widgets
These widgets display the results of an aggregated item query. The results may be displayed in a pie or column chart. An aggregated query is a query over distinct values of a certain index field.
aggregation_query
Defines the query that is sent against the elastic search index.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
refresh |
Boolean | Number |
no |
|
Whether to refresh the widget automatically or not.
If set to If set to a number it will refresh accordingly (Number in milliseconds). |
query |
String |
yes |
Defines the elastic search query.
For further info on syntax refer to Elastic docs |
|
queryField |
String |
no |
The index field to aggregate over. |
|
distinctValues |
Number |
no |
How many different values should be displayed separately. All other values will be grouped to "others". |
|
order |
JSON Object |
no |
To allow sorting ascending or descending over a specific index field.
|
|
time |
JSON Object |
no |
Defines a timerange in milliseconds about which data should be respected in the query.
|
|
ignorePreProcessor |
Boolean |
no |
|
If |
chart
Defines how the query results are displayed.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
title |
String |
yes |
Defines a title that is displayed above the widget. |
|
subtitle |
String |
no |
Displays the functional description of the query of this widget. Info will be displayed when clicking the info icon in widget header (pie and column chart). |
|
type |
String |
yes |
"Pie", "Columns", "Histogram" |
|
openTableOnStartup |
Boolean |
no |
|
Whether to show or not to show the table below the Charting widget. |
fillColor |
String |
no |
|
Defines the background color for histogram charts. |
borderColor |
String |
no |
|
Defines the border color for bars in histogram charts. |
Separator Widget
The separator widget is a widget without a query. It can be used to group or separate widgets.
QueryParamSelector Widget
The QueryParamSelector Widget is used to add specific parameters to all queries on the active dashboard. It may be used to restrict the displayed data to match specific fields (e.g. just display data matching an App-Id).
selector_value_query
With this query it is determined, which possible values can be applied for a field to restrict data.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
distinctValues |
Number |
yes |
|
Number of distinct field values to be displayed |
sort |
String |
no |
|
Default sorting of entries is alphabetically ascending. Add "sort":"count" to have a sorting by count descending. |
queryField |
String |
yes |
Name of the field to get aggregated values from, I.E. app_id.raw |
TimeRangeSelector
The TimeRangeSelector Widget allows to define a fixed time range (e.g. the last 7 days) or to choose a custom start and end date (e.g. from 01.01.2015 to 01.04.2015) to filter the displayed data.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
type |
String |
yes |
"TimeRangeSelector" |
|
title |
String |
no |
Defines if a title is displayed. |
|
showRelative |
Boolean |
no |
|
Show or hide the relative time selector which allows to set a fixed time range (e.g. the last 7 days). |
showAbsolute |
Boolean |
no |
|
Show or hide the absolute time selector which allows to set a custom start and end date (e.g. from 01.01.2015 to 01.04.2015) |
preSelectedRelativeTime |
String |
no |
|
Defines which relative time range option is pre-selected. This property is skipped if showRelative is set to false. Applicable values are:
|
Heatmap Widget
The Heatmap widget shows a spatial map which renders the hot spots of the query items.
Note the widget is not performing any coordinate transformation. This means the query definition defines the spatial reference system of the map. All map specific configuration like center and extent must be in this spatial reference system. |
{
"widgetId": "myheatmap",
"itemView": {
"title": "My Heat Map",
"subtitle": "Shows a map of all map extents",
"type": "heatmap"
},
"item_query": {
// the map updates all 60seconds, define a number in milliseconds or false for no updates
"refresh": true,
// the item query
"query": "event_name:\"Map Extent\" AND event_action:Changed AND extent.lod:[6 TO *]",
// the spatial reference system of the queried items
"srs": 3857,
// required so that together with itemCount the newst 2000 items are displayed
"sort": {
"sortField": "event_timestamp",
"order": "desc"
},
// only the last 2000 items should be returned
"itemCount": 2000
}
}
Via the itemView
section a custom basemap can be defined:
{
"itemView": {
...
"type": "heatmap",
"map" : {
// a name of a wellknown basemap , note these basemaps require a srs of 3857 (webmercator).
// see: https://developers.arcgis.com/javascript/3/jsapi/esri.basemaps-amd.html
// for a list of basemap names, the default used is "dark-grey".
"basemap": "ocean",
// the basemap property can also be an URL to a MapServer
"basemap": "https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer"
// if the basemap is defined as an URL and is a tiled map service then it is required to set this property to true.
// Otherwise a tiled service will be loaded as dynamic map service
"basemapIsTiled": true
}
}
}
Via the itemView
section ist is possible to deactivate the automatic zooming to the calculated extend of the heat map and to define a custom initial extent:
{
"itemView": {
...
"type": "heatmap",
// deactivate the zooming to the full extent of the heatmap features, this is enabled by default
"zoomToExtent": false,
"map" : {
// use a combination of center and zoom or scale
"center": {
"x": 1100000,
"y": 6600000
},
// define the zoom level, only valid if tiled map service
"zoom": 5,
// define the target map scale, use only one of zoom or scale!
"scale" : 50000
// or define an explicite extent
"extent" : {
"xmax": 1494955.3992009945,
"xmin": 0,
"ymax": 7252478.179392477,
"ymin": 5685740.342497744
}
}
}
}
Eventstream Widget
The Eventstream Widget provides a visualization of interaction flows of users inside different apps. It is recommended to use this widget type in combination with one ore more QueryParamSelector widgets to ensure a meaningful result.
itemView
Defines how the query results are displayed.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
type |
String |
yes |
"Eventstream" |
|
title |
String |
no |
Defines if a title should be displayed |
|
subtitle |
String |
no |
Displays the functional description of the query of this widget. Info will be displayed when clicking the info icon in widget header (pie and column chart). |
|
streamWidth |
Number |
no |
|
Defines the width of the graphic inside the widget |
streamHeight |
Number |
no |
|
Defines the height of the graphic inside the widget |
widgetWidth |
Number |
no |
|
Defines the width of the the widget |
widgetHeight |
Number |
no |
|
Defines the height of the graphic widget |
session_query
Defines the query for the query to the Elasticsearch index.
Property | Type | Mandatory | Default | Description |
---|---|---|---|---|
refresh |
Boolean | Number |
no |
|
Whether to refresh the widget automatically or not.
If set to If set to a number it will refresh accordingly (Number in milliseconds). |
query |
String |
yes |
|
Defines the elastic search query.
For further info on syntax refer to Elastic Doku |
returnFields |
String Array |
yes |
|
The returned fields of the query. |
displayFields |
String Array |
yes |
|
The displayed fields of the query |
eventMapping |
Array of JSON Objects |
no |
|
Maps unknown events to a |
user_key |
String |
yes |
|
Index field to map a user identifikator |
session_key |
String |
yes |
|
Index field to map an session identifikator |
max_users |
Number |
no |
|
Filter attribute |
max_usersessions |
Number |
no |
|
Filter attribute |
max_sessionevents |
Number |
no |
|
Filter attribute |
sort |
JSON Object |
no |
|
To allow sorting ascending or descending over a specific index field. |