Display rules and icons
You can customize KPI lists, tables, attributes lists, and histograms by applying display rules and styling to them. These display rules must first be defined in your knowledge model as a custom object, before then being added to your view compoment YAML configurations.
Define a custom object in your knowledge model
To define your custom object, use the following YAML example:
- id: DISPLAY_RULE displayName: Display rule customAttributes: # comparator is used to compare value from ``DISPLAY_RULE.customAttributes.value`` to the value from PQL - comparator: GREATER_THAN_OR_EQUAL # value to compare value: 1000 #In case you use the comparator BETWEEN you would define the value as following 'value: [ 8, 15 ]' # styles to change cell appearance style: textColor: red # CSS color or HEX code backgroundColor: black fontSize: 16px fontItalic: true fontWeight: bold
You can then reference this display rule in your view's YAML configuration:
- id: attribute type: attribute settings: data: - id: INVOICE.TOTAL_NUMBER_OF_INVOICES displayContentRule: DISPLAY_RULE - id: INVOICE.TABLE_COUNT displayContentRule: TABLE_COUNT_DISPLAY_RULE
Supported visual styling
You can visually customize your view by adding the following styling keys:
Key | Type | Accepted Values | Supported View Components |
---|---|---|---|
iconName: | String |
| |
iconSize: | Number | Size in pixels For example: 100px |
|
iconFont: | Boolean | True False |
|
avatar: | Boolean | True False |
|
avatarUrl: | String | An active URL |
|
avatarColor: | String | HEX of CSS color For example: #34ebeb |
|
avatarSize: | String | xs sm md lg xl |
|
iconPosition: | String | LEFT RIGHT ONLY_ICON |
|
label: | Boolean | True False |
|
backgroundColor: | String | HEX of CSS color For example: #34ebeb |
|
textColor: | String | HEX of CSS color For example: #34ebeb |
|
border: | String |
| |
borderRadius: | String | Size in pixels For example: 2px |
|
fontSize: | String | Size in pixels For example: 10px |
|
fontItalic: | Boolean | True False |
|
fontWeight: | String |
|
Supported display rule comparators
You can use the following comparators for defining a display rule in your knowledge model:
comparator: "IS_EMPTY" # for 'int' | 'float' | 'date' | 'string' "IS_NOT_EMPTY" # for 'int' | 'float' | 'date' | 'string' "TEXT_CONTAINS" # for 'string' "TEXT_DOES_NOT_CONTAIN" # for 'string' "TEXT_STARTS_WITH" # for 'string' "TEXT_ENDS_WITH" # for 'string' "TEXT_IS_EXACTLY" # for 'string' "DATE_IS" # for 'date' "DATE_IS_BEFORE" # for 'date' "DATE_IS_AFTER" # for 'date' "GREATER_THAN" # for 'int' | 'float' | 'date' "GREATER_THAN_OR_EQUAL" # for 'int' | 'float' | 'date' "LESS_THAN" # for 'int' | 'float' | 'date' "LESS_THAN_OR_EQUAL" # for 'int' | 'float' | 'date' "EQUAL" # for 'int' | 'float' | 'date' | 'string' "NOT_EQUAL" # for 'int' | 'float' | 'date' | 'string' "BETWEEN" # for 'int' | 'float' | 'date' "NOT_BETWEEN" # for 'int' | 'float' | 'date'
Icons
In addition to using icons in your display rules, you can insert icons into a number of view components (such as tables and buttons).
The YAML example for including an icon is:
style: textColor: green iconName: placeholder-filled iconPosition: RIGHT iconSize: 50 backgroundColor: pink

