From c782d0cc8c3f9eb8234b275cc33b19eb9732f882 Mon Sep 17 00:00:00 2001 From: Yarl Baudig Date: Sun, 2 Nov 2025 09:09:52 +0100 Subject: [PATCH] graph: graphml backend: emit label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/graph.scm (emit-graphml-prologue): Declare label attribute. (emit-graphml-node): Define label attribute. Signed-off-by: Ludovic Courtès --- guix/graph.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guix/graph.scm b/guix/graph.scm index 9f1111a0ae2799e4950a7e33f9a9da3016e00ad8..e661c95467221929c5ab066244bdcb0c1317a783 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -341,6 +341,7 @@ nodeArray.push(nodes[\"~a\"]);~%" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\"> + ~%")) (define (emit-graphml-epilogue port) @@ -348,8 +349,11 @@ nodeArray.push(nodes[\"~a\"]);~%" ")) (define (emit-graphml-node id label port) - (format port " ~%" - (string-replace-substring (object->string id) "\"" "\\\""))) + (format port " + ~a + ~%" + (string-replace-substring (object->string id) "\"" "\\\"") + label)) (define (emit-graphml-edge id1 id2 port) (format port " ~%"