~ruther/guix-local

14531a1eb8431157402ef2c512b623f99a9999a8 — Yarl Baudig 4 months ago 706c2fa
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>
1 files changed, 3 insertions(+), 3 deletions(-)

M guix/graph.scm
M guix/graph.scm => guix/graph.scm +3 -3
@@ 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"