View Notations
View notations (or key/legend) provide information about the meanings of shapes and styles. It’s important to provide a key explaining the difference in colors and shapes.
It is possible to define global notations (per element kind) and local (per view).
Global notations
Section titled “Global notations”As comes from the name, global notations apply to all views, and defined in the specification
block:
specification {
element customer { notation "Person, Customer" style { shape person color green } }
element staff { notation "Person, Staff" style { shape person } }}
Notations will be applied to all views with these elements and displayed as:
Live example.
Expand the following view and click on help icon in bottom right:
Local notations
Section titled “Local notations”Local notations override global ones and apply to a specific view.
With style predicate
Section titled “With style predicate”When you change the style, you can add a notation to explain the meaning:
view {
style webApp1, webApp2 { notation "Application under development" color amber }
style element.tag = #deprecated { notation "Deprecated" color muted }
}
Notations are not merged or grouped, the last one will be applied.
With overrides
Section titled “With overrides”Define notation when include elements:
view {
include * where kind is microservice and tag is #deprecated with { notation "Deprecated microservice" shape rectangle color muted }
}
This override has the highest priority, then defined within style predicates, and finally global notations.