Skip to content

Commit 4a40372

Browse files
authored
ignore shape in graph object override - fixes #98 (#103)
* 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
1 parent b1c8b61 commit 4a40372

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

graphviz2drawio/mx/GraphObj.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ def enrich_from_graph(self, attrs: dict | None) -> None:
1515
continue
1616
if k in _blacklist_attrs:
1717
continue
18+
if k == "shape" and v == "none":
19+
continue
1820
self.__setattr__(k, v)

specs/directed/subgraph.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,37 @@
88
<mxPoint x="476.85" y="155.39999999999998" as="offset" />
99
</mxGeometry>
1010
</mxCell>
11-
<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">
11+
<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">
1212
<mxGeometry as="geometry" relative="1">
1313
<mxPoint x="504.0" y="303.25" as="offset" />
1414
</mxGeometry>
1515
</mxCell>
16-
<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">
16+
<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">
1717
<mxGeometry as="geometry" relative="1">
1818
<mxPoint x="658.8" y="393.25" as="offset" />
1919
</mxGeometry>
2020
</mxCell>
21-
<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">
21+
<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">
2222
<mxGeometry as="geometry" relative="1">
2323
<mxPoint x="658.8" y="573.25" as="offset" />
2424
</mxGeometry>
2525
</mxCell>
26-
<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">
26+
<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">
2727
<mxGeometry as="geometry" relative="1">
2828
<mxPoint x="504.0" y="663.25" as="offset" />
2929
</mxGeometry>
3030
</mxCell>
31-
<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">
31+
<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">
3232
<mxGeometry as="geometry" relative="1">
3333
<mxPoint x="504.0" y="483.25" as="offset" />
3434
</mxGeometry>
3535
</mxCell>
36-
<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">
36+
<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">
3737
<mxGeometry as="geometry" relative="1">
3838
<mxPoint x="194.4" y="483.25" as="offset" />
3939
</mxGeometry>
4040
</mxCell>
41-
<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">
41+
<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">
4242
<mxGeometry as="geometry" relative="1">
4343
<mxPoint x="349.2" y="483.25" as="offset" />
4444
</mxGeometry>

test_specs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ process_files() {
2525
rel_path="${file#$src_dir/}"
2626
output_file="$out_dir/${rel_path%.gv.txt}.xml"
2727
mkdir -p "$(dirname "$output_file")"
28-
python3 -m graphviz2drawio "$file" -o "$output_file"
29-
echo "Processed: $file -> $output_file"
28+
python3 -m graphviz2drawio "$file" -o "$output_file" > /dev/null 2>&1
29+
echo "Processed: $file -> $output_file ($?)"
3030
done
3131
}
3232

0 commit comments

Comments
 (0)