C.2 Using the Opacity Attribute

The opacity attribute determines the element’s transparency based on the element condition. The following code example shows an SVG rectangle object whose opacity attribute is set by the Layout bind engine, based on the bound element’s condition. Multiple options could be specified in the when attribute to allow banding of the opacity levels. The following example creates four bands across the set of element conditions, where opacity is 100% for elements with a CRITICAL condition and 20 percent for elements with an UNKNOWN condition.

<rect viewlink="org=Parent/root=Organizations" stroke="#000000" visibility="visible" dname="org=Parent/root=Organizations" width="213" fill="rgb(255,64,64)" stroke-width="3" height="163" opacity="1.0" x="-253" y="364">
    <bind:fill property="condition" default="" undo="#c0c0c0" set="" when=""/> 
    <bind:opacity property="condition" default="1.0"  when="Unmanaged+Unknown=0.2,Info+OK=0.4,Major+Minor=0.6,Critical=1.0"/>

Another option is changing the rectangle’s line width (1, 2, 3, and so on) according to the element condition. Use the following code:

when='ok+info=1,minor=2,major+critical=3' default='1'/>