graph: graphml backend: simplification

I don't see the necessity of this string-replace-substring/object->string
dance and the result is ill-formed with another node type than package.

* guix/graph.scm (emit-graphml-node): simplfify.
(emit-graphml-edge): simplify.

Change-Id: If7520a9829ad5f6ebcc5357b201ab58d6e43b735
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Yarl Baudig 2025-11-23 20:06:33 +01:00 committed by Ludovic Courtès
parent 706c2fa0a9
commit 14531a1eb8
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -422,13 +422,13 @@ nodeArray.push(nodes[\"~a\"]);~%"
(format port " <node id=\"~a\">
<data key=\"d0\">~a</data>
</node>~%"
(string-replace-substring (object->string id) "\"" "\\\"")
id
label))
(define (emit-graphml-edge id1 id2 port)
(format port " <edge source=\"~a\" target=\"~a\"/>~%"
(string-replace-substring (object->string id1) "\"" "\\\"")
(string-replace-substring (object->string id2) "\"" "\\\"")))
id1
id2))
(define %graphml-backend
(graph-backend "graphml"