Conditional Styling
Many Reports in Txture support automatic visual formatting (e.g. colors, icons, captions...) of individual elements. This formatting is based on Styling Rules. These rules can be defined globally (i.e. for all reports) by an Administrator, or locally within a Report or Report Template.
Each rule consists of a match condition and a style that is applied if the rule matches and an optional label.
- The match criterion determines for which assets or links this rule will apply.
- The styling instructions define the style that is applied if the rule matches.
- The (optional) label is used to show the specific rule within the legend.
Examples of Conditional Stylings
In the following, you are presented with some examples of how to configure conditional stylings.
Example: Display all MySQL Databases with blue background
Reading from top to bottom, the rule only matches Assets of Asset Type Database where the value of the Name Property contains the term mysql
(ignoring case).
Example: Display all Single-Core Servers with a red border
Reading from top to bottom, the rule only matches assets of type Physical Server where the value of the Cores Property is less than or equal to 1.
Example: Showing the number of Cores of a Server in the Sub-Caption
In the rule above, we specify that we want the text with X Cores
to be displayed as sub-caption for all PhysicalServers with 0 or more cores, where X
is replaced by the actual number of cores. This rule can give the following results in a Report:
The results are:
- Server A matches the rule and has 16 cores, resulting in the sub-caption
with 16 Cores
. - Server B matches the rule and has 4 cores, resulting in the sub-caption
with 4 Cores
. - Server C no Cores assigned. The rule does not match, and no sub-caption is displayed.
If we would remove the Cores greater than or equal to zero
match criterion, then any PhysicalServer which has no Cores assigned will be displayed with a ?
as a placeholder, like so:
Info:
Many-valued properties can not be used for sub captions!
Match Criterion
A single match criterion states:
- To which class a matching element belongs (can be any class)
- Which value of which property needs to be present (can be any)
The first of those match criteria is handled by the Type dropdown:
Note that the first entry, All Types, will skip the Type filter altogether. The second criterion is the Property value. You can either match against a particular property value, or choose to skip this criterion. Selecting All Properties from the second dropdown will skip this criterion. Selecting a Property will bring up a value matcher, depending on the Property Type.
Matching String Properties
For String properties, several match operators are available:
The operators are:
- equals: Matches if the property value is exactly equal to the given value.
- not equals: Matches if the property value is not equal to the given value.
- contains: Matches if the property value contains the given text.
- starts with: Matches if the property value starts with the given prefix.
- ends with: Matches if the property value ends with the given suffix.
- regex: Matches if the property value matches the given Regular Expression.
Matching Enumerated Properties
For Enumerated Properties, a value can be selected from a dropdown:
As an alternative to specific value, you can also choose between any value (matches all elements which have some value assigned, but do not specify which one) or no value (matches all elements which have no value assigned).
Matching Number Properties
For Number Properties, you can choose between several operators:
The operators are:
- = (Equals): Matches if the property value is exactly equal to the given value.
- != (Not Equals): Matches if the property value is not equal to the given value.
- > (Greater): Matches if the property value is (strictly) greater than the given value.
- >= (Greater or Equal): Matches if the property value is greater than or equal to the given value.
- < (Less): Matches if the property value is (strictly) less than the given value.
- <= (Less or Equal): Matches if the property value is less than or equal to the given value.
- approx: Matches if the property value is equal to the given value, within a tolerance.
- betweeen (inclusive): Matches if the property value is between the given lower and upper bounds (inclusive).
Matching Boolean Properties
For Boolean Properties, you can select if the value should be true or false:
Styling Instructions
There are four individual components which can receive styling on an element:
- Background Color: The color of the element background
- Border Color: The color of the border around the element
- Icon: Overrides the element Icon provided by the Asset Type
- Caption: Determines how the name of the element is displayed.
Assigning static Background and Border Colors
The background and border color can either be a single static color or value dependent color.
To assing a static color you just pick the color from the color picker:
This color picker allows you to choose from the predefined colors, or mix a new color.
Avoid Color Clashes
Txture uses colors on the UI in order to communicate selections and other information to the user. If you use custom colors, make sure that they do not conflict with those "system colors", otherwise the users of your Reports might get confused.
We recommend that you choose from the default colors to avoid this problem.
Assigning Value dependent Background and Border Colors
The actual color can be derived from the individual property value of the asset.
The most simple example would be apply a traffic light color scheme based on a numeric value like CPU cores:
In this example all servers with two or less cores are red and servers with more than 32 cores are green. Servers without any cores assigned are also colored red.
This is achieved by choosing the property "CPU Cores" from the list of properties for the background color.
The color configuration would look like this:
The color gradient is controlled by positioning the handles on the left side. The values on the right side of the gradient define which values are assigned to a specific color.
All values in between get interpolated. So a server with 16 cores would be shown as yellow without any further configuration. The color for in between values can be tested in the preview sections as shown above.
Caption
The Caption deserves special attention. It can override how the subtitle of an element is displayed:
In the text field, you can either enter regular (fixed) text or variables.
Variables will be replaced when the rule matches a certain element, and allow you to access the Property Values of this element.
A variable starts with a dollar symbol ($
), followed by the name of the Property, surrounded by curly brackets ({
}
).
Legend Label
All Reports which support conditional styling can also display a Legend, indicating what each element style means. The label to be shown in this legend is the last part of the Style Rule configuration.
Merging Conditional Styles
Conditional Styling Rules are evaluated from top to bottom. If two rules match the same element, their styling instructions will be merged. In case that both rules intend to style the same component (e.g. the Background Color), then the rule further down the list will take precedence.
Global Conditional Styles
In addition to the (local) styling rules within reports, a Txture administrator can define global styling rules. Those global rules will be applied in every report before the of the local rules. The global styling rules should therefore be used to provide a good default look for all elements across the entire Txture instance.
Support for Conditional Styles in Reports
The following table shows which report supports which type of node stylings. Please note that aggregating Reports, such as the Donut Chart and the Waterfall Chart, show statistics rather than individual elements, therefore no individual element styling is possible in those Reports.
Report Type | Background Color | Border Color | Icon | Sub-Caption |
---|---|---|---|---|
Aggregation Report1 | -- | -- | -- | |
Query-Count-Over-Time1 | -- | -- | -- | -- |
Donut Chart1 | -- | -- | -- | -- |
Dependency Graph | ||||
Table Report | -- | |||
Waterfall Chart1 | -- | -- | -- | -- |
Gantt Chart | -- | |||
Cluster Table | -- | |||
Cluster Matrix | -- | |||
Chord Diagram | ||||
Tree Report | ||||
Scatter Plot1 | -- | -- | -- | -- |
Repository View | -- |
1aggregation report