context
Definitions of Custom Accessor- and Diagram-Classtypes based on
Accessor
and AbstractDiagram
.
CableTreeAccessor 🔗
CableTreeAccessor(dgcls: str, render_params: dict[str, t.Any] | None = None)
Bases: ContextAccessor
Provides access to the cable tree diagrams.
Source code in capellambse_context_diagrams/context.py
52 53 54 55 56 57 |
|
__get__ 🔗
__get__(obj: m.T | None, objtype: type | None = None) -> m.Accessor | ContextDiagram
Make a CableTreeView for the given model object.
Source code in capellambse_context_diagrams/context.py
195 196 197 198 199 200 201 202 203 204 205 |
|
CableTreeViewDiagram 🔗
CableTreeViewDiagram(class_: str, obj: m.ModelElement, *, render_styles: dict[str, styling.Styler] | None = None, default_render_parameters: dict[str, t.Any])
Bases: ContextDiagram
An automatically generated CableTreeView.
Source code in capellambse_context_diagrams/context.py
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 |
|
ClassTreeAccessor 🔗
ClassTreeAccessor(diagclass: str, render_params: dict[str, t.Any] | None = None)
Bases: ContextAccessor
Provides access to the tree view diagrams.
Source code in capellambse_context_diagrams/context.py
129 130 131 132 133 |
|
__get__ 🔗
__get__(obj: m.T | None, objtype: type | None = None) -> m.Accessor | ContextDiagram
Make a ClassTreeDiagram for the given model object.
Source code in capellambse_context_diagrams/context.py
135 136 137 138 139 140 141 142 143 144 145 |
|
ClassTreeDiagram 🔗
ClassTreeDiagram(class_: str, obj: m.ModelElement, *, render_styles: dict[str, styling.Styler] | None = None, default_render_parameters: dict[str, t.Any])
Bases: ContextDiagram
An automatically generated ClassTree Diagram.
This diagram is exclusively for Class
es.
Source code in capellambse_context_diagrams/context.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
|
ContextAccessor 🔗
ContextAccessor(dgcls: str, render_params: dict[str, t.Any] | None = None)
Bases: Accessor
Provides access to the context diagrams.
Source code in capellambse_context_diagrams/context.py
52 53 54 55 56 57 |
|
__get__ 🔗
__get__(obj: None, objtype: type[t.Any]) -> ContextAccessor
__get__(obj: m.T, objtype: type[m.T] | None = None) -> ContextDiagram
__get__(obj: m.T | None, objtype: type | None = None) -> m.Accessor | ContextDiagram
Make a ContextDiagram for the given model object.
Source code in capellambse_context_diagrams/context.py
65 66 67 68 69 70 71 72 73 |
|
ContextDiagram 🔗
ContextDiagram(class_: str, obj: m.ModelElement, *, render_styles: dict[str, styling.Styler] | None = None, default_render_parameters: dict[str, t.Any])
Bases: AbstractDiagram
An automatically generated context diagram.
ATTRIBUTE | DESCRIPTION |
---|---|
target |
The
|
styleclass |
The diagram class (for e.g. [LAB]).
|
render_styles |
Dictionary with the
|
serializer |
The serializer builds a
|
filters |
A list of filter names that are applied during collection of
context. Currently this is only done in
TYPE:
|
Notes
- display_symbols_as_boxes — Display objects that are normally displayed as symbol as a simple box instead, with the symbol being the box' icon. This avoids the object of interest to become one giant, oversized symbol in the middle of the diagram, and instead keeps the symbol small and only enlarges the surrounding box.
- display_parent_relation — Display objects with a parent relationship to the object of interest as the parent box.
- display_derived_interfaces — Display derived objects collected from additional collectors beside the main collector for building the context.
- slim_center_box — Minimal width for the center box, containing just the icon and the label. This is False if hierarchy was identified.
- display_port_labels — Display port labels on the diagram.
- port_label_position - Position of the port labels. See
PORT_LABEL_POSITION
. - hide_direct_children - Hide direct children of the object of interest.
- display_unused_ports - Display ports that are not connected to an edge.
Source code in capellambse_context_diagrams/context.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
|
FilterSet 🔗
FilterSet(diagram: m.AbstractDiagram)
Bases: MutableSet
A set that stores filter_names and invalidates diagram cache.
Source code in capellambse_context_diagrams/context.py
364 365 366 367 368 369 |
|
elk_input_data 🔗
elk_input_data(params: dict[str, t.Any]) -> CollectorOutputData
Returns the ELK input data.
Source code in capellambse_context_diagrams/context.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
|
DataFlowAccessor 🔗
DataFlowAccessor(diagclass: str, render_params: dict[str, t.Any] | None = None)
Bases: ContextAccessor
Source code in capellambse_context_diagrams/context.py
173 174 175 176 177 |
|
__get__ 🔗
__get__(obj: m.T | None, objtype: type | None = None) -> m.Accessor | ContextDiagram
Make a DataFlowViewDiagram for the given model object.
Source code in capellambse_context_diagrams/context.py
179 180 181 182 183 184 185 186 187 188 189 |
|
DataFlowViewDiagram 🔗
DataFlowViewDiagram(class_: str, obj: m.ModelElement, *, render_styles: dict[str, styling.Styler] | None = None, default_render_parameters: dict[str, t.Any])
Bases: ContextDiagram
An automatically generated DataFlowViewDiagram.
Source code in capellambse_context_diagrams/context.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 |
|
FunctionalContextAccessor 🔗
FunctionalContextAccessor(dgcls: str, render_params: dict[str, t.Any] | None = None)
Bases: ContextAccessor
Source code in capellambse_context_diagrams/context.py
52 53 54 55 56 57 |
|
__get__ 🔗
__get__(obj: m.T | None, objtype: type | None = None) -> m.Accessor | ContextDiagram
Make a ContextDiagram for the given model object.
Source code in capellambse_context_diagrams/context.py
112 113 114 115 116 117 118 119 120 121 122 |
|
FunctionalContextDiagram 🔗
FunctionalContextDiagram(class_: str, obj: m.ModelElement, *, default_render_parameters: dict[str, t.Any])
Bases: ContextDiagram
An automatically generated Context Diagram exclusively for Components.
Source code in capellambse_context_diagrams/context.py
553 554 555 556 557 558 559 560 561 562 563 564 565 566 |
|
InterfaceContextAccessor 🔗
InterfaceContextAccessor(diagclass: dict[type[m.ModelElement], str], render_params: dict[str, t.Any] | None = None)
Bases: ContextAccessor
Provides access to the interface context diagrams.
Source code in capellambse_context_diagrams/context.py
90 91 92 93 94 95 96 |
|
__get__ 🔗
__get__(obj: m.T | None, objtype: type | None = None) -> m.Accessor | ContextDiagram
Make a ContextDiagram for the given model object.
Source code in capellambse_context_diagrams/context.py
98 99 100 101 102 103 104 105 106 107 108 |
|
InterfaceContextDiagram 🔗
InterfaceContextDiagram(class_: str, obj: m.ModelElement, *, render_styles: dict[str, styling.Styler] | None = None, default_render_parameters: dict[str, t.Any])
Bases: ContextDiagram
An automatically generated Context Diagram exclusively for
ComponentExchange
s.
ATTRIBUTE | DESCRIPTION |
---|---|
dangling_functional_exchanges |
A list of
TYPE:
|
Notes
The following render parameters are available:
- include_interface — Boolean flag to enable inclusion of the context diagram target: The interface ComponentExchange.
- include_port_allocations — Boolean flag to enable rendering of port allocations.
- hide_functions — Boolean flag to enable white box view: Only displaying Components or Entities.
- display_port_labels — Display port labels on the diagram.
- port_label_position — Position of the port labels. See
PORT_LABEL_POSITION
.
In addition to all other render parameters of
ContextDiagram
.
Source code in capellambse_context_diagrams/context.py
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 |
|
RealizationViewContextAccessor 🔗
RealizationViewContextAccessor(diagclass: str, render_params: dict[str, t.Any] | None = None)
Bases: ContextAccessor
Provides access to the realization view diagrams.
Source code in capellambse_context_diagrams/context.py
152 153 154 155 156 |
|
__get__ 🔗
__get__(obj: m.T | None, objtype: type | None = None) -> m.Accessor | ContextDiagram
Make a RealizationViewDiagram for the given model object.
Source code in capellambse_context_diagrams/context.py
158 159 160 161 162 163 164 165 166 167 168 |
|
RealizationViewDiagram 🔗
RealizationViewDiagram(class_: str, obj: m.ModelElement, *, render_styles: dict[str, styling.Styler] | None = None, default_render_parameters: dict[str, t.Any])
Bases: ContextDiagram
An automatically generated RealizationViewDiagram Diagram.
This diagram is exclusively for Activity
, Function
s,
Entity
and Components
of all layers.
Source code in capellambse_context_diagrams/context.py
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 |
|
add_context 🔗
add_context(data: _elkjs.ELKOutputData, is_legend: bool = False) -> None
Add all connected nodes as context to all elements.
Source code in capellambse_context_diagrams/context.py
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 |
|
adjust_layer_sizing 🔗
adjust_layer_sizing(data: _elkjs.ELKInputData, layout: _elkjs.ELKOutputData, layer_sizing: t.Literal['UNION', 'WIDTH', 'HEIGHT', 'INDIVIDUAL']) -> None
Set nodeSize.minimum
config in the layoutOptions.
Source code in capellambse_context_diagrams/context.py
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 |
|
calculate_label_position 🔗
calculate_label_position(x: float, y: float, width: float, height: float, padding: float = 10.0) -> tuple[float, float, float]
Calculate the position of the label and tspan.
The function calculates the center of the rectangle and uses the rectangle's width and height to adjust its position within it. The text is assumed to be horizontally and vertically centered within the rectangle. The tspan y coordinate is for positioning the label right under the left side of the rectangle.
PARAMETER | DESCRIPTION |
---|---|
x
|
The x coordinate of the label position.
TYPE:
|
y
|
The y coordinate of the label position.
TYPE:
|
width
|
Width of the label.
TYPE:
|
height
|
Height of the label
TYPE:
|
padding
|
The padding for the label.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
position
|
A tuple containing the x- and y-coordinate for the text element and the adjusted y-coordinate for the tspan element. |
Source code in capellambse_context_diagrams/context.py
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 |
|
stack_diagrams 🔗
stack_diagrams(first: cdiagram.Diagram, second: cdiagram.Diagram, axis: t.Literal['x', 'y'] = 'x') -> None
Add the diagram elements from right
to left inline.
Source code in capellambse_context_diagrams/context.py
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 |
|
try_to_layout 🔗
try_to_layout(data: _elkjs.ELKInputData) -> _elkjs.ELKOutputData
Try calling elkjs, raise a JSONDecodeError if it fails.
Source code in capellambse_context_diagrams/context.py
860 861 862 863 864 865 866 |
|