From 1f7b69980c439c2be00033f566de38c35468782c Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 4 Apr 2019 19:57:40 -0400 Subject: render graphs as a single path to avoid killing inkscape --- lib/debug.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/debug.py') 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"): -- cgit v1.2.3