generic
Functionality for collection of model data from an instance of MelodyModel
and conversion of it into _elkjs.ELKInputData
.
CONNECTOR_ATTR_NAMES = {'ports', 'inputs', 'outputs'}
module-attribute
๐
Attribute of GenericElements for receiving connections.
DIAGRAM_TYPE_TO_CONNECTOR_NAMES: dict[DT, set[str]] = {DT.OAB: set(), DT.OAIB: set(), DT.OCB: set(), DT.MCB: set(), DT.SAB: CONNECTOR_ATTR_NAMES, DT.SDFB: CONNECTOR_ATTR_NAMES, DT.LAB: CONNECTOR_ATTR_NAMES, DT.LDFB: CONNECTOR_ATTR_NAMES, DT.PAB: CONNECTOR_ATTR_NAMES | PHYSICAL_CONNECTOR_ATTR_NAMES, DT.PDFB: CONNECTOR_ATTR_NAMES | PHYSICAL_CONNECTOR_ATTR_NAMES}
module-attribute
๐
Supported diagram types mapping to the attribute name of connectors.
MARKER_PADDING = makers.PORT_PADDING
module-attribute
๐
Default padding of markers in pixels.
MARKER_SIZE = 3
module-attribute
๐
Default size of marker-ends in pixels.
PHYSICAL_CONNECTOR_ATTR_NAMES = {'physical_ports'}
module-attribute
๐
Attribute of PhysicalComponents for receiving connections.
ExchangeData
๐
Bases: NamedTuple
Exchange data for ELK.
Source code in capellambse_context_diagrams/collectors/generic.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
elkdata: _elkjs.ELKInputData
instance-attribute
๐
The collected elkdata to add the edges in there.
exchange: common.GenericElement
instance-attribute
๐
An exchange from the capellambse model.
filter_iterable: cabc.Iterable[str]
instance-attribute
๐
A string that maps to a filter label adjuster
callable in
FILTER_LABEL_ADJUSTERS
.
is_hierarchical: bool = False
class-attribute
instance-attribute
๐
True if exchange isn't global, i.e. nested inside a box.
params: dict[str, t.Any] | None = None
class-attribute
instance-attribute
๐
Optional dictionary of additional render params.
collect_exchange_endpoints(ex)
๐
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(obj)
๐
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(diagram, *, width=makers.EOI_WIDTH, no_symbol=False)
๐
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(data, endpoint_collector=collect_exchange_endpoints)
๐
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
.
Parameters๐
data
Instance of ExchangeData
storing all needed elements for collection.
endpoint_collector
Optional collector function for Exchange endpoints. Defaults to
collect_exchange_endpoints
.
Returns๐
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(obj)
๐
Return the UUIDs from all owners of obj
.
Source code in capellambse_context_diagrams/collectors/generic.py
255 256 257 258 259 260 261 262 263 264 265 |
|
move_edges(boxes, connections, data)
๐
Move edges to boxes.
Source code in capellambse_context_diagrams/collectors/generic.py
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 |
|
move_parent_boxes_to_owner(boxes, obj, data, filter_types=PackageTypes)
๐
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 221 222 |
|