Skip to content

Commit

Permalink
remove tag and parent named params
Browse files Browse the repository at this point in the history
  • Loading branch information
hbmartin committed Jul 2, 2024
1 parent 57d2ea2 commit 99ad032
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions graphviz2drawio/mx/MxGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ def __init__(self, nodes, edges):
self.edges = edges
self.graph = ET.Element(MxConst.GRAPH)
self.root = ET.SubElement(self.graph, MxConst.ROOT)
ET.SubElement(parent=self.root, tag=MxConst.CELL, attrib={"id": "0"})
ET.SubElement(
parent=self.root, tag=MxConst.CELL, attrib={"id": "1", "parent": "0"}
)
ET.SubElement(self.root, MxConst.CELL, attrib={"id": "0"})
ET.SubElement(self.root, MxConst.CELL, attrib={"id": "1", "parent": "0"})

for edge in edges:
self.add_edge(edge)
Expand All @@ -25,8 +23,8 @@ def add_edge(self, edge):
source, target = self.get_edge_source_target(edge)
style = self.get_edge_style(edge, source, target)
edge_element = ET.SubElement(
parent=self.root,
tag=MxConst.CELL,
self.root,
MxConst.CELL,
attrib={
"id": edge.sid,
"style": style,
Expand Down Expand Up @@ -90,8 +88,8 @@ def add_node(self, node):
style = Styles.get_for_shape(node.shape).format(fill=fill, stroke=stroke)

node_element = ET.SubElement(
parent=self.root,
tag=MxConst.CELL,
self.root,
MxConst.CELL,
attrib={
"id": node.sid,
"value": node.text_to_mx_value(),
Expand Down

0 comments on commit 99ad032

Please sign in to comment.