Widgets and widget parameters
The function of widget-config.js
describes the parameters of widget types
defines which widget is connected to TM1 backend
- every widget can be modified by changing parameters in widget-config
during deployment time
- every widget parameter could be override during a user session in
data-repository pressing control, this allow dynamic widget parameterization depend on data query results
the config file is case-sensitive
- listen is a valid parameter in all widget types, structure of listen:
[{event, method, (parameter)}…]
Methods
refresh
refreshWithWaitingForEvent: waits for specified event in parameter
parameter is valid only for method refreshWithWaitingForEvent
updateContent: updates only the data, not refresh the HTML code
Common Parameters
marginTop: pixel count or percent of padding position
marginRight: pixel count or percent of padding position
marginBottom: pixel count or percent of padding position
marginLeft: pixel count or percent of padding position
paddingTop: pixel count or percent of padding position
paddingRight: pixel count or percent of padding position
paddingBottom: pixel count or percent of padding position
paddingLeft: pixel count or percent of padding position
width
height
visible
ComboChartWidget
Overview
A chart widget that allows to combine the features of a bar chart and a line chart.
Usage example
{
type:string,
label:string,
borderColor:string,
backgroundColor:string,
pointRadius:int,
borderWidth:int,
fill:boolean,
stack:int
}
Configuration
data:datasets:paddingTop:paddingRight:padding Bottom:PaddingLeft:tooltipsEnabled: true or false, parameters of dataset are shown on mouse hovertooltipsMode: mode of hover tooltip menulegendGroupByStack: makes group from dataset legendsskin: Selected skin of widgetplot: true or false, not just y, but x values are also given (not just categories, like years, types, etc.)id: widget id which used for reference in frameworkxAxesLabel: label of X axesxAxesDisplay: true or false,, default true, display the x axesxAxesGridLinesDisplay: true or false, display the x axes grid linesxAxesGridLinesDrawBorder: true or false, display the x axes grid lines drow borderxAxesGridLinesDrawOnChartArea: true or false, display the x axes grid lines draw on chart arexAxesGridLinesDrawTicks: true or false, display the x axes grid lines draw ticksxAxesGridLinesColor: color of the x axes grid linesxAxesTicksFontSize: size of the x axes ticksxAxesTicksFontFamily: string, default ‘imago, sans-serif’xAxesTicksFontStyle: string, default ‘bold’xAxesTicksFontColor: color of the x axes ticksxAxesTicksPadding: padding between X axes ticksxAxesTicksOffset:xAxesLabelDisplay: true or false, display the x axes labelxAxesLabelFontSize: size of the x axes labelxAxesLabelFontFamily: font family of the x axes labelxAxesLabelFontColor: color of the a axes labelxAxesLabelFontStyle: style of the x axes labelxAxesLabelPadding: padding between X axes labelxAxesLabelRotation: vertical, horizontalxAxesStacked: stack datasets on X axesxAxesTicksBegintAtZero: true or false, begin the x axes at zeroxAxesOffsetGridLines: if true, grid lines will be shifted to be between labelsxAxesZeroLineColor: color of the X axes zero lineleftYAxesDisplay: true or false, display the left y axesleftYAxesBorderDash: length and spacing of dashes on grid linesleftYAxesStacked: stack datasets on Y axesleftYAxesMin: minimum of the left y axesleftYAxesMax: max of the left y axesleftYAxesStepSize: step size of the left y axesleftYAxesZeroLineColor: color of the left Y axes zero lineleftYAxesGridLinesDisplay: true or false, display the left y axes grid linesleftYAxesGridLinesDrawBorder: first grid line is visible, even if others are notleftYAxesGridLinesColor: color of the left y axes grid linesleftYAxesGridLinesDrawOnChartArea: true or false, display the y axes grid lines draw on chart areleftYAxesGridLinesDrawTicks: true or false, display the left y axes grid line ticksleftYAxesLabel: label of the left y axesleftYAxesLabelConcat: str to add to the left Y axes ticksleftYAxesLabelFontSize: font size of the left y axes labelleftYAxesLabelFontFamily: font family of the left y axes labelleftYAxesLabelFontColor: font color of the left y axes labelleftYAxesLabelFontStyle: font style of the left y axes labelleftYAxesLabelPadding: padding between Y axes labelleftYAxesLabelRotation: vertical, horizontalleftYAxesTicksBegintAtZero: true or false, begin the left y axes with zeroleftYAxesTicksFontSize: font size of the left y axes ticksleftYAxesTicksFontFamily: font family of the left y axes ticksleftYAxesTicksFontStyle: font style of the left y axes ticksleftYAxesTicksFontColor: font color of the left y axes ticksleftYAxesTicksPadding: padding between Y axes ticksleftYAxesTicksDisplay: true or false, display the left y axes ticksleftYAxesTicksOffset: offset (distance) between ticks of left Y axesleftYAxesLabelSeparatesThousands: Separates the Y AxesrightYAxesBorderDash: length and spacing of dashes on grid linesrightYAxesTicksBegintAtZero: begin at zero the right y axes ticksrightYAxesTicksPadding: padding between Y axes ticksrightYAxesTicksDisplay: true or false, display the right y axes ticksrightYAxesGridLinesDisplay: true or false display the right y axes grid linesrightYAxesLabel: label of the right y axes labelrightYAxesLabelDisplay: true or false, display the right y axes labelrightYAxesLabelFontColor: color of the right y axes labelrightYAxesLabelFontFamily: font family of the right y axes labelrightYAxesLabelFontSize: size of the right y axes labelrightYAxesLabelFontStyle: style of the right y axes labelrightYAxesLabelPadding: padding between Y axes labelrightYAxesLabelRotation: vertical, horizontalrightYAxesStacked: stack datasets on Y axesrightYAxesDisplay: true or false, display the right y axes displayrightYAxesGridLinesColor: color of the right y axes grid linesrightYAxesGridLinesDrawBorder: border of the right y axes grid linesrightYAxesTicksFontColor: color of the right y axes ticksrightYAxesTicksFontFamily: font family of the right y axes ticksrightYAxesTicksFontSize: size of the right y axes ticksrightYAxesTicksFontStyle: style of the right y axes ticksrightYAxesTicksOffset: offset (distance) between ticks of right Y axescanvasHeight: height of the canvascanvasWidth: width of the canvasdraggable: true or false, if chart is draggable and moveableresponsive: true or false, chart size depends on screen sizeaspectRatio:maintainAspectRatio: true or false, width depends on heightbezierCurve: true or false, display the bezier curveshowLinearXAxes: true or false, display the linear x axescustomLabelsForYAxes: Labels For Y Axes like %tooltipsSeparatesThousands: Separates the the tooltips
TM1 integration
Data connection: YES
Repository behaviour
2 init queries:
query for X-axis labels Structure: {value:, label:}
parsingControl type: list
query for data Structure: {value:}
parsingControl type: matrix
Usage example
{
Widgetconfig:
{
id: 'hrdemoReportChart1',
type: ComboChartWidget,
width: '800',
height: '400',
title: '',
datasets: [{
"type": "line",
"backgroundColor": "rgba(52,199,89,0.4)",
"borderColor": "#34C759",
"borderWidth": 1,
"pointRadius": 0,
"stack": 1,
legendBackgroundColor: "#34C759",
"dataLabelFontColor": "#fff",
"dataLabelVisible": false,
"fill": true,
dataLabelBorderRadius: 5,
"legendLabel": "Base"
},
{
"type": "line",
"backgroundColor": "rgba(0,122,255,0.4)",
"borderColor": "#007AFF",
"borderWidth": 2,
"pointRadius": 0,
legendBackgroundColor: "#007AFF",
"stack": 2,
dataLabelBorderRadius: 5,
"dataLabelFontColor": "#fff",
"dataLabelVisible": false,
"fill": true,
"legendLabel": "Budget"
}],
tooltipsEnabled: true,
marginBottom: '50',
skin: 'combochartFTE',
legendGroupByStack: true,
bezierCurve: false,
xAxesGridLinesDisplay: true,
xAxesGridLinesDrawBorder: true,
xAxesTicksFontSize: 14,
xAxesTicksFontFamily: 'SFCompactDisplay, sans-serif',
xAxesTicksFontColor: '#333333',
xAxesTicksBegintAtZero: false,
xAxesTicksPadding: 10,
xAxesLabelFontSize: 12,
xAxesLabelFontFamily: 'imago, sans-serif',
xAxesLabelFontColor: '#747b85',
xAxesZeroLineColor: '#dee1e5',
leftYAxesDisplay: true,
leftYAxesStacked: false,
leftYAxesZeroLineColor: '#dee1e5',
leftYAxesGridLinesDisplay: true,
leftYAxesGridLinesDrawBorder: true,
leftYAxesGridLinesColor: '#dee1e5',
leftYAxesGridLinesDrawOnChartArea: true,
leftYAxesGridLinesDrawTicks: true,
leftYAxesLabelFontSize: 12,
leftYAxesLabelFontFamily: 'imago, sans-serif',
leftYAxesLabelFontColor: '#747b85',
leftYAxesLabelFontStyle: 'normal',
leftYAxesLabelPadding: 10,
leftYAxesTicksFontSize: 21,
leftYAxesTicksPadding: 20,
leftYAxesTicksFontStyle: 'normal',
leftYAxesTicksFontFamily: 'SFCompactDisplay, sans-serif',
leftYAxesTicksFontColor: '#333333',
leftYAxesTicksDisplay: true,
rightYAxesLabelFontSize: 12,
}
// repository.js
init: [
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoReportChart1_init_1',
year: v('hrdemoReportRow1Cell3SegmentedControl').selected === '2024' ? '2024' : '2023'
};
},
parsingControl: {
type: 'list',
query:
(r, x) => {
return {
value: (r.Cells[x].Members[4].Name).slice(4, 6),
label: (r.Cells[x].Members[4].Name).slice(4, 6)
};
}
}
},
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoReportChart1_init_2',
year: v('hrdemoReportRow1Cell3SegmentedControl').selected === '2024' ? '2024' : '2023'
};
},
parsingControl: {
type: 'matrix',
length: 2,
query: [
(r, x) => {
return {value: parseInt(r.Cells[x].FormattedValue)};
},
(r, x) => {
return {value: parseInt(r.Cells[x + 1].FormattedValue)};
}
]
}
}
]
}
ContainerWidget
Overview
A logical widget that allows the creation of multi-layered applications. A ContainerWidget provides the same functionality as a page widget (contains other widgets) but on top of the main application UI layer. The widget does not necessarily covers the whole available screen: it can be in a small area (for example a popup)
Configuration
id: widget id which used for reference in frameworkanchor: anchor to link the containerwidthStr:heightStr: height of widget (in % or px)offset: size of the offsetbgColor: background color of the widgetanchorVisible: if anchor visible (flag)anchorOnClick: toggle backdrop (flag)visible: if widget visible (flag)bgScrollable: scrollability of the background (flag)closeBtn: if widget has a close button(flag)fixed: if widget fixed (flag)position: position of the widgetskin: skin of the widgetbackdrop: boolean if display backdrop, default falsecloseOnClickBackdrop: boolean, default trueheightFixed: boolean, default truepositionAndCalculateBestSpace: string (right, left)fadingSpeed: int, default 300
TM1 integration
Data connection: NO
Usage example
// widget-config.js
{
{
id: 'hrdemoSimulationVersionSelectorPopUp',
type: ContainerWidget,
anchorVisible: false,
anchorOnClick: true,
backdrop: true,
visible: false,
closeBtn: false,
width: '285px',
heightFixed: false,
bgScrollable: true,
fixed: true,
behaviour: 'popup',
positionAndCalculateBestSpace: 'bottom',
skin: 'version_popup4',
fadingSpeed: 0,
widgets: [
{
id: 'hrdemoSimulationVersionSelectorPopUpDropbox',
type: DropBoxWidget,
skin: 'version_dropbox',
multiSelect: false,
hideIfNoData: false,
selectFirst: true,
}
]
},
}
}
DatePickerWidget
Overview
This widget allows users to select a date
Configuration
allowEmptyDate: Allows selecting no date (empty value)closeAfterSelectingTheDate: Closes the calendar popup after a date is selecteddatePicked: Initially selected date in the widget (format: yyyy.mm.dd or yyyy.mm)editable: Determines if the input field is editable manuallyfullYearButtonText: Label of the full year selection buttonfullYearButtonVisible: Whether the full year button is visiblelocal: Locale used for formatting the displayed datemaxDate: Maximum selectable dateminDate: Minimum selectable datemonthLocale: Locale used for displaying month names (e.g. ‘en-US’)monthPicker: Enables month-only selection mode (year + month, no days)ordinal: Unique string to distinguish pick actions (used internally)panelFixed: Prevents the calendar popup from closing automaticallyskin: Selected skin of the widget (affects visual appearance)title: Title text displayed above the date fieldtitleVisible: Determines if the title should be shown
TM1 integration
Data connection: OPTIONAL
Repository behaviour
- state query or init query, if no min and max date defined, used query
is init then:
parsingControl type: object
datePicked
minDate
maxDate
pick query:
optional query, that will be fired every time, once a date is selected
Usage example
// widget-config.js
{
id: 'hrdemoSimulationHireOrganisationPopUpGridRow4DatePicker',
type: DatePickerWidget,
width: '319px',
skin: 'headcount_popup_datepicker',
icon: 'icon-calendar',
label: '',
panelFixed: true,
multiSelect: false,
hideIfNoData: false,
selectFirst: true,
}
// repository.js
hrdemoAddDummyPopupGridRow5Cell2DatePicker: {
pick() {
Api.updateWidgetsContent(['hrdemoAddDummyPopupGridRow9Cell2Text', 'hrdemoAddDummyPopupGridRow11Cell2Text', 'hrdemoAddDummyPopupGridRow10Cell2TextBox']);
}
},
}
DropBoxWidget
Overview
This widget is used to select one single or multiple items at a time from a given list of items.
Configuration
backdrop: boolean, default false, whether the backdrop is displayededitable: boolean, default trueitemIconOff: string, iconitemIconOn: string, icondisableSearch: disable search functionpanelWidth: Width of the panelplaceHolder:selectFirst: boolean, default false, if there is no selected item the first displayed as selectedserverSideFilter:titleFontSize: font size of the titletitleFontColor: font color of the titletextFontSize: font size of the texttextFontColor: font color of the texttitleTextAlignment: alignment of the titletextAlignment: alignment of the texttitle: title of the drop-downtitleVisible: if widget title visible (flag)multiselect: simple or multiple options can be selected (flag)hideIfNoData: hide widget if no data inside (flag)skin: skin of the widget
TM1 integration
Data connection: OPTIONAL
Repository behaviour
state query or init query. If no items used query is init then:
parsingControl type: list or object (in case of PicklistValues)
name
on
choose query:
optional query, that will be fired every time, once an element is selected or deselected
Usage example
// repository.js
{
hrdemoSimulationCompensationChangePopUpGridRow6Cell2DropBox: {
choose() {
Utils.setWidgetValue('compChangePosition', v('hrdemoAddDummyPopupGridRow6Cell2DropBox').value);
Utils.setWidgetValue('systemValueNewBonusValue', '0');
Api.updateWidgetsContent(['hrdemoSimulationCompensationChangePopUpGridRow9Cell2Text', 'hrdemoSimulationCompensationChangePopUpGridRow11Cell2Text', 'hrdemoSimulationCompensationChangePopUpGridRow10Cell2TextBox']);
},
init() {
return new RestRequest(this.restRequest)
},
restRequest:
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoAddDummyPopupGridRow6Cell2DropBox_init'
};
},
parsingControl: {
type: 'list',
query:
(r, x) => {
let selected = v('compChangePosition');
return {
name: r.Cells[x].FormattedValue,
on: r.Cells[x].FormattedValue === selected
};
}
}
}
},
}
GaugeWidget
Overview
A gauge chart primary used in executive dashboard reports to show KPI-s.
Configuration
canvasId:title: Widget title textcolors: color of the widgetskin: Selected skin of widgetvalues: The values on the chartvalueLabels:labels: the labels on the chartminRange: the minimum value on the chartmaxRange: the maximum value on the chartshowAxisValues: It’s a boolean, default trueseparatesThousands: It’s separates the valuesfontFamily: font family of the chart
TM1 integration
Data connection: YES
Repository behaviour
1 init query:
query for data Structure: {values: [x, y, z], labels:, minRange:, maxRange:}
parsingControl type: matrix
Usage example
// widget-config.js
{
id: 'hrdemoSimulationRow3CellGauge',
type: GaugeWidget,
width: '200',
showAxisValues: true,
colors: ["#007AFF", "#858686"],
fontFamily: 'imago, sans-serif',
skin: 'simulation_gauge',
separatesThousands: true
}
// repository.js
hrdemoSimulationCompensationChangePopUpGridRow6Cell2DropBox: {
choose() {
Utils.setWidgetValue('compChangePosition', v('hrdemoAddDummyPopupGridRow6Cell2DropBox').value);
Utils.setWidgetValue('systemValueNewBonusValue', '0');
Api.updateWidgetsContent(['hrdemoSimulationCompensationChangePopUpGridRow9Cell2Text', 'hrdemoSimulationCompensationChangePopUpGridRow11Cell2Text', 'hrdemoSimulationCompensationChangePopUpGridRow10Cell2TextBox']);
},
init() {
return new RestRequest(this.restRequest)
},
restRequest:
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoAddDummyPopupGridRow6Cell2DropBox_init'
};
},
parsingControl: {
type: 'list',
query:
(r, x) => {
let selected = v('compChangePosition');
return {
name: r.Cells[x].FormattedValue,
on: r.Cells[x].FormattedValue === selected
};
}
}
}
},
GridCellWidget
Overview
Logical widget type representing one cell of a GridRowWidget
Configuration
id: widget id which used for reference in frameworktype: type of widgetmarginLeft: left marginmarginRight: right marginmarginTop: top marginmarginBottom: bottom marginwidth: width of the widget (in % or px)height: height of the widgetvisible: if widget visible (flag)skin: skin of the widgetalignment: alignment of the widget (dropbox)listen: {event, method} events for the widget listen to and method to do
TM1 integration
Data connection: NO
Usage example
// widget-config.js
{
id: 'hrdemoSimulationRow3Cell2',
type: GridCellWidget,
alignment: 'center-left',
width: '65%',
widgets: []
}
GridRowWidget
Overview
Logical widget type representing one row of a GridWidget
Configuration
id: Widget Id which used for reference in frameworktype: Type of Widgetvisible: Toggle visibility of panel contentwidth: width of the widgetheight: height of widgetmarginLeft: pixel count of margin positionmarginRight: pixel count of margin positionmarginTop: pixel count of margin positionmarginBottom: pixel count of margin positionalignment: left, center or right sidelisten: {event, method} events for the widget listen to and method to doskin: Selected skin of widgetwidgets: [{id: ‘tab1name’,label: ‘text’,action: ‘text’,selected: true},…
TM1 integration
Data connection: NO
Data connection: NO
Usage example
// widget-config.js
{
id: 'hrdemoSimulationRow4',
type: GridRowWidget,
width: '100%',
height: '70px',
widgets: []
}
GridTableCellWidget
Overview
Logical widget type representing one cell of a GridTableWidget. Main purpose: contain one widget from the followingtypes text, textbox, dropBox, slider, toggle, datepicker
Configuration
borderLeft:borderRight:cellBackgroundColorcellVisible:cellSkin:cellWidth:cellPaddingRight:cellPaddingLeft:paddingRightpaddingLeftskin: skin of the widgetalignment: string, default center-center alignment of the contained widget (dropbox)top-leftcenter-leftbottom-lefttop-centercenter-centerbottom-centertop-rightcenter-rightbottom-righttop-space-betweencenter-space-betweenbottom-space-between
borderLeft: if widget has a left border (flag)borderRight: if widget has a right border (flag)width
TM1 integration
Data connection: NO
Usage example
// widget-config.js
{
id: 'hrdemoSimulationCell4',
type: GridTableCellWidget,
width: '100%',
height: '70px',
widgets: []
}
GridTableHeaderCellWidget
Overview
Logical widget type representing one cell of a GridTableHeaderRowWidget.
Configuration
cellHeaderSkin:cellVisible:alignment: alignment of the widgettop-leftcenter-leftbottom-lefttop-centercenter-centerbottom-centertop-rightcenter-rightbottom-righttop-space-betweencenter-space-betweenbottom-space-between
borderLeft: true or false, toggle the left border visibility of the tableborderRight: true or false, toggle the right border visibility of the tablewidth:
TM1 integration
Data connection: 1
Usage example
// widget-config.js
{
id: 'hrdemoSimulationHeaderCell4',
type: GridTableHeaderCellWidget,
width: '100%',
height: '70px',
widgets: []
}
GridTableHeaderRowWidget
Overview
A technical sub-widget built specifically for the GridTableWidget. It provides the ability to make and customize a header for a GridTable. Main purpose: group together GridTableHeaderCellWidgets.
Configuration
alignment: alignment of the widget (dropbox)borderBottom: if widget has a bottom border (flag)borderTop: if widget has a top border (flag)height:
TM1 integration
Data connection: NO
Usage example
// widget-config.js
{
id: 'hrdemoSimulationHeaderRow4',
type: GridTableHeaderRowWidget,
width: '100%',
height: '70px',
widgets: []
}
GridTableLightWidget
Overview
GridTableLightWidget is the lightweight successor of
GridTableWidget. Instead of creating individual child widgets per
cell it renders the entire table directly from the data returned by the
repository. This dramatically simplifies widget configuration while the
runtime still supports:
sticky/frozen headers and columns,
copy-to-clipboard support that respects the user’s current selection,
paging with context aware requests,
Excel export (full dataset or current page),
the familiar event map for
launch,changeandtext_changeevents.
The widget is ideal for large datasets, grids generated from TM1 MDX responses, or any scenario where the classic grid widgets caused configuration bloat. The helloanalogic demo application showcases three flavours of the widget (interactive, compact card-style and plain text) so the examples below reference those assets for consistency.
Typical use cases
Planning dashboards: render multi-thousand row TM1 cubes without pre-creating child widgets and still offer inline editing for text fields or combo boxes.
Operations consoles: blend button, select and custom HTML cells to trigger repository logic (launching detail pages, reassigning owners, etc.).
Read-only reports: emit a simple
columns+ matrixcontentpayload to display an existing table with frozen columns.
Widget configuration
Only a handful of parameters are defined in widget-config.js because
almost every behaviour is described by the repository payload:
id(required): unique identifier used by events and the repository.type(required): alwaysGridTableLightWidget.skin(optional): CSS skin applied to the widget container.pageSize(optional): default page size override when the repository honours paging metadata.
Example from apps/helloanalogic/static/assets/js/configs/widget-config.js:
Usage example
{
id: 'gridTableLightDemoTable',
type: GridTableLightWidget,
skin: 'gridTableLightDemo'
}
{
id: 'gridTableLightCompactTable',
type: GridTableLightWidget,
skin: 'gridTableLightCompact'
}
{
id: 'gridTableLightTextTable',
type: GridTableLightWidget,
skin: 'gridTableLightText'
}
// Commented examples demonstrating server driven paging
// {
// id: 'gridTableLightServerTable',
// type: GridTableLightWidget,
// skin: 'gridTableLightDemo'
// },
// {
// id: 'gridTableLightServerTable2',
// type: GridTableLightWidget,
// skin: 'gridTableLightDemo',
// pageSize: 20
// }
Repository contract
The repository (apps/helloanalogic/static/assets/js/configs/repository.js)
drives almost everything:
initmust return an object withcolumnsandcontent. Thecolumnsarray describes column keys, titles and optional sizing or alignment.contentis a list of rows; each row can either be a shorthand array of raw values (text only) or an object withcellsdescribing individual cell types.Optional metadata extends behaviour without updating the widget config:
totalCount,page,pageSize,allowCopyToClipBoard,freezeHeader,freezeFirstColumns,enableExportorexportConfig.Styling hooks accept strings, plain objects or arrays at multiple levels (root container, table, rows, cells, rendered element).
Event handlers
launch,changeandtext_changereceive the familiar grid context (ctx.getRow(),ctx.getColumn(),ctx.getCell()) so repository logic can coordinate updates across widgets.
The gridTableLightDemoTable repository entry demonstrates interactive
cells, paging, export and styling:
Usage example
gridTableLightDemoTable: {
init(ctx) {
const extra = ctx && ctx.getExtraParams ? ctx.getExtraParams() : {};
const DEFAULT_PAGE_SIZE = 100;
const requestedPageSize = typeof extra.pageSize === 'number' ? extra.pageSize : DEFAULT_PAGE_SIZE;
const pageSize = requestedPageSize === 0 ? 0 : (requestedPageSize || DEFAULT_PAGE_SIZE);
const totalCount = 20000;
const page = extra.page ? Math.max(1, parseInt(extra.page, 10) || 1) : 1;
const startIndex = pageSize ? Math.max(0, (page - 1) * pageSize) : 0;
const endIndex = pageSize ? Math.min(totalCount, startIndex + pageSize) : totalCount;
const columns = [];
for (let idx = 0; idx < Math.min(30, Math.max(6, v('gridTableLightDemoColumnCount') || 20)); idx++) {
// ...push column descriptors (record, status, owner, etc.)
}
const content = [];
for (let index = startIndex; index < endIndex; index++) {
// ...compose cells with text/combo/button/custom types and styling
}
return {
columns,
content,
totalCount,
page,
pageSize,
allowCopyToClipBoard: true,
freezeHeader: true,
freezeFirstColumns: 2,
enableExport: true,
exportConfig: {fileName: 'grid-table-light-demo.xlsx'},
rootClasses: ['grid-table-light-demo-root'],
tableClasses: 'grid-table-light-demo-table',
bodyStyle: 'max-height:520px'
};
},
launch(ctx) { /* update info banner */ },
change(ctx) { /* owner select change */ },
text_change(ctx) { /* inline rename */ }
}
Other repository entries show specialised payloads:
gridTableLightCompactTablebuilds rows entirely in memory, returns apageSizethat matches the total row count, and logs events.gridTableLightTextTablesends acolumnsarray and a plain two-dimensionalcontentarray for read-only scenarios.gridTableLightDemoInfoTextreacts to widget events to display the last user action.
Server backed MDX examples
Two commented repository entries document how to connect a
GridTableLightWidget directly to TM1 MDX queries. Although disabled
in the demo, the snippets are production ready:
Usage example
gridTableLightServerTable: {
init() {
return new RestRequest(this.request);
},
request: {
url: () => '/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name, Attributes/Editable))',
type: 'POST',
server: true,
body: () => ({key: 'safariAssetRegister2_mdx'}),
parsingControl: {
type: 'script',
script: (data) => {
const transformed = Utils.transformMdxResponseToGridTableLight(data);
return Object.assign({
freezeHeader: true,
allowCopyToClipBoard: true,
enableExport: true,
exportConfig: {fileName: 'safari-asset-register.xlsx'}
}, transformed);
}
}
}
}
gridTableLightServerTable2: {
init() {
return new RestRequest(this.request);
},
request: {
url: (widgets, ctx) => {
const baseUrl = '/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name, Attributes/Editable))';
const result = Utils.buildMdxQueryUrl(baseUrl, {
includeCount: true,
columnCount: GRID_TABLE_LIGHT_SERVER_TABLE2_COLUMN_COUNT,
defaultRowCount: GRID_TABLE_LIGHT_SERVER_TABLE2_DEFAULT_ROW_COUNT,
metadataKey: GRID_TABLE_LIGHT_SERVER_TABLE2_METADATA_KEY,
returnMetadata: true
}, ctx);
return result && result.url ? result.url : baseUrl;
},
type: 'POST',
server: true,
body: () => ({key: 'safariAssetRegister2_mdx'}),
parsingControl: {
type: 'script',
script: (data, widgetId, repoObj, ctx) => {
const transformed = Utils.transformMdxResponseToGridTableLight(data);
const metadata = ctx && ctx[GRID_TABLE_LIGHT_SERVER_TABLE2_METADATA_KEY] ? ctx[GRID_TABLE_LIGHT_SERVER_TABLE2_METADATA_KEY] : {};
const pageSize = Number.isFinite(metadata.rowCount) && metadata.rowCount > 0 ? metadata.rowCount : GRID_TABLE_LIGHT_SERVER_TABLE2_DEFAULT_ROW_COUNT;
const page = Number.isFinite(metadata.page) && metadata.page > 0
? metadata.page
: (metadata.exportAll ? 1 : (pageSize > 0 ? Math.floor((metadata.skipRows || 0) / pageSize) + 1 : 1));
const countValue = data ? data['Cells@odata.count'] : undefined;
const parsedCountValue = typeof countValue === 'number' ? countValue : Number.parseInt(countValue, 10);
const totalCount = Number.isFinite(parsedCountValue)
? Math.ceil(parsedCountValue / (metadata.columnCount || GRID_TABLE_LIGHT_SERVER_TABLE2_COLUMN_COUNT))
: Math.max(0, (transformed.content || []).length + (metadata.exportAll ? 0 : (metadata.skipRows || 0)));
return Object.assign({
pageSize,
page,
totalCount,
freezeHeader: true,
allowCopyToClipBoard: true,
enableExport: true,
exportConfig: {fileName: 'safari-asset-register-paged.xlsx'}
}, transformed);
}
}
}
}
The first example performs a one-shot MDX execution and enriches the
transformed payload with clipboard and export toggles. The second
example shows how to honour paging metadata stored on the context object
(ctx) so Excel export can temporarily request pageSize: 0 and the
client can fetch all rows.
Implementation checklist
Add the widget to
widget-config.jswith the desired skin.Implement a repository
initmethod that returnscolumnsandcontent(plus optional metadata).Wire event handlers to update auxiliary widgets (see
gridTableLightDemoInfoTextin the demo).When loading data from TM1 or another REST source, wrap the request with
RestRequestand convert the payload usingUtils.transformMdxResponseToGridTableLight.Optionally store paging/column settings in
ctxor widget values to persist user selections across refreshes.
By following the above steps you can replace verbose GridTableWidget
setups with a single lightweight configuration while retaining full
control over styling, behaviour and TM1 integrations.
GridTablePlusWidget
Overview
GridTablePlusWidget embeds a full Tabulator
instance inside Analogic. It accepts high level column and cell metadata
from the repository, translates them to Tabulator column definitions and
renders the grid with built-in support for grouping, selection, inline
editing and clipboard integration. Compared to
GridTableLightWidget it targets interactive dashboards where Tabulator’s
rich feature set (re-sizable columns, range selection, context menus,
custom formatters/editors) is required out of the box.
Typical use cases
Portfolio tables: grouped, filterable project lists with context menus and inline editing as showcased by
analogicTableDemoTableinhelloanalogic.【F:apps/helloanalogic/static/assets/js/configs/repository.js†L964-L1035】【F:apps/helloanalogic/static/assets/js/configs/widget-config.js†L6433-L6484】Ad-hoc data grids: quickly render TM1 payloads or custom arrays with editors/filters for each column, such as the
analogicTableDemoSimpleTableexample.【F:apps/helloanalogic/static/assets/js/configs/repository.js†L1102-L1284】【F:apps/helloanalogic/static/assets/js/configs/widget-config.js†L6485-L6529】Embedded analytics: mix standard Tabulator options (grouping, clipboard, tooltips) with Analogic skins to build rich analysis panels without wiring dozens of child widgets.【F:apps/helloanalogic/static/assets/js/configs/repository.js†L977-L1003】【F:apps/helloanalogic/static/assets/js/configs/widget-config.js†L6459-L6479】
Widget configuration
Only a minimal configuration lives in widget-config.js because
Tabulator behaviour is mostly repository-driven:
id(required): unique widget identifier.type(required): must beGridTablePlusWidget.title: optional caption displayed above the table.minWidth/width/height: sizing hints passed to the widget container.【F:apps/helloanalogic/static/assets/js/configs/widget-config.js†L6465-L6484】【F:apps/helloanalogic/static/assets/js/configs/widget-config.js†L6506-L6527】hideIfNoData: hides the widget when the repository returns no rows.【F:apps/helloanalogic/static/assets/js/configs/widget-config.js†L6465-L6484】tabulatorOptions: default Tabulator options merged with repository-supplied settings (for example layout, selection mode or tooltips).【F:apps/helloanalogic/static/assets/js/configs/widget-config.js†L6468-L6480】【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L51-L96】tabulatorColumnOptions/tabulatorEvents: optional overrides for individual columns or Tabulator callbacks that are merged with the repository payload.【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L47-L96】
Widget behaviour
At runtime GridTablePlusWidget merges three sources of options: the
widget configuration, repository payload and data-driven column/cell
metadata. Columns returned by the repository are normalised, default
formatters are wrapped to ensure Analogic styling, and the widget keeps a
cellData matrix for quick access to the underlying metadata during
events.【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L53-L124】 Tabulator receives the combined
definition via prepareTabulatorSetup and is recreated when the
repository sends fresh data.【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L69-L124】
Repository contract
The repository entry must return an object with the following keys:
columns: an array of column definitions (title,field, optional formatter/editor, alignment etc.). The widget augments each column with Tabulator-specific defaults and merges overrides fromtabulatorColumnOptions.【F:apps/helloanalogic/static/assets/js/configs/repository.js†L965-L1002】【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L69-L111】data: either plain values or Analogic cell objects (value,displayValue,metadata). Each row is converted into Tabulator data while preserving the__analogicCellsmap for event handlers. 【F:apps/helloanalogic/static/assets/js/configs/repository.js†L1005-L1048】【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L96-L124】options: additional Tabulator options (grouping, clipboard, height etc.) that are merged with widget and default settings.【F:apps/helloanalogic/static/assets/js/configs/repository.js†L976-L1003】【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L102-L124】events: map of Tabulator event names to repository functions (for exampletableBuiltorcellEdited). The widget binds them and exposes helpers likectx.getTabulator(),ctx.getRowComponent()orctx.getCell()for deeper integrations.【F:apps/helloanalogic/static/assets/js/configs/repository.js†L1003-L1067】【F:analogic/static/assets/js/widgets/grid-table-plus/grid-table-plus.js†L47-L124】
Usage example
helloanalogic demonstrates two variations:
// widget-config.js
{
id: 'analogicTableDemoTable',
type: GridTablePlusWidget,
title: 'Project Portfolio Overview',
minWidth: 960,
hideIfNoData: false,
tabulatorOptions: {
height: '520px',
layout: 'fitDataStretch',
movableColumns: true,
resizableColumnFit: true,
selectable: true,
selectableRangeMode: 'drag',
tooltipGenerationMode: 'hover'
}
}
// repository.js
{
analogicTableDemoTable: {
init() {
return {
columns,
data: rows,
options: {
groupBy: 'department',
placeholder: 'No project portfolio data available',
clipboard: true
},
events: {
tableBuilt: 'tableBuilt',
rowSelectionChanged: 'selectionChanged',
cellClick: 'cellClicked',
cellEdited: 'cellEdited'
}
};
}
}
}
The simplified table follows the same contract but returns synthetic
cells and only subscribes to cellEdited events, proving that the
widget can handle both complex and lightweight use cases with the same
API.【F:apps/helloanalogic/static/assets/js/configs/repository.js†L1102-L1284】
GridTableWidget
Overview
A table-type widget for displaying data in rows and columns. Unlike the HorizontalTableWidget the content is not read-only and the gridTableCells can contain nearly any type of widgets. The main difference between the GridWidget and the GridTableWidget is that in the GridTableWidget the cells in the same column always contain the same widget (except for the header row).
Configuration
hideIfNoData:skin: Selected skin of widgetmaxRows:minWidth:allowFullContentUpdated:allowChangedDataUpdate:allowCopyToClipBoard:disableRefreshGridCell:width:borderTop: true or false, toggle the top border visibility of the tableborderBottom: true or false, toggle the bottom border visibility of the tablerowHeight: toggle the height of the row
TM1 integration
Data connection: YES
Repository behaviour
all data query of widgets in grid table are written here
- init/state query for each widget (label for button, title/body for
text, value for slider, etc.)
parsing control: matrix, widgets in columns
- column visibility is also defined here: cellVisible parameter in
parsing
cell background color: cellBackgroundColor parameter in parsing
GridWidget
Overview
Logical widget type to contain other widgets arranged in an orthogonal grid.
Configuration
id: widget id which used for reference in frameworktype: type of widgetskin: skin of the widgetlisten: {event, method} events for the widget listen to and method to do
TM1 integration
Data connection: NO
HistogramComboChartWidget
Overview
A combination chart which combines the features of a histogram and a line chart.
Configuration
id: Widget Id which used for reference in frameworktype: Type of Widgettitle: title of the widgetpaddingTop:paddingRight:paddingBottom:paddingLeft:datasets:xAxesGridLinesDrawOnChartArea:yAxesGridLinesDrawOnChartArea:xAxesLabelRotation:yAxesLabelRotation:xAxesDisplay: Display of the x AxesyAxesGridLinesDrawBorder: display the lines on y axesxAxesGridLinesDrawBorder: display the lines on x axesyAxesTicksPadding: Padding of the y Axes ticksxAxesTicksPadding: Padding of the x Axes ticksxAxesTicksOffset: Off sett of the x Axes ticksyAxesTicksOffset: Off sett of the y Axes ticksxAxesLabelDisplay: Boolean, display of the x Axes labelyAxesLabelDisplay: Boolean, display of the y Axes labelxAxesLabelFontSize: Font size of the x Axes labelyAxesLabelFontSize: Font size of the y Axes labelyAxesLabelPadding: Padding of the y axes labelxAxesLabelPadding: Padding of the x axes labelaspectRatio:maintainAspectRatio:datasetHistogram: dataset of the histogramdatasetsLine: dataset of the line(s)listen: {event, method} events for the widget listen to and method to doxAxesGridLinesDisplay: true or false, display the x axes grid linesxAxesGridLinesColor: color of the x axes grid linesxAxesTicksFontSize: size of the x axes ticksxAxesTicksFontFamily: font family of the x axes ticksxAxesTicksFontStyle: font style of the x axes ticksxAxesTicksFontColor: color of the x axes ticksyAxesDisplay: true or false, display the y axesyAxesGridLinesDisplay: true or false, display the y axes grid linesyAxesGridLinesColor: color of the y axes grid linesyAxesTicksFontSize: size of the y axes ticksyAxesTicksFontFamily: font family of the y axes ticksyAxesTicksFontStyle: font style of the y axes ticksyAxesTicksFontColor: color of the y axes ticksxAxesLabelFontFamily: font family of x axes labelxAxesLabelFontColor: color of the x axes labelyAxesLabelFontFamily: font family y axes labelyAxesLabelFontColor: color of the y axes labelyAxisStacked: stack datasets on Y axesxAxisLabel: label of the x axisyAxisLabel: y axis labelhistYAxisBufferTop: buffer on the top of the maximum value (%) on the histogramhistYAxisBufferBottom: buffer on the bottom of the minimum value (%) on the histogramlineYAxisBufferTop: buffer on the top of the maximum value (%) on the linelineYAxisBufferBottom: buffer on the bottom of the minimum value (%) on the lineyAxesGridLinesNum: number of grid line on Y axeswidgets: segmentedBar widget ID (see on figure)
TM1 integration
Data connection: YES
Repository behaviour
2 init queries:
query for X-axis labels Structure: {value:, label:}
parsingControl type: list
2. query for data Structure: {x: left side of histogram bar, /x value of line point, y: height of histogram bar/y value of line point}
parsingControl type: matrix
HorizontalTableWidget
Overview
A table-type widget for displaying data in rows and columns. Includes some limited interactive functionality (buttons, search field), but the content of the cells is read-only.
Configuration
columnNames: list of column name: [‘column1’, ‘column2’,…]columnTypes: list of column type: [‘int’, ‘string’,…]columnWidths: list of column width(pixel): [‘200’, ‘300’,…]searchField: toggle Search widget component visibilityselectFirst:fadeOutNum: max displayed rows without scrolling, default 10hideIfNoData:multiselect:skin: skin of the widgetselectedRowBackgroundColor
TM1 integration
Data connection: YES
Repository behaviour
state or init query if data feed from TM1:
parsingControl type: matrix
value
editable
ordinal
cellEdit query:
fired every time, once a cell is editable and edited by the user {value: r.Cells[x].FormattedValue, editable: false, ordinal: x}; return {active: true}
ImageUploadWidget
Overview
This widget is used for uploading images and photos.
Configuration
allowedMimeTypes: Allowed MIME types for file uploadallowedWidthInPixel: Maximum allowed width of uploaded image in pixelsallowedHeightInPixel: Maximum allowed height of uploaded image in pixelsbackgroundColor: Background color of the widgetborderColor: Color of the border around the widgetborderWidth: Width of the border in pixelscornerRadius: Radius of the widget’s corners in pixelsdividerWidth: Width of the divider line between elementseffect: Visual effect applied to the widgetfontBold: Whether the text should be boldfontColor: Color of the textfontSize: Size of the font used for textgradient: Background gradient styleicon: Icon of the widgeticonHeight: Height of the icon in pixelsiconPosition: Position of the icon (e.g., left, right)iconWidth: Width of the icon in pixelslabel: Text label shown on the widgetmaxFileSize: Maximum total upload size in megabytesmaxFileSizePerFile: Maximum file size per individual file in megabytesprogressVisible: Show progress bar during uploadskin: Selected skin of the widgetuploadSuccessMessage: Message shown after successful uploadshowUploadSuccessMessage: Whether to show success message after uploadskipStoppingTheLoaderAfterSuccessUpload: Skip hiding the loader after successful upload
TM1 integration
Data connection: NO
ImageWidget
Overview
This widget is used for displaying images and photos.
Configuration
icon: Icon of widgetfileName: if image is not an icon, name of the image file needs to be uploaded under ..AnalogicDeploymentstemplateSkins *usedSkin*images.title: title of the image widgetskin: Selected skin of widget
TM1 integration
Data connection: NO
Usage example
// widget-config.js
{
id: 'hrdemoSettingsRow1Cell1Logo',
type: ImageWidget,
titleFontColor: '#AEAEB2',
fileName: 'knowledgeseed_stratos.png',
titleFontSize: '22px',
width: 290,
height: 90
}
LineAreaChartWidget
Configuration
id: widget id which used for reference in frameworktype: Type of Widgettitle: Widget title textlisten: {event, method} events for the widget listen to and method to doskin: Selected skin of widgetdatasets: [{legendLabel: string, borderColor: string, borderWidth: int, backgroundColor: string, fill: boolean, lineTension: float, pointRadius: int},…]legendSkin: Selected skin of widgetxAxisLabel: label of X axesxAxesDisplay: true or false,, default true, display the x axesxAxesGridLinesDisplay: true or false, display the x axes grid linesxAxesTicksDisplay: the ticks of the X axesxAxesTicksLabelDisplay: the labes of the ticks of the Y axesxAxesGridLinesDrawBorder: true or false, display the x axes grid lines drow borderxAxesGridLinesColor: color of the x axes grid linesxAxesTicksFontSize: size of the x axes ticksxAxesTicksFontFamily: string, default ‘imago, sans-serif’xAxesTicksFontStyle: string, default ‘bold’xAxesTicksFontColor: color of the x axes ticksxAxesTicksPadding: padding between X axes ticksxAxesLabelDisplay: true or false, display the x axes labelxAxesLabelFontSize: size of the x axes labelxAxesLabelFontFamily: font family of the x axes labelxAxesLabelFontColor: color of the a axes labelxAxesLabelFontStyle: style of the x axes labelxAxesLabelPadding: padding between X axes labelxAxesLabelRotation: vertical, horizontalxAxesTicksOffset: Off sett of the x Axes ticksxAxesOffset: Off sett of the XxAxesOffsetGridLines: if true, grid lines will be shifted to be between labelsxAxesOffsetRight: Off sett of the X on rightxAxesOffsetLeft: Off sett of the X on leftxMin: the max value of theX axisyAxisLabel: label of Y axesyAxisDisplay: true or false, display the left y axesyAxesGridLinesDisplay: true or false, display the left y axes grid linesyAxesGridLinesDrawBorder: first grid line is visible, even if others are notyMin: the max value of the Y axisyAxesTicksDisplay: the ticks of the Y axesyAxesTicksLabelDisplay: the labes of the ticks of the Y axesyAxesGridLinesColor: color of the left y axes grid linesyAxesLabel: label of the left y axesyAxesLabelDisplay: true or false, display the y axes labelyAxesLabelConcat: str to add to the left Y axes ticksyAxesLabelFontSize: font size of the left y axes labelyAxesLabelFontFamily: font family of the left y axes labelyAxesLabelFontColor: font color of the left y axes labelyAxesLabelFontStyle: font style of the left y axes labelyAxesLabelPadding: padding between Y axes labelyAxesLabelRotation: vertical, horizontalyAxesTicksOffset: Off sett of the Y Axes ticksyAxesTicksBegintAtZero: true or false, begin the left y axes with zeroyAxesStacked: true or false,yAxesUnit:yAxesDecimalNum:yAxesSeparatesThousands: true or false,yAxesTicksPrecisionFixed: true or false,yAxesTicksFontSize: font size of the left y axes ticksyAxesTicksFontFamily: font family of the left y axes ticksyAxesTicksFontStyle: font style of the left y axes ticksyAxesTicksFontColor: font color of the left y axes ticksyAxesTicksPadding: padding between Y axes ticksyAxesTicksDisplay: true or false, display the left y axes ticksyAxesTicksOffset: offset (distance) between ticks of left Y axesdatadefaultBezierCurveTensionlabelClickPopupmanualLabelAlignmentopenPopupOnLabelClickopenendPopupOffsetLeftopenendPopupOffsetTopyAxesOffsetyAxesOffsetBottomyAxesOffsetTopyMaxtooltipsEnabled: Boolean , it’s enable the mouse over infotooltipsMode:tooltipsIntersect: BooleanaspectRatio:maintainAspectRatio: Boolean
TM1 integration
Data connection: 1
Repository behaviour
2 init queries:
query for X-axis labels Structure: {value:, label:}
parsingControl type: list
query for data Structure: {value:}
parsingControl type: matrix
Usage example
// widget-config.js
{
id: 'hrdemoReportChart9',
type: LineAreaChartWidget,
width: '1000',
height: '600',
title: 'Base Business',
datasets: [
{
"legendLabel": "Marketing and Management",
"borderColor": "#f8bfd1",
"borderWidth": 2,
"backgroundColor": "#f8bfd1",
"fill": false,
"lineTension": 0.5,
"pointRadius": 2
},
{
"legendLabel": "Finance and HR",
"borderColor": "#8a8a8a",
"borderWidth": 0,
"backgroundColor": "#8a8a8a",
"fill": false,
"lineTension": 0.5,
"pointRadius": 2
},
],
legendSkin: 'pieChart',
visible: true,
defaultFontFamily: 'imago, sans-serif',
yAxisLabel: 'Sales',
xAxesDisplay: true,
xAxesGridLinesDisplay: false,
xAxesGridLinesDrawBorder: false,
yAxesDisplay: true,
yAxesGridLinesDisplay: false,
yAxesGridLinesDrawBorder: false,
xAxesTicksDisplay: true,
yAxesTicksDisplay: true,
xAxesTicksLabelDisplay: true,
yAxesTicksLabelDisplay: true,
xAxesLabelDisplay: true,
yAxesLabelDisplay: true
}
// repository.js
hrdemoReportChart9: {
init: [
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {};
},
parsingControl: {
type: 'list',
query:
(r, x) => {
return {
value: r.Cells[x].Value,
label: r.Cells[x].Members[4].Name
};
}
}
},
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {};
},
parsingControl: {
type: 'matrix',
length: 5,
query: [
(r, x) => {
return {value: r.Cells[x].FormattedValue};
}, (r, x) => {
return {value: r.Cells[x + 1].FormattedValue};
}, (r, x) => {
return {value: r.Cells[x + 2].FormattedValue};
}, (r, x) => {
return {value: r.Cells[x + 3].FormattedValue};
}, (r, x) => {
return {value: r.Cells[x + 4].FormattedValue};
}]
}
}
],
},
},
LineScatterComboWidget
Overview
A combination chart which combines the features of a scatter plot diagram and a line chart.
Configuration
datasets:legendVisible: Boolean, Set the visibility of the legendcanvasPaddingTop:canvasPaddingRight:canvasPaddingBottom:canvasPaddingLeft:tooltipsEnabled: Boolean, Mouse OvertooltipsMode:aspectRatio:maintainAspectRatio:xAxisVisible: Boolean, It’s set the visibility of the x AxisxAxisGridLinesDisplay: Boolean, It’s set the visibility of the x Axis Grid LinesxAxisGridLinesDrawOnChartArea: Boolean, It’s set the visibility of the x Axis GridLines on chartxAxisTicksDisplay: Boolean, It’s set the visibility of the x Axis ticksxAxisTicksLabelDisplay: Boolean, It’s set the visibility of the x Axis ticks labelxAxisTicksStepSize: It’s set the step of the x Axis ticksxAxisOffsetGridLines: Boolean, It’s set the off sett of the y axisyAxisVisible: Boolean, It’s set the visibility of the x AxisyAxisGridLinesDisplay: Boolean, It’s set the visibility of the y Axis Grid LinesyAxisGridLinesDrawOnChartArea: Boolean, It’s set the visibility of the y Axis GridLines on chartyAxisTicksDisplay: Boolean, It’s set the visibility of the y Axis ticksyAxisTicksLabelDisplay: Boolean, It’s set the visibility of the y Axis ticks labelxAxisTicksFontSize: It’s set the size of the x axis ticks font sizeyAxisTicksFontSize: It’s set the size of the y axis ticks font sizexAxisTicksFontFamily: It’s set the size of the x axis ticks font familyyAxisTicksFontFamily: It’s set the size of the y axis ticks font familyxAxisTicksFontStyle: It’s set the size of the x axis ticks font styleyAxisTicksFontStyle: It’s set the size of the y axis ticks font stylexAxisTicksFontColor: It’s set the size of the x axis ticks font coloryAxisTicksFontColor: It’s set the size of the y axis ticks font colorxAxisTicksPadding: It’s set the size of the x axis ticks paddingyAxisTicksPadding: It’s set the size of the y axis ticks paddingxAxisTicksOffset: It’s set the size of the x axis ticks off setyAxisTicksOffset: It’s set the size of the y axis ticks off setyAxisTicksPrecision: It’s set the size of the y axis ticks precisionyAxisTicksPrecisionFixed: Boolean, It’s set the size of the y axis ticks precisionyAxisGridLinesNum: Boolean, It’s set the size of the y axis gird line nuzmsrightBorderVisible: Boolean, It’s set the visibility of the right bordertopBorderVisible: Boolean, It’s set the visibility of the top borderxMin: It’s set the size of the x axis min valuexMax: It’s set the size of the x axis max valueyMin: It’s set the size of the y axis min valueyMax: It’s set the size of the y axis max valuexAxisOffset: Boolean, It’s set the visibility of the x axes off setxAxisOffsetRight: It’s set the visibility of the x axes off set rightxAxisOffsetLeft: It’s set the visibility of the x axes off set leftyAxisSeparatesThousand: It’s seperate the y axisyAxisTicksPrecision:yAxisTicksPrecisionFixed:yAxisSeparatesThousands:yAxisGridLinesNum:yAxisUnit:bezierCurveBorderWidth:bezierCurveTension:auxLineColor:auxLineWidth:auxLineDash:
Usage example
// widget-config.js
{
id: 'hrdemoReportChart10',
type: LineScatterComboWidget,
yAxisGridLinesDisplay: false,
width: '1000',
height: '440',
tooltipsEnabled: false,
maintainAspectRatio: false,
yAxisGridLinesNum: 9,
//xAxisOffset: 0.5,
xAxisTicksLabelDisplay: true,
xAxisTicksDisplay: false
}
// repository.js
hrdemoReportChart10: {
init: {
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoReportChart10_init_2'
};
},
parsingControl: {
type: 'script',
script: (data, object) => {
let items = [{
label: data.Cells[0].Members[5].Name,
pointRadius: 5,
showLine: true,
static: false,
selected: true,
color: '#009FDA',
hidden: false,
values: []
}, {
label: data.Cells[1].Members[5].Name,
pointRadius: 5,
showLine: false,
static: false,
selected: true,
color: '#747678',
hidden: false,
values: []
}];
let start = 202300;
for (let i = 0; i < data.Cells.length; i += 2) {
items[0].values.push({
x: i / 2 + 1,
y: Utils.parseNumber(data.Cells[i].FormattedValue, 'HU-hu')
})
items[1].values.push({
x: i / 2 + 1,
y: Utils.parseNumber(data.Cells[i + 1].FormattedValue, 'HU-hu')
})
}
let values = [...items[0].values, ...items[1].values];
return {
datasets: items, legendVisible: true, legendSkin: 'combochartFTE',
yMax: Utils.precisionRound(Math.max(...values.map(e => e.y)), 0),
yMin: Utils.precisionRound(Math.min(...values.map(e => e.y)), 0)
};
}
}
}
},
},
PageWidget
Overview
Logical widget type to contain every widget that are displayed in a single page.
Configuration
id: widget id which used for reference in frameworktype: type of widgetlisten: {event, method} events for the widget listen to and method to dowidgets: contains all widgets on the page (eg.: BusinessCaseDashboard, BusinessCaseDashboardDraft, etc.)
TM1 integration
Data connection: NO
PanelWidget
Overview
Logical widget type for containing other widgets. A legacy widget type from the 1.0 version of the framework (currently the GridWidget provides the same functionality.
Configuration
id: Widget Id which used for reference in frameworktype: Type of Widgetwidgets: widget list, contains all widget on selected pagewidth: width of widgetlisten: {event, method} events for the widget listen to and method to doskin:
TM1 integration
Data connection: NO
PasswordTextWidget
Overview
This widget is used for Passwords
Configuration
id: Unique identifier of the widget, used for binding value and eventsskin: Selected skin style for the widget (affects styling via class name)value: Initial value of the password field (optional, not explicitly used here but can be set programmatically)
TM1 integration
Data connection: NO
PieChartWidget
Overview
A standard pie chart to show relative sizes of data.
Configuration
id: Widget Id which used for reference in frameworktype: Type of WidgetcanvasHeight:canvasWidth:data:skin: selected skin of widgetlegendSkin: selected skin of legendlabelAlign: alignment of label on chart (center, end, start)labelDisplay: toggle visibility of labellabelBorderColor: border color of label rectanglelabelBackgroundColor: background color of label rectanglelabelBorderWidth: border width of label rectangle in pixellabelBorderRadius: border radius of label rectangle in pixellabelTextAlign:labelAnchor: defines the anchor point of label (center, end , start)labelPaddingTop: label top padding in pixellabelPaddingRight: label right padding in pixellabelPaddingLeft: label left padding in pixellabelPaddingBottom: label bottom padding in pixellabelFontSize: label font sizelabelFontColor: color of fontlabelFontWeight: weight of fon(normal, bold)aspectRatio:maintainAspectRatio:
TM1 integration
Data connection: YES
Repository behaviour
1 init query:
1. query for data Structure: {value:, label:,backgroundColor:,borderWidth:,borderColor:}
parsingControl type: list
example response:
Usage example
// widget-config.js
{
id: 'hrdemoReportChart6',
type: PieChartWidget,
width: '1000',
height: '600',
title: '',
tooltipsEnabled: true,
marginBottom: '50',
skin: 'skin4',
legendSkin: 'pieChart',
legendGroupByStack: false,
labelAlign: 'end',
labelAnchor: 'end',
labelDisplay: true,
labelBackgroundColor: '#FFFFFF',
labelFontColor: '#000',
}
// repository.js
hrdemoReportChart6: {
init: {
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name, Attributes/Long_name))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoReportChart6_init_2',
year: v('hrdemoReportRow1Cell3SegmentedControl').selected === '2024' ? '2024' : '2023'
};
},
parsingControl: {
type: 'script',
script: (data, object) => {
let items = [];
for (let i = 0; i < data.Cells.length; i++) {
items.push({
value: Utils.parseNumber(data.Cells[i].FormattedValue, "HU-hu"),
label: data.Cells[i].Members[4].Attributes['Long_name'],
backgroundColor: Repository.hrdemoReportChart6.iconColor[i]
})
}
return {dataset: items};
}
}
},
iconColor: {
'0': '#F44336',
'1': '#673AB7',
'2': '#03A9F4',
'3': '#4CAF50',
'4': '#FFC107',
'5': '#015D52',
'6': '#6A5D4D',
'7': '#DE4C8A',
}
},
},
PivotTableWidget
Overview
Configuration
id: Widget Id which used for reference in frameworkselectorTreeColNames: [‘Dimensions’, ‘Hierarchies’, ‘Subsets’, ‘Elements’]colors:data:presetData:tree:
TM1 integration
Data connection: YES
Repository behaviour
No repository specifics documented.
RadarChartWidget
Overview
A radar chart is a way of showing multiple data points and the variation between them. They are often useful for comparing the points of two or more different data sets.
Configuration
Global parameters:
min: minimum value of the axis
max: maximum value of the axis
stepSize: step size on the axis
ticks: labels of the ticks on the axis
tickColor: color of the tick labels
tickFontFamily: font family of the tick labels
tickFontSize: font size of the tick labels
tickFontStyle: font style of the tick labels
canvasHeight: height of the canvas
canvasWidth: width of the canvas
bezierCurveBorderWidth:
bezierCurveTension:
paddingTop:
paddingRight:
paddingBottom:
paddingLeft:
tooltipsEnabled:
tooltipsMode:
canvas Width: width of the canvas
legendSkin: skin of the legend
legendVisible: legend visible flag
datasets
Dataset parameters:
backgroundColor: The line fill color.
borderCapStyle: Cap style of the line.
borderColor: The line color.
borderDash: Length and spacing of dashes.
borderDashOffset: Offset for line dashes.
borderJoinStyle: Line joint style.
borderWidth: The line width (in pixels).
- clip: How to clip relative to chartArea. Positive value allows
overflow, negative value clips that many pixels inside chartArea.
0= clip at chartArea. Clipping can also be configured per side:clip: {left: 5, top: false, right: -2, bottom: 0}
- data: Specified as an array of numbers. Each point in the data array
corresponds to the label at the same index.
fill: How to fill the area under the line.
- label: The label for the dataset which appears in the legend and
tooltips.
- order: The drawing order of dataset. Also affects order for tooltip
and legend.
- tension: Bezier curve tension of the line. Set to 0 to draw straight
lines.
pointBackgroundColor: The fill color for points.
pointBorderColor: The border color for points.
pointBorderWidth: The width of the point border in pixels.
- pointHitRadius: The pixel size of the non-displayed point that reacts
to mouse events.
- pointRadius: The radius of the point shape. If set to 0, the point is
not rendered.
pointRotation: The rotation of the point in degrees.
pointStyle: Style of the point.
- spanGaps: If true, lines will be drawn between points with no or null
data. If false, points with
nulldata will create a break in the line.
TM1 integration
Data connection: YES
Repository behaviour
init query:
query for data Structure: {value:}
parsingControl type: matrix
Usage example
// widget-config.js
{
id: 'hrdemoReportChart12',
type: RadarChartWidget,
skin: 'skin3',
title: '',
titleVisible: true,
visible: true,
canvasWidth: '750',
canvasHeight: '750',
height: '750',
width: '750',
legendVisible: true,
legendSkin: 'skin3'
}
// repository.js
hrdemoGroupsRow1Cell1Button: {
launch() {
Api.openPage('hrdemoMain');
}
},
RichTextWidget
Overview
This widget is used for text editing
Configuration
bold: Enables bold text formatting in the editoritalic: Enables italic text formatting in the editorunderline: Enables underline formattingleftAlign: Enables left text alignmentcenterAlign: Enables center text alignmentrightAlign: Enables right text alignmentjustify: Enables justified text alignmentol: Enables ordered (numbered) list formattingul: Enables unordered (bullet) list formattingheading: Enables heading/title formattingfonts: Allows changing fonts in the editorfontList: List of available font familiesfontColor: Enables font color selectionbackgroundColor: Enables background color selectionfontSize: Enables font size selectionimageUpload: Allows inserting uploaded imagesfileUpload: Allows uploading and inserting filesvideoEmbed: Allows embedding videosurls: Enables hyperlink insertiontable: Enables inserting tables into the editorremoveStyles: Allows removing inline stylescode: Enables HTML source code editingcolors: Custom color palette for text and backgroundyoutubeCookies: Whether to allow YouTube cookies in embedded videospreview: Enables live preview modeundoRedo: Enables undo and redo functionalityplaceholder: Placeholder text shown when editor is emptyskin: Selected skin style for the editor appearance
TM1 integration
Data connection: NO
ScrollTableWidget
Overview
A table-type widget for displaying data in rows and columns. It provides Excel-like functionality including editing cells
Configuration
id: widget id which used for reference in frameworktype: type of widgetheaderWidth: width of header in pixelformat: W-B-N format for default formattingstartYear: Name of the starting year in numbersendYear: Name of the ending year in numbersribbons (hidden in current version):bar1: {name, textColor, backgroundColor}bar2: {name, textColor, backgroundColor}..bar5: {name, textColor, backgroundColor}
listen: {event, method} events for the widget listen to and method to do
TM1 integration
Data connection: YES
Repository behaviour
4 init queries:
parsingControl type: list
1. query for date labels for all column / Structure: {value:, label:}
2. query for table left section / Structure: {labelId: ,label:, comment:, childrenIds:, expandable:, children:, expanded:, format:}
query for cell data / Structure:{value:, disabled:,ordinal:}
query for formatting / Structure: {value:, ordinal:}
cellEdit
query: normal cell edit
pasteCells
query: in case of paste
Data repository specifics (Comment functionality working with 2 special event commentEdit and commentShow, these events transfer the clicked scroll table row information to the comment container’s widgets).
SegmentedBarWidget
Overview
A special multi-section bar chart widget primary used for statistical analysis
Configuration
id: Widget Id which used for reference in frameworktype: Type of WidgethideIfNoData: boolean if true the widget will hide with empty contentlisten: {event, method} events for the widget listen to and method to doskin: Selected button skindataset: [dataset1: {value:-300,color:color1,bgColor:color2,separatorVisible:true}
TM1 integration
Data connection: YES
Repository behaviour
1 init query:
query for data Structure: {value:}
parsingControl type: matrix
SegmentedControlItemWidget
Overview
Logical widget type to represent the SegmentedControlWidget options.
Configuration
id: Widget Id which used for reference in frameworktype: Type of Widgetskin: Selected skin of widgetvalue: ‘1’ if the default value is ON, and ‘0’ if the default vaule is OFFlabel: Label of the widgetaction: Action of Segmented Control Item (scroll, open or launch)selected: true false value: sign which Item of SegmentedControl is active
TM1 integration
Data connection: NO
SegmentedControlWidget
Overview
This widget is used to switch between displaying different sets of data.
Configuration
id: widget id which used for reference in frameworktype: type of widgetskin: skin of the widgetlisten: {event, method} events for the widget listen to and method to do
TM1 integration
Data connection: NO
Usage example
// widget-config.js
{
id: 'hrdemoPeopleServiceTeamEditorRow2Cell1SegmentedControl',
type: SegmentedControlWidget,
width: '320',
skin: 'segmented',
marginBottom: '5px',
widgets: [
{
id: 'hrdemoPeopleServiceTeamEditorRow2Cell1SegmentedControlItem1',
type: SegmentedControlItemWidget,
action: 'segmentedControlTab1',
skin: 'segmented_left_hrdemo',
selected: true,
label: 'Editor',
},
{
id: 'hrdemoPeopleServiceTeamEditorRow2Cell1SegmentedControlItem2',
type: SegmentedControlItemWidget,
action: 'segmentedControlTab2',
skin: 'segmented_right_hrdemo',
selected: false,
label: 'List',
}
}
// repository.js
hrdemoPeopleServiceTeamEditorRow2Cell1SegmentedControl: {
switch(db) {
Utils.setWidgetValue('systemValueTeamEditorTableData', false);
Utils.setWidgetValue('systemValueClickedElementGroup', false);
Utils.setWidgetValue('systemValueClickedRow', false);
Repository.hrdemoPeopleServiceTeamEditorRow1Cell1Button.clearValues();
Api.openPage('hrdemoPeopleServiceTeamList');
}
},
},
ShadowWidget
Overview
This widget is not displayed. Its purpose is background data query.
Configuration
TM1 integration
Data connection: NO
Usage example
// widget-config.js
{
id: 'hrdemoPeopleServiceTeamEditorShadow',
type: ShadowWidget
}
// repository.js
hrdemoPeopleServiceTeamEditorShadow: {
initFinished() {
Api.forceRefresh('hrdemoPeopleServiceTeamEditorLevel1GridTable');
},
init:
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name, Attributes/Caption, Attributes/Normal_Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
group: v('systemValueSelectedGroup')
};
},
parsingControl: {
type: 'object',
query:
{
value: (r, x) => {
for (let i = 0; i < r.Cells.length; ++i) {
v('systemValueSelectedEmployees').push(r.Cells[i].Members[0].Name);
v('systemValueSelectedEmployeeHierarchy').push({
department: r.Cells[i + 1].FormattedValue,
team: r.Cells[i].FormattedValue,
employee: r.Cells[i].Members[0].Name
});
i++;
}
return true;
}
}
}
}
},
},
SimulationPanelSliderWidget
Overview
Configuration
id: widget id which used for reference in frameworktype: type of widgetminValue:maxValue:currentValue:unit:ordinal:parentWidgetId:
TM1 integration
Data connection: NO
SimulationPanelWidget
Overview
Configuration
id: widget id which used for reference in frameworktype: type of widgetskin: skin of the widgetlisten: {event, method} events for the widget listen to and method to do
TM1 integration
Data connection: NO
SliderWidget
Overview
This widget allows users to set or adjust a value.
Configuration
id: Widget Id which used for refeerence in frameworktype: Type of Widgetwidth: width of the button (%), if hasLayout == true, default: 50%hideIfNoData: boolean if true the widget will hide with empty contentlargeIncrement: The larger value you can increaselisten: {event, method} events for the widget listen to and method to dounit:updateableWidgetId:updateableWidgetValueHandler:updateCallBack:originalValue:maxRange: Maximal valueminRange: Minimal valueskin: Selected skin of the widgetsmallIncrement: The smaller value you can increasetitle: title of the widgettrackValueFontColor: color of the track value label fonttrackValueFontSize: size of the track value label fonttrackValueMagnifierLabelFontColor: color of the magnifier label fonttrackValueMagnifierLabelFontSize: size of the magnifier label fontvalue: default value of slider (can be array)buttonsVisible: if buttons visible (flag)legend: gives a description of each series. ([{name: ‘First Val’, color: ‘red’}, {name: ‘Second Val’, color: ‘pink’}, {name: ‘Third Val’, color: ‘orange’}])visible: if widget visible (flag)
TM1 integration
Data connection: 1
Repository behaviour
state or init query if data feed from TM1:
parsingControl type: matrix
cols
minValue
maxValue
currentValue
unit
ordinal
Usage example
// widget-config.js
{
id: 'hrdemoUpdateValueGridRow4Slider',
type: SliderWidget,
width: '320px',
hideIfNoData: false,
skin: 'hrdemo_cell_value',
minRange: -100,
maxRange: 100,
alignment: 'center',
unit: '%',
updateableWidgetId: 'hrdemoUpdateValueGridRow3TextBox',
trackFillStartValue: -100,
buttonsVisible: false,
listen: [
{
event: 'launch.hrdemoUpdateValueGridRow3Button.finished',
method: 'refreshWithoutLoader'
}
]
}
// repository.js
hrdemoUpdateValueGridRow4Slider: {
getOriginalValue() {
return Utils.parseNumber(Utils.replaceDecimal(v('hrdemoUpdateValueGridRow2Text2').value), 'HU-hu');
},
init() {
if (v('hrdemoUpdateValueGridRow2Text2').value) {
return {
value: 0,
updateableWidgetValueHandler: (sliderValue) => {
let originalValue = this.getOriginalValue(),
newValue;
if (sliderValue === 0) {
newValue = originalValue;
} else {
newValue = (originalValue * (1 + (sliderValue / 100))).toFixed(2);
}
return newValue;
},
calculateSliderValue: (value) => {
let sliderWidgetValue = v('hrdemoUpdateValueGridRow4Slider');
sliderWidgetValue.value = value;
Utils.setWidgetValue('hrdemoUpdateValueGridRow4Slider', sliderWidgetValue);
let originalValue = this.getOriginalValue();
if (originalValue === 0) {
return originalValue;
}
return ((value / originalValue) - 1) * 100;
}
};
}
return {};
}
},
},
StackedColumnChartWidget
Overview
A chart widget used to show how a net value is arrived at, by breaking down the aggregate effect of negative and positive contributions.
Configuration
fontFamily: font family of the chartfontSize: font size of the chartfontStyle: font style of the chartfontWeight: font weight of the chartfontLineHeight: font line height of the chartfontColor: font color of the chartgridColor: grid color of the chartgridWidth: gird Width of the chartxAxisGridDisplay: true or falseyAxisGridDisplay: true or falseaspectRatio:maintainAspectRatio: true or falsetooltipsEnabled: true or falseanimationEnabled: true or falserightBorderVisible: true or false, visible of the right borderrightBorderWidth: width of the right borderrightBorderColor: color of the right bordertopBorderVisible: true or false, visible of the top bordertopBorderWidth: width of the top bordertopBorderColor: color of the top borderinteractionMode:interactionAxis:interactionIsIntersect: true or falselineColor: color of the linelineWidth: width of the linelineTension: Tension of the linebarBorderColor: Color of the border barbarBorderRadius: Radius of the border barbarBorderWidth: width of the border barbarInflateAmount:barPercentage: percentage of the barbarCategoryPercentage:barThickness: thickness of the barbarMaxThickness: max thickness of the barbarMinLength: min length of the barcanvasPaddingTop: paddingTop of the canvascanvasPaddingRight: paddingRight of the canvascanvasPaddingBottom: paddingBottom of the canvascanvasPaddingLeft: paddingLeft of the canvaslegendVisible: true or false, Visible of the legendlegendPosition: position of the legendlegendAlign: alignment of the legendlegendFontFamily: family of the legendlegendFontSize: font size of the legendlegendFontStyle: font style of the legendlegendFontWeight: font weight of the legendlegendFontLineHeight: font line height of the legendxAxisBorderDisplay: true or false, display the border of x axisxAxisDisplay: true or false, display the x axisxAxisAlignToPixels: true or false, align the x axis to pixelsxAxisStacked: true or falsexAxisBorderColor: Color of the x axis borderxAxisBorderWidth: width of the x axis borderxAxisTicksLabelDisplay: true or false, display the ticks of the x axis labelxAxisTicksFontColor: Color of the x axis ticksxAxisTicksFontFamily: Font family of the x axis ticksxAxisTicksFontSize: Font size of the x axis ticksxAxisTicksFontStyle: Font style of the x axis ticksxAxisTicksFontWeight: Font weight of the x axis ticksxAxisTicksFontLineHeight: Font line height of the x axis ticksxAxisTicksLabelPadding: Padding of the x axis ticks labelxAxisGridDisplay: display of the x axis gridxAxisGridColor: color of the x axis gridxAxisGridOffset: true or false, offset of the x axis gridxAxisTicksDisplay: display of the x axis ticksxAxisGridDrawOnChartArea: Draw on chart area of the x axisxAxisGridLineWidth: line width of the x axis gridyMin: minimum value of the y axisyMax: maximum value of the y axisyMarginTop: margin top of the y axisyMarginBottom: margin bottom of y axisyMarginLeft: margin left of the y axisyMarginRight: margin right of the y axisyAxisDisplay: ture or false, display the y axisyAxisAlignToPixels: true or false, align to pixels of the y axisyAxisStacked: true or falseyAxisBorderDisplay: true or false, display the y axisyAxisBorderColor: Color of the y axis borderyAxisBorderWidth: width of the y axis borderyAxisGridDisplay: display the y axis gridyAxisGridDrawOnChartArea:yAxisGridLineWidth: width of the y axis gird lineyAxisTicksDisplay: display of the y axis ticksyAxisTicksLabelDisplay: display of the y axis ticks labelsyAxisTicksFontColor: font color of the y axis ticksyAxisTicksFontFamily: font family of the y axis ticksyAxisTicksFontSize: font size of the y axis ticksyAxisTicksFontStyle: font style of the y axis ticksyAxisTicksFontWeight: font weight of the y axis ticksyAxisTicksFontLineHeight: font line height of the y axis ticksyAxisTicksLabelPadding: padding of the y axis ticks labelsyAxisTicksCount: number of y axis ticksyAxisTicksLimit: limit of the y axis ticksyAxisGridColor: color of the y axisyAxisGridLinesNum: number of y axis linesyAxisShowOnlyZeroLine: true or false,show only zero lineyAxisUnit: unit of the y axisyAxisDecimalNum: decimal number of the y axisyAxisSeparatesThousands: true or falseyAxiyAxisTicksPrecisionFixed: true or falselabelColor: Color of the labellabelBackgroundColor: Color of the label backgroundlabelFontFamily: Font family of the labellabelFontSize: Font size of the labellabelFontStyle: Font style of the labellabelFontWeight: Font weight of the labellabelFontLineHeight: Font line height of the labellabelPaddingTop: padding top of the labellabelPaddingLeft: padding left of the labellabelPaddingRight: padding right of the labellabelPaddingBottom: padding bottom of the labellabelAlign: align of the labellabelOffset: offset of the labellabelAnchor: anchor of the labellabelClamp: true or false, clamp of the labellabelClip: true or false, clip of the labellabelBorderRadius: border radius of the labelarrowEnabled: true or falsearrowMarginTop: margin top of the arrowarrowMarginMiddle: margin middle of the arrowarrowMarginBottom: margin bottom of the arrowarrowLength: length of the arrowarrowLineColor: line color of the arrowarrowLineWidth: line width of the arrowarrowCircleColor: circle color of the arrowarrowCircleRadius: circle radius of the arrowarrowCircleWidth: circle width of the arrowarrowTriangleColor: Trinagle color of the arrowarrowTriangleSize: triangle size of the arrowarrowLabelVisible: true or falsearrowLabelColor: label color of the arrowarrowLabelBackgroundColor: background color of the arrowarrowLabelFontFamily: font family of the arrowarrowLabelFontSize: font size of the arrowarrowLabelFontStyle: font style of the arrowarrowLabelFontWeight: font weight of the arrowarrowLabelFontLineHeight: font line height of the arrowarrowLabelPaddingTop: padding top of the arrow labelarrowLabelPaddingLeft: padding left of the arrow labelarrowLabelPaddingRight: padding right of the arrow labelarrowLabelPaddingBottom: padding bottom of the arrow labelarrowLabelAlign: align of the arrow labelarrowLabelOffset: offset of the arrow labelarrowLabelAnchor: anchor of the arrow labelarrowLabelClamp: true or false, clamp of the arrow labelarrowLabelClip: true or false, clip of the arrow labelarrowLabelBorderRadius: border radius of the arrow labeldata: Data series to be displayed in the widgethideZeroBars: true or false, hide bars with zero valueyAxisTicksLimit: Maximum number of tick lines on Y axislabelDataPointVisible: true or false, show label directly at data pointlabelDataLabelVisible: true or false, show label text for datalabelAlignments: Label alignment direction (e.g. ‘start’, ‘center’, ‘end’)lalelsForceDisplay: true or false, force label visibility even in tight spacesshowZeroValueLabels: true or false, show labels for zero valuesmanualLabelAlignmentSetting: true or false, allow manual alignment of labelslabelClickPopup: ID of the popup to open when label is clickedopenPopupOnLabelClick: true or false, enable label click to open popupopenendPopupOffsetLeft: Horizontal offset in pixels for popup openingopenendPopupOffsetTop: Vertical offset in pixels for popup opening
TextAreaWidget
Overview
This widget is used for entering multiple lines of text. The widget is resizable by bottom right corner drag and drop
Configuration
id: widget id which used for reference in frameworktype: type of widgetlisten: {event, method} events for the widget listen to and method to doeditable: Boolean, It’s set editable true or falseskin: Selected skin of widget:title: title of the textboxtitleVisible: visibilitydefaultText: shown defaulttooltip: Widget tool tip texttooltipTitle: WidgetTootTip Titlevisible: if widget visible (flag)width: width of the button (%), if hasLayout == true, default: 50%icon:highlight:placeholder:textAlignment: alignment of the texttextFontColor: font color of the texttextFontSzite: font size of the texttitleFontColor: font color of the titletitleFontSize: font size of the titletitleTextAlignment: alignment of the title
TM1 integration
Data connection: YES
Repository behaviour
state or init if text coming from TM1 backend:
parsingControl type: object
text
ordinal
Usage example
// widget-config.js
{
id: 'hrdemoSimulationCommentPopupCommentInput',
type: TextAreaWidget,
placeholder: 'Add comment ...',
marginBottom: '30',
width: '280px',
height: '105px',
icon: 'icon-send.png',
skin: 'comment_message
}
// repository.js
hrdemoSimulationCommentPopupCommentInput: {
save: {
url: (db) => {
return `/api/v1/Processes('zSYS Analogic UI Add Comment')/tm1.ExecuteWithReturn`;
},
type: 'POST',
server: true,
body: (db) => {
let parameters = Repository.hrdemoSimulationGridTable.getCommentSaveProcessParameters();
parameters['comment'] = v('hrdemoSimulationCommentPopupCommentInput.value');
parameters['activeUser'] = v('activeUser').replace(/\\/g, '/');
Utils.setWidgetValue('hrdemoSimulationCommentPopupCommentAdded', true);
return parameters;
},
callback() {
Api.executeQueryRequest(['hrdemoSimulationCommentPopupCommentInput', 'reloadComment']);
}
},
reloadComment: {
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue)`,
type: 'POST',
server: true,
body: (db) => {
return Repository.hrdemoSimulationGridTable.getCommentReloadParametersAfterSave();
},
parsingControl: {
type: 'script',
script: (data) => {
let r = {
previousCommentId: data.Cells[0].FormattedValue,
commentId: data.Cells[1].FormattedValue,
text: data.Cells[2].FormattedValue,
user: data.Cells[3].FormattedValue,
date: data.Cells[4].FormattedValue
};
Utils.setWidgetValue('hrdemoSimulationCommentPopupLoadedComments', v('hrdemoSimulationCommentPopupLoadedComments').length !== 0 ? [r].concat(v('hrdemoSimulationCommentPopupLoadedComments')) : [r]);
Utils.setWidgetValue('hrdemoSimulationCommentPopupLoadFromLoadedComments', true);
Api.forceRefresh('hrdemoSimulationCommentPopupPreviousCommentsGridTable');
Api.forceRefresh('hrdemoSimulationCommentPopupCommentInput');
Api.forceRefresh('hrdemoSimulationCommentPopupControlPanelLoadMoreButton');
return {};
}
}
}
},
},
TextBoxWidget
Overview
This widget is used for entering a single line of text.
Configuration
id: widget ID used for reference in frameworktype: type of widgettitleFontSize: font size of the titletitleFontColor: font color of the titletextFontSize: font size of the texttextFontColor: font color of the texttitle: title of the textboxtitleVisible: if widget title visible (flag)defaultText: shown by default in an empty cell, like a hint for expected contentvisible: if widget visible (flag)hideIfNoData: boolean if true the widget will hide with empty contentlisten: {event, method} events for the widget listen to and method to doskin: skin of the widgettextBoxType: type of the textbox (drop-down)titleTextAlignment: alignment of the titletextAlignment: alignment of the texticon: icon of the widget (drop-down)n to and method to dohighlight:defaultText:editable: Boolean, It’s set editable true or falseskin:
TM1 integration
Data connection: OPTIONAL
Repository behaviour
state query or init query. If query is init then:
parsingControl type: object
value
writeEnd query:
optional query, that will be fired every time, once finished editing the TextBox (clicked out from the textbox area)
Usage example
// widget-config.js
{
id: 'hrdemoSimulationCompensationChangePopUpGridRow12Cell2TextBox',
type: TextBoxWidget,
width: 350,
marginTop: '10px',
editable: true,
skin: 'custom_group',
height: '40px'
}
// repository.js
hrdemoSimulationCompensationChangePopUpGridRow12Cell2TextBox: {
init() {
if (Utils.getGridTableCurrentCell('hrdemoSimulationGridTable').yearAndMonth) {
return new RestRequest(this.restRequest);
}
return [];
},
restRequest: {
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
version: v('systemValueSelectedVersion2'),
period: Utils.getGridTableCurrentCell('hrdemoSimulationGridTable').yearAndMonth,
employee: Utils.getGridTableCurrentRow('hrdemoSimulationGridTable')[0].employeeNumber,
group: v('hrdemoSimulationGroupSelectorPopUpDropbox').value
};
},
parsingControl: {
type: 'object',
query:
{
value: (r, x) => {
Utils.setWidgetValue('systemValueNewBonusValue', r.Cells[x].FormattedValue);
Api.updateWidgetsContent(['hrdemoSimulationCompensationChangePopUpGridRow9Cell2Text', 'hrdemoSimulationCompensationChangePopUpGridRow11Cell2Text', 'hrdemoSimulationCompensationChangePopUpGridRow10Cell2TextBox']);
return 0;
},
defaultText: (r, x) => {
return 0;
}
}
}
}
},
},
TextWidget
Overview
This widget is used to display text
Configuration
id: widget id which used for reference in frameworktype: type of widgeticon:iconColor:iconCustomEventName:iconHeight:iconPosition:iconWidth:title: title of the widgetbody: text in the body of the widgettitleFontSize: size of the text in the titletitleFontColor: color of the text in the titletitleBackgroundColor:titleCursor:titleFontWeight:bodyFontSize: size of the text in the bodybodyFontColor: color of the text in the bodybodyBackgroundColor:bodyCursor:bodyFontWeight:skin: skin of the widgettitleAlignment: alignment of the titlebodyAlignment: the alignment of the text in the bodyeditable: If the text in the body is editable (flag)performable:visible: if widget is visible (flag)ordinal:listen: {event, method} events for the widget listen to and method to do
TM1 integration
Data connection: OPTIONAL
Repository behaviour
state query or init query:
parsingControl type: object
text
Usage example
// widget-config.js
{
id: 'hrdemoSimulationCompensationChangeGroupPopUpGridRow2Text1',
type: TextWidget,
titleFontSize: '13',
title: 'Group - 2023. June',
marginTop: '15px',
marginBottom: '15px',
marginLeft: '9px',
}
// repository.js
hrdemoSimulationCompensationChangeGroupPopUpGridRow2Text1: {
init() {
let m = Utils.getGridTableCurrentCell('hrdemoSimulationGridTable').yearAndMonth,
months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
if (m) {
let y = m.slice(0, 4) + '. ' + months[Utils.parseNumber(m.slice(4, 6)) - 1];
return {
title: v('hrdemoSimulationGroupSelectorPopUpDropbox').value + ' - ' + '<b style=color:#747B85>' + y + '</b>',
}
}
return {};
}
},
},
ToggleWidget
Overview
The purpose of this widget is to permit the user to make a binary choice, i.e. a choice between one of two possible mutually exclusive options. (for example: on-off choice)
Configuration
id: Widget Id which used for reference in frameworktype: Type of Widgetaction: action if button clicked, name of action in repositoryconfirmMessage: what confirm message should pop upgroupId: ID of the connected toggle’s, each toggle has to be refer to the same group namingicon: selected icon of toggle when ONiconOff: selected icon of toggle when OFFlisten: {event, method} events for the widget listen to and method to doskin: Selected button skintitleFontColor: color of the button label fonttitleFontSize: size of the button label fonttitleOff: title of OFF statetitleOn: title of ON statevalue: ‘1’ if the default value is ON, and ‘0’ if the default value is OFFvisible: if widget visible (flag)width: width of the button (%), if hasLayout == true, default: 5backgroundColor:isGridTableHierarchyExpander:editable:groupId:icon:iconOff:icontFontSize:icontFontColor:skin:titleFontColor:titleFontSize:titleOn:titleOff:value:backgroundColor:editable:iconFontSize:iconFontColor:
TM1 integration
Data connection: OPTIONAL
Repository behaviour
optional switch query, that can switch for example processes
optional query for value (0 or 1)
- only url, body and type settings are used. parsingControl settings is
not available
Usage example
// widget-config.js
{
id: 'hrdemoViewGroupGridTableCell01Toggle1',
type: ToggleWidget,
titleFontSize: '13',
skin: 'page_toggle',
iconColor: '#007AFF',
icon: 'icon-checkbox-on11',
iconOff: 'icon-checkbox-off1',
titleFontWeight: '600'
}
// repository.js
hrdemoGroupsRow1Cell1Button: {
launch() {
Api.openPage('hrdemoMain');
}
},
TornadoChartWidget
Overview
A special bar chart widget used for sensitivity analysis
Configuration
id: widget id which used for reference in frameworktype: type of widgettitle: title of the widgetxAxisLabel: label of the x-axisbaseValue: base value of the chartxMin: minimum value of the x-axisxMax: maximum value of the x-axisrange: range of the chart (= xMax - xMin)zoomable: if the widget can be enlarged (flag)skin: skin of the widgetdataset: $.extend(true, o.dataset || [], data.dataset || demo)listen: {event, method} events for the widget listen to and method to dolegendsVisible: if legends visibledataset:xAxisLabel:baseValue:legendVisible:skin:xMin:range:
TM1 integration
Data connection: YES
Repository behaviour
2 init queries:
query for base value
parsingControl type: object
2. query for data Structure: {leftValue:, leftColor:, rightValue:, rightColor:, legendLabel:}
parsingControl type:
matrix
Usage example
// widget-config.js
{
id: 'hrdemoReportChart11',
type: TornadoChartWidget,
width: '1700',
height: '400',
marginLeft: '1600px',
dataset: [
{
leftColor: '#F44336',
rightColor: '#F44336'
},
{
leftColor: '#673AB7',
rightColor: '#673AB7'
},
],
xMin: 0,
xMax: 150,
skin: ''
}
// repository.js
hrdemoReportChart11: {
init:
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoReportChart11_init'
};
},
parsingControl: {
type: 'script',
script: (r) => {
let results = [], maxValue = 0, minValue = 0, leftValue, rightValue;
for (let x = 0; x < r.Cells.length; x += 2) {
leftValue = Utils.parseNumber(r.Cells[x].FormattedValue, 'HU-hu');
rightValue = Utils.parseNumber(r.Cells[x + 1].FormattedValue, 'HU-hu');
results.push({
leftValue: 0 - leftValue,
rightValue: rightValue,
});
if (rightValue > maxValue) {
maxValue = rightValue;
}
if (leftValue > minValue) {
minValue = leftValue;
}
}
return {dataset: results, baseValue: 0, xMin: 0, xMax: maxValue * 1.3};
}
}
},
VerticalLineBoxWidget
Overview
Sub-widget of LineAreaChartWidget
Configuration
id: Widget Id which used for reference in frameworktype: Type of Widgetlisten: {event, method} events for the widget listen to and method to dodataset: [{lineVisible: boolean, lineStyle: ‘dotted’/’solid’/’dashed’, lineWidth: int, labelVisible: boolean, titleVisible: int, value: float, label: string, lineColor: string, labelColor: string, titleColor: string, titleBgColor: string},…]
TM1 integration
Data connection: YES
Repository behaviour
init query:
query for data Structure: {value:}
parsingControl type: matrix
WaterfallWidget
Overview
A chart widget used to show how a net value is arrived at, by breaking down the aggregate effect of negative and positive contributions.
Configuration
id: widget id which used for reference in frameworkdataset1: $.extend(true, dataset1Config, d.dataset1 || {legendLabel: ‘Dataset One’, legendColor: ‘pink’, datapoints: [{value: 9.06}, {value: -0.06}, {value: 0.5}, {value: 0}, {value: 9.5}]})dataset2: $.extend(true, dataset2Config, d.dataset2 || {legendLabel: ‘Dataset One’, legendColor: ‘red’, datapoints: [{value: 8.06}, {value: -3.06}, {value: 1.5}, {value: 5}, {value: 4.5}]})xAxisLabels: labels of the x-axislabelVisible: if label visible (flag)legendVisible: if legend visible (flag)minYAxis: minimum value of the y-axismaxYAxis: maximum value of the y-axisyAxisGridLineNum: number of horizontal grid linesyAxisDecimalNum:yAxisUnit:defaultColor: default color of the widget (currently #F3F4F6)skin: skin of the widgetyAxisTicksPrecisionFixed: true or false,yAxisSeparatesThousands: true or false,height: height of the chartallowLastColumnToZero: true or falseallowLastColumnToZero: true or false, allow the last column to show zero valuelabelFontSize: Font size of the labelslabelHasAction: true or false, indicates if label has a click actionopenPopupOnLabel: true or false, open a popup when clicking the labelpopupToOpenId: ID of the popup to be opened when label is clickedxAxisFontSize: Font size of the X axis labelsyAxisFontSize: Font size of the Y axis labels
TM1 integration
Data connection: not specified
Repository behaviour
No repository specifics documented.
Usage example
// widget-config.js
{
id: 'hrdemoReportWaterFall',
type: WaterFallWidget,
width: '1600',
height: '400',
title: '',
minYAxis: 0,
maxYAxis: 200000,
dataset1 : {showConnectionLines: true, legendLabel: 'Dataset One', legendColor: '#007AFF',
datapoints:
[
{value: 84000, positiveColor: '#B1B3B3', negativeColor: '#B1B3B3'},
{value: 76000, positiveColor: '#007AFF', negativeColor: '#CFE0F5'},
{value: -190000, positiveColor: '#007AFF', negativeColor: '#CFE0F5'},
{value: -210000, displayValue: 210000, positiveColor: '#007AFF', negativeColor: '#CFE0F5'},
{value: 128300, isTotal: true, positiveColor: '#B1B3B3', negativeColor: '#B1B3B3'},
{value: 84000, displayValue: -84000, positiveColor: '#007AFF', negativeColor: '#CFE0F5'},
{value: -75000, displayValue: 75000, positiveColor: '#007AFF', negativeColor: '#CFE0F5'},
{value: -100000, displayValue: 100000, positiveColor: '#007AFF', negativeColor: '#CFE0F5'},
{value: 101600, positiveColor: '#B1B3B3', negativeColor: '#B1B3B3'}
]
},
marginTop: '150',
marginBottom: '50',
marginLeft: 300,
labelVisible: true,
legendVisible: false,
yAxisGridLineNum: 4,
yAxisSeparatesThousands: true,
xAxisLabels : [
{value: 'Total Cost 2022'},
{value: 'Calculated Salary'},
{value: 'Bonus'},
{value: 'Auto Allowance'},
{value: 'Other Benefits'},
{value: 'Employer Contributions'},
{value: 'Social Security'},
{value: 'Pension Fund'},
{value: 'Health Insurance'}
]
}
// repository.js
hrdemoReportWaterFall: {
init: [
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name, Attributes/Long_NameENG))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoReportWaterFall_init'
};
},
parsingControl: {
type: 'script',
script(r) {
let values = r.Cells.map(
(elem, index) => r.Cells.slice(
0, index + 1).map(
e => Utils.parseNumber(e.FormattedValue, 'HU-hu')).reduce(
(a, b) => a + b));
values.splice(-1, 1);
const max = Math.max.apply(this, values),
min = Math.min.apply(this, values);
return {
maxYAxis: String(Math.round((max * 1.01))),
minYAxis: String(Math.round((min * 0.99)))
};
}
}
},
{
url: (db) => `/api/v1/ExecuteMDX?$expand=Cells($select=Ordinal,FormattedValue;$expand=Members($select=Name, Attributes/Long_NameENG))`,
type: 'POST',
server: true,
body: (db) => {
return {
key: 'hrdemoReportWaterFall_init'
};
},
parsingControl: {
type: 'script',
script(r) {
const process = function (cell, index) {
const val = Utils.parseNumber(cell.FormattedValue, 'HU-hu')
return {
value: val,
displayValue: Utils.separatesThousands(val)
};
}
return Utils.getGridtableMatrix(r.Cells, 9, process);
}
}
}
]
},
},