summaryrefslogtreecommitdiff
path: root/python/examples/export_svg.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-02-18 00:41:37 -0500
committerRusty Wagner <rusty@vector35.com>2017-02-18 00:41:37 -0500
commit96f6bc8a3099754bf79a05af7a1ec342f8030335 (patch)
tree9ff52b5339140d453fb0163a0eb7bba3501d0a27 /python/examples/export_svg.py
parentc46c3a9540f4d15eff8aa9660df69e374f7fd2f5 (diff)
Add back edge property to block edges
Diffstat (limited to 'python/examples/export_svg.py')
-rwxr-xr-xpython/examples/export_svg.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/python/examples/export_svg.py b/python/examples/export_svg.py
index 89bc41a1..95e2d62d 100755
--- a/python/examples/export_svg.py
+++ b/python/examples/export_svg.py
@@ -80,6 +80,10 @@ def render_svg(function):
fill: none;
stroke-width: 1px;
}
+ .back_edge {
+ fill: none;
+ stroke-width: 2px;
+ }
.UnconditionalBranch, .IndirectBranch {
stroke: rgb(128, 198, 233);
color: rgb(128, 198, 233);
@@ -197,7 +201,10 @@ def render_svg(function):
points += str(x * widthconst) + "," + str(y * heightconst) + " "
x, y = edge.points[-1]
points += str(x * widthconst) + "," + str(y * heightconst + 0) + " "
- edges += ' <polyline class="edge {type}" points="{points}" marker-end="url(#arrow-{type})"/>\n'.format(type=BranchType(edge.type).name, points=points)
+ if edge.back_edge:
+ edges += ' <polyline class="back_edge {type}" points="{points}" marker-end="url(#arrow-{type})"/>\n'.format(type=BranchType(edge.type).name, points=points)
+ else:
+ edges += ' <polyline class="edge {type}" points="{points}" marker-end="url(#arrow-{type})"/>\n'.format(type=BranchType(edge.type).name, points=points)
output += ' ' + edges + '\n'
output += ' </g>\n'
output += '</svg></html>'