summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2019-04-04 19:57:40 -0400
committerLex Neva <github.com@lexneva.name>2019-04-04 19:57:40 -0400
commit1f7b69980c439c2be00033f566de38c35468782c (patch)
tree82168b932917c4b9994e08f537f6242b6149f882
parentf5f0ce49a8db1445feba91e629e6b02584dbd05b (diff)
render graphs as a single path to avoid killing inkscape
-rw-r--r--lib/debug.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/debug.py b/lib/debug.py
index fa3bd606..6ce67697 100644
--- a/lib/debug.py
+++ b/lib/debug.py
@@ -167,12 +167,16 @@ class Debug(object):
@check_enabled
def log_graph(self, graph, name="Graph", color=None):
- self.open_group(name)
+ d = ""
for edge in graph.edges:
- self.log_line(edge[0], edge[1], color=color)
+ d += "M%s,%s %s,%s" % (edge[0] + edge[1])
- self.close_group()
+ self.log_svg_element(etree.Element("path", {
+ "d": d,
+ "style": formatStyle({"stroke": color or "#000000", "stroke-width": "0.3"}),
+ INKSCAPE_LABEL: name
+ }))
@contextmanager
def time_this(self, label="code block"):