From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1estkT-0001QB-Qf for guix-patches@gnu.org; Mon, 05 Mar 2018 12:18:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1estkQ-0008KF-LL for guix-patches@gnu.org; Mon, 05 Mar 2018 12:18:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:38252) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1estkQ-0008K7-GT for guix-patches@gnu.org; Mon, 05 Mar 2018 12:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1estkQ-0004Zh-AX for guix-patches@gnu.org; Mon, 05 Mar 2018 12:18:02 -0500 Subject: [bug#30711] [PATCH 1/1] guix: graph: Add Trival Graph Format (TGF) backend. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180305114136.7207-1-h.goebel@crazy-compilers.com> Date: Mon, 05 Mar 2018 18:17:04 +0100 In-Reply-To: <20180305114136.7207-1-h.goebel@crazy-compilers.com> (Hartmut Goebel's message of "Mon, 5 Mar 2018 12:41:36 +0100") Message-ID: <87h8pu8msv.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Hartmut Goebel Cc: 30711@debbugs.gnu.org Hi Hartmut, Hartmut Goebel skribis: > * guix/graph.scm ((emit-edge, emit-d3js-edge, emit-cypher-edge): New argu= ments > 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 =3D ~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=E2=80=99.