Skip to content

Commit

Permalink
ignore shape in graph object override - fixes #98 (#103)
Browse files Browse the repository at this point in the history
* ignore shape in graph object override - fixes #98

* only ignore shape when it is none, prevent g2d output in spec test

* update subgraph.xml spec
  • Loading branch information
hbmartin authored Nov 6, 2024
1 parent b1c8b61 commit 4a40372
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions graphviz2drawio/mx/GraphObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ def enrich_from_graph(self, attrs: dict | None) -> None:
continue
if k in _blacklist_attrs:
continue
if k == "shape" and v == "none":
continue
self.__setattr__(k, v)
14 changes: 7 additions & 7 deletions specs/directed/subgraph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@
<mxPoint x="476.85" y="155.39999999999998" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="node1" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;web1&lt;/font&gt;" style="verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxCell id="node1" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;web1&lt;/font&gt;" style="ellipse;verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxGeometry as="geometry" relative="1">
<mxPoint x="504.0" y="303.25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="node6" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;memcached&lt;/font&gt;" style="verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxCell id="node6" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;memcached&lt;/font&gt;" style="ellipse;verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxGeometry as="geometry" relative="1">
<mxPoint x="658.8" y="393.25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="node7" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;userdb&lt;/font&gt;" style="verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxCell id="node7" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;userdb&lt;/font&gt;" style="ellipse;verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxGeometry as="geometry" relative="1">
<mxPoint x="658.8" y="573.25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="node2" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;web2&lt;/font&gt;" style="verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxCell id="node2" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;web2&lt;/font&gt;" style="ellipse;verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxGeometry as="geometry" relative="1">
<mxPoint x="504.0" y="663.25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="node3" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;web3&lt;/font&gt;" style="verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxCell id="node3" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;web3&lt;/font&gt;" style="ellipse;verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxGeometry as="geometry" relative="1">
<mxPoint x="504.0" y="483.25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="node4" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;dns&lt;/font&gt;" style="verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxCell id="node4" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;dns&lt;/font&gt;" style="ellipse;verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxGeometry as="geometry" relative="1">
<mxPoint x="194.4" y="483.25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="node5" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;lb&lt;/font&gt;" style="verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxCell id="node5" value="&lt;font style='font-size: 13.0px;' face='Sans-Serif' color='#2d3436'&gt;lb&lt;/font&gt;" style="ellipse;verticalAlign=bottom;html=1;rounded=0;labelBackgroundColor=none;strokeColor=none;fillColor=none;strokeWidth=1;dashed=0;" parent="1" vertex="1">
<mxGeometry as="geometry" relative="1">
<mxPoint x="349.2" y="483.25" as="offset" />
</mxGeometry>
Expand Down
4 changes: 2 additions & 2 deletions test_specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ process_files() {
rel_path="${file#$src_dir/}"
output_file="$out_dir/${rel_path%.gv.txt}.xml"
mkdir -p "$(dirname "$output_file")"
python3 -m graphviz2drawio "$file" -o "$output_file"
echo "Processed: $file -> $output_file"
python3 -m graphviz2drawio "$file" -o "$output_file" > /dev/null 2>&1
echo "Processed: $file -> $output_file ($?)"
done
}

Expand Down

0 comments on commit 4a40372

Please sign in to comment.