|
|
@@ -111,7 +111,7 @@ class Parser:
|
|
|
|
|
|
geom = Parser.parse_cell_geometry(croot.find(".//mxGeometry"))
|
|
|
if geom != None:
|
|
|
- return Vertex(cid, value, parent, [], properties, style, atts, geom)
|
|
|
+ return Vertex(cid, value, parent, [], properties, style, atts, geom, [], [])
|
|
|
else:
|
|
|
return Cell(cid, value, parent, [], properties, style, atts)
|
|
|
|
|
|
@@ -158,7 +158,7 @@ class Parser:
|
|
|
cell_dict = {} # mapping from ID to cell
|
|
|
Parser.parse_components(mxgm[0], cell_dict)
|
|
|
|
|
|
- # resolve parent/child references
|
|
|
+ # resolve parent/child, source/target references
|
|
|
root = None
|
|
|
for cell_id, cell in cell_dict.items():
|
|
|
parent_id = cell.parent # cell.parent will be overwritten with the actual cell
|
|
|
@@ -169,8 +169,10 @@ class Parser:
|
|
|
cell.parent = cell_dict[parent_id]
|
|
|
if isinstance(cell, Edge):
|
|
|
if cell.source:
|
|
|
+ cell_dict[cell.source].outgoing.append(cell)
|
|
|
cell.source = cell_dict[cell.source]
|
|
|
if cell.target:
|
|
|
+ cell_dict[cell.target].incoming.append(cell)
|
|
|
cell.target = cell_dict[cell.target]
|
|
|
|
|
|
if root == None:
|