styling
Functions for style overrides of diagram elements.
BLUE_ACTOR_FNCS
module-attribute
🔗
BLUE_ACTOR_FNCS: dict[str, Styler] = {'node': parent_is_actor_fills_blue}
CSSStyle for coloring Actor Functions (Functions of Components with the
attribute is_actor set to True) with a blue gradient like in Capella.
CSSStyles
module-attribute
🔗
CSSStyles = StyleOverrides | None
A dictionary with CSS styles. The keys are the attribute names and the
values can be of the types str, aird.RGB and even t.Sequence[aird.RGB]
for coloring a ModelElement with a
gradient.
See also
SYSTEM_CAP_STYLING
module-attribute
🔗
SYSTEM_CAP_STYLING: dict[str, Styler] = {'node': style_center_symbol}
CSSStyle for custom styling of SystemAnalysis diagrams.
The center box is drawn with a white background and a grey dashed line.
Styler
module-attribute
🔗
Styler = Callable[
[ModelElement, "serializers.DiagramSerializer"], StyleOverrides | None
]
Function that produces CSSStyles for given obj.
PVMTObjectType 🔗
Bases: str, Enum
Enumeration of object types for PVMT styling.
get_styleoverrides_from_pvmt 🔗
get_styleoverrides_from_pvmt(
obj: ModelElement, pvmt_styling: _PVMTStyling, obj_type: PVMTObjectType
) -> diagram.StyleOverrides
Return PVMT StyleOverrides for a model element.
If children_coloring is enabled and the element has no direct
PVMT styling, it will inherit styling from the nearest parent
element that has PVMT styling.
Source code in src/capellambse_context_diagrams/styling.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
normalize_pvmt_styling 🔗
normalize_pvmt_styling(
pvmt_styling: dict[str, Any] | list[str] | str | None,
) -> dict[str, t.Any] | None
Normalize pvmt_styling parameter to dict format.
Notes
The following ways of providing pvmt_styling are accepted:
- dict: {"value_groups": [...], "children_coloring": ...}
- list: ["group1", "group2"]
- str: "group1"
- None: None
Source code in src/capellambse_context_diagrams/styling.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
parent_is_actor_fills_blue 🔗
parent_is_actor_fills_blue(
obj: ModelElement, serializer: DiagramSerializer
) -> CSSStyles
Return CSSStyles for given obj rendering it blue.
Source code in src/capellambse_context_diagrams/styling.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
style_center_symbol 🔗
style_center_symbol(
obj: ModelElement, serializer: DiagramSerializer
) -> CSSStyles
Return CSSStyles for given obj.
Source code in src/capellambse_context_diagrams/styling.py
135 136 137 138 139 140 141 142 143 144 145 | |