Browse Source

feat: Added strict as a parameter (#793)

tags/v0.23.2
Dov Benyomin Sohacheski 1 year ago
committed by GitHub
parent
commit
570f644310
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      diagrams/__init__.py

+ 3
- 1
diagrams/__init__.py View File

@@ -85,6 +85,7 @@ class Diagram:
outformat: str = "png", outformat: str = "png",
autolabel: bool = False, autolabel: bool = False,
show: bool = True, show: bool = True,
strict: bool = False,
graph_attr: dict = {}, graph_attr: dict = {},
node_attr: dict = {}, node_attr: dict = {},
edge_attr: dict = {}, edge_attr: dict = {},
@@ -102,6 +103,7 @@ class Diagram:
:param graph_attr: Provide graph_attr dot config attributes. :param graph_attr: Provide graph_attr dot config attributes.
:param node_attr: Provide node_attr dot config attributes. :param node_attr: Provide node_attr dot config attributes.
:param edge_attr: Provide edge_attr dot config attributes. :param edge_attr: Provide edge_attr dot config attributes.
:param strict: Rendering should merge multi-edges.
""" """
self.name = name self.name = name
if not name and not filename: if not name and not filename:
@@ -109,7 +111,7 @@ class Diagram:
elif not filename: elif not filename:
filename = "_".join(self.name.split()).lower() filename = "_".join(self.name.split()).lower()
self.filename = filename self.filename = filename
self.dot = Digraph(self.name, filename=self.filename)
self.dot = Digraph(self.name, filename=self.filename, strict=strict)


# Set attributes. # Set attributes.
for k, v in self._default_graph_attrs.items(): for k, v in self._default_graph_attrs.items():


Loading…
Cancel
Save