generic
Functionality for collection of model data from an instance of MelodyModel
and conversion of it into _elkjs.ELKInputData
.
CONNECTOR_ATTR_NAMES
module-attribute
๐
CONNECTOR_ATTR_NAMES = ('ports', 'inputs', 'outputs')
Attribute of ModelElements for receiving connections.
DIAGRAM_TYPE_TO_CONNECTOR_NAMES
module-attribute
๐
DIAGRAM_TYPE_TO_CONNECTOR_NAMES: dict[DiagramType, tuple[str, ...]] = {OAB: (), OAIB: (), OCB: (), MCB: (), SAB: CONNECTOR_ATTR_NAMES, SDFB: CONNECTOR_ATTR_NAMES, LAB: CONNECTOR_ATTR_NAMES, LDFB: CONNECTOR_ATTR_NAMES, PAB: CONNECTOR_ATTR_NAMES + PHYSICAL_CONNECTOR_ATTR_NAMES, PDFB: CONNECTOR_ATTR_NAMES + PHYSICAL_CONNECTOR_ATTR_NAMES}
Supported diagram types mapping to the attribute name of connectors.
MARKER_PADDING
module-attribute
๐
MARKER_PADDING = PORT_PADDING
Default padding of markers in pixels.
PHYSICAL_CONNECTOR_ATTR_NAMES
module-attribute
๐
PHYSICAL_CONNECTOR_ATTR_NAMES = ('physical_ports')
Attribute of PhysicalComponents for receiving connections.
ExchangeData ๐
Bases: NamedTuple
Exchange data for ELK.
elkdata
instance-attribute
๐
elkdata: ELKInputData
The collected elkdata to add the edges in there.
filter_iterable
instance-attribute
๐
filter_iterable: Iterable[str]
A string that maps to a filter label adjuster
callable in
FILTER_LABEL_ADJUSTERS
.
is_hierarchical
class-attribute
instance-attribute
๐
is_hierarchical: bool = False
True if exchange isn't global, i.e. nested inside a box.
params
class-attribute
instance-attribute
๐
params: dict[str, Any] | None = None
Optional dictionary of additional render params.
collect_exchange_endpoints ๐
collect_exchange_endpoints(ex: ExchangeData | m.ModelElement) -> SourceAndTarget
Safely collect exchange endpoints from ex
.
Source code in capellambse_context_diagrams/collectors/generic.py
73 74 75 76 77 78 79 80 81 |
|
collect_label ๐
collect_label(obj: m.ModelElement) -> str | None
Return the label of a given object.
The label usually comes from the .name
attribute. Special handling
for interaction.AbstractCapabilityExtend
and interaction.AbstractCapabilityInclude`.
Source code in capellambse_context_diagrams/collectors/generic.py
182 183 184 185 186 187 188 189 190 191 192 193 |
|
collector ๐
collector(diagram: context.ContextDiagram, *, width: int | float = makers.EOI_WIDTH, no_symbol: bool = False) -> _elkjs.ELKInputData
Returns ELKInputData
with only centerbox in children and config.
Source code in capellambse_context_diagrams/collectors/generic.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
exchange_data_collector ๐
exchange_data_collector(data: ExchangeData, endpoint_collector: cabc.Callable[[m.ModelElement], SourceAndTarget] = collect_exchange_endpoints) -> SourceAndTarget
Return source and target port from exchange
.
Additionally inflate elkdata.children
with input data for ELK.
You can handover a filter name that corresponds to capellambse
filters. This will apply filter functionality from
filters.FILTER_LABEL_ADJUSTERS
.
PARAMETER | DESCRIPTION |
---|---|
data
|
Instance of
TYPE:
|
endpoint_collector
|
Optional collector function for Exchange endpoints. Defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
(source, target)
|
A tuple consisting of the exchange's source and target elements. |
Source code in capellambse_context_diagrams/collectors/generic.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
get_all_owners ๐
get_all_owners(obj: m.ModelElement) -> cabc.Iterator[str]
Return the UUIDs from all owners of obj
.
Source code in capellambse_context_diagrams/collectors/generic.py
264 265 266 267 268 269 |
|
move_edges ๐
move_edges(boxes: cabc.Mapping[str, _elkjs.ELKInputChild], connections: cabc.Iterable[m.ModelElement], data: _elkjs.ELKInputData) -> None
Move edges to boxes.
Source code in capellambse_context_diagrams/collectors/generic.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
move_parent_boxes_to_owner ๐
move_parent_boxes_to_owner(boxes: dict[str, _elkjs.ELKInputChild], obj: m.ModelElement, data: _elkjs.ELKInputData, filter_types: tuple[type, ...] = PackageTypes) -> None
Move boxes to their owner box.
Source code in capellambse_context_diagrams/collectors/generic.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|