pyArchimate 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyarchimate-2.0.0/src/pyArchimate.egg-info → pyarchimate-2.0.2}/PKG-INFO +2 -2
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/README.md +1 -1
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/pyproject.toml +1 -1
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/svg_export.py +16 -8
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/writers/archiWriter.py +2 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/writers/archimateWriter.py +6 -3
- {pyarchimate-2.0.0 → pyarchimate-2.0.2/src/pyArchimate.egg-info}/PKG-INFO +2 -2
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/LICENSE +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/setup.cfg +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/checker_rules.yml +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/constants.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/derivation.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/element.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/enums.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/exceptions.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/helpers/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/helpers/diagram.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/helpers/logging.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/helpers/parsing.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/helpers/properties.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/logger.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/model.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/pyArchimate.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/readers/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/readers/_archireader_helpers.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/readers/_arisamlreader_helpers.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/readers/archiReader.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/readers/archimateReader.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/readers/arisAMLreader.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/relationship.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/algorithms/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/algorithms/force_directed.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/algorithms/hierarchical.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/core.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/symbols/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/symbols/archimate_relationships.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/symbols/archimate_symbols.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/symbols/color_palette.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/format/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/format/element_format.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/layout_engine.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/label_placement.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/layer_constraints.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/obstacle_map.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/orthogonal.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/segment_separation.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/utils/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/utils/edge_utils.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/utils/geometry.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/utils/graph.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/viewpoint.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/viewpoint_registry.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/writers/__init__.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/writers/csvWriter.py +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate.egg-info/SOURCES.txt +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate.egg-info/dependency_links.txt +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate.egg-info/requires.txt +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate.egg-info/top_level.txt +0 -0
- {pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate.egg-info/zip-safe +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyArchimate
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: A library to create & manage Archimate files
|
|
5
5
|
Author-email: Xavier Mayeur <xavier@mayeur.be>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -30,7 +30,7 @@ Dynamic: license-file
|
|
|
30
30
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
31
31
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
32
32
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
33
|
-
[](https://pyarchimate.readthedocs.io)
|
|
34
34
|
|
|
35
35
|
Documentation: [readthedocs.org](https://pyarchimate.readthedocs.io)
|
|
36
36
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
12
12
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
13
13
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
14
|
-
[](https://pyarchimate.readthedocs.io)
|
|
15
15
|
|
|
16
16
|
Documentation: [readthedocs.org](https://pyarchimate.readthedocs.io)
|
|
17
17
|
|
|
@@ -181,7 +181,7 @@ class SVGExportService:
|
|
|
181
181
|
self._add_defs(svg)
|
|
182
182
|
|
|
183
183
|
# Add white background rectangle
|
|
184
|
-
self._add_background(svg, svg_width, svg_height)
|
|
184
|
+
self._add_background(svg, svg_width, svg_height, svg_min_x, svg_min_y)
|
|
185
185
|
|
|
186
186
|
# Build complete nodes dictionary including nested nodes (for connection rendering)
|
|
187
187
|
complete_nodes_dict = self._build_complete_nodes_dict(view)
|
|
@@ -428,20 +428,24 @@ class SVGExportService:
|
|
|
428
428
|
},
|
|
429
429
|
)
|
|
430
430
|
|
|
431
|
-
def _add_background(
|
|
431
|
+
def _add_background(
|
|
432
|
+
self, svg: ET.Element, width: float, height: float, min_x: float = 0.0, min_y: float = 0.0
|
|
433
|
+
) -> None:
|
|
432
434
|
"""Add white background rectangle to SVG canvas.
|
|
433
435
|
|
|
434
436
|
Args:
|
|
435
437
|
svg: SVG root element
|
|
436
438
|
width: SVG canvas width
|
|
437
439
|
height: SVG canvas height
|
|
440
|
+
min_x: left of the SVG canvas (view box), which may be negative
|
|
441
|
+
min_y: top of the SVG canvas (view box), which may be negative
|
|
438
442
|
"""
|
|
439
443
|
ET.SubElement(
|
|
440
444
|
svg,
|
|
441
445
|
"rect",
|
|
442
446
|
{
|
|
443
|
-
"x":
|
|
444
|
-
"y":
|
|
447
|
+
"x": str(int(min_x)),
|
|
448
|
+
"y": str(int(min_y)),
|
|
445
449
|
"width": str(int(width)),
|
|
446
450
|
"height": str(int(height)),
|
|
447
451
|
"fill": "white",
|
|
@@ -860,7 +864,7 @@ class SVGExportService:
|
|
|
860
864
|
tspan.text = line
|
|
861
865
|
|
|
862
866
|
def _word_wrap_text(self, text: str, max_width: float) -> list[str]:
|
|
863
|
-
"""Word wrap text to fit within max_width.
|
|
867
|
+
"""Word wrap text to fit within max_width, keeping its line breaks.
|
|
864
868
|
|
|
865
869
|
Args:
|
|
866
870
|
text: Text to wrap
|
|
@@ -869,6 +873,9 @@ class SVGExportService:
|
|
|
869
873
|
Returns:
|
|
870
874
|
List of text lines
|
|
871
875
|
"""
|
|
876
|
+
if "\n" in text:
|
|
877
|
+
return [line for paragraph in text.splitlines() for line in self._word_wrap_text(paragraph, max_width)]
|
|
878
|
+
|
|
872
879
|
# Estimate characters per line (rough: ~6 pixels per character)
|
|
873
880
|
chars_per_line = max(1, int(max_width / 6))
|
|
874
881
|
|
|
@@ -1087,8 +1094,9 @@ class SVGExportService:
|
|
|
1087
1094
|
return source_node, target_node
|
|
1088
1095
|
|
|
1089
1096
|
def _build_relationship_label(self, rel_type: str, conn: Any) -> str:
|
|
1090
|
-
"""Return label text,
|
|
1091
|
-
|
|
1097
|
+
"""Return label text: the relationship name, or its short type name when it has no name, with the
|
|
1098
|
+
influence_strength appended for Influence relationships."""
|
|
1099
|
+
label = getattr(conn, "name", None) or self._get_short_type_name(rel_type)
|
|
1092
1100
|
if rel_type in ("Influence", "InfluenceRelationship"):
|
|
1093
1101
|
strength = getattr(conn, "influence_strength", None) or getattr(conn, "_influence_strength", None)
|
|
1094
1102
|
if strength:
|
|
@@ -1194,7 +1202,7 @@ class SVGExportService:
|
|
|
1194
1202
|
|
|
1195
1203
|
# Render connection label
|
|
1196
1204
|
rel_type = getattr(conn, "type", "Relationship")
|
|
1197
|
-
label_text = self.
|
|
1205
|
+
label_text = self._build_relationship_label(rel_type, conn)
|
|
1198
1206
|
|
|
1199
1207
|
if label_text and len(points) >= 2:
|
|
1200
1208
|
self._render_connection_label(svg, points, label_text)
|
|
@@ -406,6 +406,8 @@ def archi_writer(model: Model, file_path: str) -> str:
|
|
|
406
406
|
"""
|
|
407
407
|
|
|
408
408
|
root = et.fromstring(xml)
|
|
409
|
+
# Without the blank text of the template, pretty_print can indent the whole document
|
|
410
|
+
root.text = None
|
|
409
411
|
xsi_url = "http://www.w3.org/2001/XMLSchema-instance" # NOSONAR
|
|
410
412
|
xsi = et.QName(xsi_url, "type")
|
|
411
413
|
folders = _create_folders(root)
|
|
@@ -238,7 +238,7 @@ def _write_node_style(n_elem: _Element, n: Node) -> None:
|
|
|
238
238
|
rgb = RGBA()
|
|
239
239
|
rgb.color = n.line_color
|
|
240
240
|
lc.set("r", str(rgb.r))
|
|
241
|
-
lc.set("g", str(rgb.
|
|
241
|
+
lc.set("g", str(rgb.g))
|
|
242
242
|
lc.set("b", str(rgb.b))
|
|
243
243
|
lc.set("a", "100" if n.opacity is None else str(n.lc_opacity))
|
|
244
244
|
if n.fill_color is not None:
|
|
@@ -374,6 +374,8 @@ def archimate_writer(model: Model, file_path: str | None = None) -> str:
|
|
|
374
374
|
"""
|
|
375
375
|
|
|
376
376
|
root = et.fromstring(xml)
|
|
377
|
+
# Without the blank text of the template, pretty_print can indent the whole document
|
|
378
|
+
root.text = None
|
|
377
379
|
nsp_url = "http://www.opengroup.org/xsd/archimate/3.0/" # NOSONAR
|
|
378
380
|
xsi_url = "http://www.w3.org/2001/XMLSchema-instance" # NOSONAR
|
|
379
381
|
xsi = et.QName(xsi_url, "type")
|
|
@@ -393,14 +395,15 @@ def archimate_writer(model: Model, file_path: str | None = None) -> str:
|
|
|
393
395
|
_write_relationships(root, model, xsi)
|
|
394
396
|
_write_organizations(root, model, ns_find)
|
|
395
397
|
|
|
398
|
+
# The definitions are written before the views, as required by the schema, but filled after them, so that they
|
|
399
|
+
# also include the definitions of the view properties
|
|
396
400
|
pd = et.SubElement(root, "propertyDefinitions")
|
|
401
|
+
_write_views(root, model, xsi)
|
|
397
402
|
for k, v in model.pdefs.items():
|
|
398
403
|
p = et.SubElement(pd, "propertyDefinition", identifier=k, type="string")
|
|
399
404
|
p_name = et.SubElement(p, "name")
|
|
400
405
|
p_name.text = str(v)
|
|
401
406
|
|
|
402
|
-
_write_views(root, model, xsi)
|
|
403
|
-
|
|
404
407
|
pd_check = root.find("propertyDefinitions")
|
|
405
408
|
if pd_check is not None and pd_check.find("propertyDefinition") is None:
|
|
406
409
|
root.remove(pd_check)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyArchimate
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: A library to create & manage Archimate files
|
|
5
5
|
Author-email: Xavier Mayeur <xavier@mayeur.be>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -30,7 +30,7 @@ Dynamic: license-file
|
|
|
30
30
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
31
31
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
32
32
|
[](https://sonarcloud.io/project/overview?id=pyArchimate_pyArchimate)
|
|
33
|
-
[](https://pyarchimate.readthedocs.io)
|
|
34
34
|
|
|
35
35
|
Documentation: [readthedocs.org](https://pyarchimate.readthedocs.io)
|
|
36
36
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/algorithms/force_directed.py
RENAMED
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/algorithms/hierarchical.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/symbols/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/export/symbols/color_palette.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/format/element_format.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/label_placement.py
RENAMED
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/layer_constraints.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyarchimate-2.0.0 → pyarchimate-2.0.2}/src/pyArchimate/view/layout/routing/segment_separation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|