Subject: Re: [bug#30711] [PATCH 1/1] guix: graph: Add Trival Graph Format (TGF) backend.

From: [email-masked] (Ludovic Courtès)
Date: Mon, 05 Mar 2018 18:17:04 +0100

Hi Hartmut,

Hartmut Goebel <[email-masked]> skribis:

> * guix/graph.scm ((emit-edge, emit-d3js-edge, emit-cypher-edge): New arguments
>   label1 , label2.
>   (emit-tg-progloug, mit-tgf-epilouge, emit-tgf-node, emit-tgf-edge): New
>   variables.
>   (%trivial-graph-backend): New variable.
>   (%graph-backends): Add %trivial-graph-backend.
>   (export-graph): Pass labels to emit-edge.

Can you tell us more about the Trivial Graph Format?

> -(define (emit-edge id1 id2 port)
> +(define (emit-edge id1 label1 id2 label2 port)
>    (format port "  \"~a\" -> \"~a\" [color = ~a];~%"
>            id1 id2 (pop-color id1)))

This is orthogonal to adding a new format, so it should probably be a
separate patch.

> +(define (emit-tgf-edge id1 label1 id2 label2 port)
> +  (format port "~a ~a~%" label1 label2))

This is probably incorrect because labels do not necessarily uniquely
identify nodes.  This is why the API distinguishes node identifiers and
labels.

Thanks,
Ludo’.