X-Loop: help-debbugs@HIDDEN Subject: [bug#61888] [PATCH] guix: add edgelist graph-backend. Resent-From: kyle <kyle@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: guix-patches@HIDDEN Resent-Date: Wed, 01 Mar 2023 03:49:02 +0000 Resent-Message-ID: <handler.61888.B.167764252825277 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 61888 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61888 <at> debbugs.gnu.org Cc: Kyle Andrews <kyle@HIDDEN> X-Debbugs-Original-To: guix-patches@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.167764252825277 (code B ref -1); Wed, 01 Mar 2023 03:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Mar 2023 03:48:48 +0000 Received: from localhost ([127.0.0.1]:52337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pXDSR-0006Zc-SE for submit <at> debbugs.gnu.org; Tue, 28 Feb 2023 22:48:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:41574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <kyle@HIDDEN>) id 1pXDSP-0006ZT-6W for submit <at> debbugs.gnu.org; Tue, 28 Feb 2023 22:48:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kyle@HIDDEN>) id 1pXDSP-0007OU-05 for guix-patches@HIDDEN; Tue, 28 Feb 2023 22:48:45 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <kyle@HIDDEN>) id 1pXDSM-00071b-Ij for guix-patches@HIDDEN; Tue, 28 Feb 2023 22:48:44 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 43E92240122 for <guix-patches@HIDDEN>; Wed, 1 Mar 2023 04:48:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677642519; bh=fdGlvXiPuH8tU1+mBcLEDS91AtGZ4WFR7NM964lrbHw=; h=From:To:Cc:Subject:Date:From; b=DLOTYjcBbMGlLeGcOrdSyhkzJsqMvOH6y5P2cdRFFU+dsffMQptjNvukhxKDoTrkO rHI8SwJ8wqOtGDaPj9k6uX5Re+5XTtHhNxKz1ow8K79NkioRjceZ+wrRNse64RpqLB 3J31hKGOQLRVDchmHllYOrpfzFWTsFOgZHmle/eiKNus8kaGGt5x+VvzDsh4lDds8Y 4dzs2wpOgCZrfq52c0gtNg1/cHGKIsmAtWypzIjgjT1z63kIVgTzlYVGbz5XVA0UR4 OoqJpG71U2RQ10WwjUlR77QZa4X8f5Ex0lPvpojCgfjZRPqDNl6bHgMXZzYOMAHC0/ 91zN6UTy7K/gw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PRKw54313z6tmB; Wed, 1 Mar 2023 04:48:37 +0100 (CET) From: kyle <kyle@HIDDEN> Date: Wed, 01 Mar 2023 03:48:35 +0000 Message-Id: <0019ab80bbec15bbd5ae52e18d9a3dd6fd708a78.1677642438.git.kyle@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.66; envelope-from=kyle@HIDDEN; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) From: Kyle Andrews <kyle@HIDDEN> * guix/graph.scm: Add csv backend. --- doc/guix.texi | 14 ++++++++------ guix/graph.scm | 21 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 27a0c62532..09d6be4edb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14844,16 +14844,18 @@ Invoking guix graph Packages and their dependencies form a @dfn{graph}, specifically a directed acyclic graph (DAG). It can quickly become difficult to have a mental model of the package DAG, so the @command{guix graph} command -provides a visual representation of the DAG@. By default, -@command{guix graph} emits a DAG representation in the input format of +provides a visual representation of the DAG@. By default, @command{guix +graph} emits a DAG representation in the input format of @uref{https://www.graphviz.org/, Graphviz}, so its output can be passed directly to the @command{dot} command of Graphviz. It can also emit an HTML page with embedded JavaScript code to display a ``chord diagram'' in a Web browser, using the @uref{https://d3js.org/, d3.js} library, or emit Cypher queries to construct a graph in a graph database supporting -the @uref{https://www.opencypher.org/, openCypher} query language. With -@option{--path}, it simply displays the shortest path between two -packages. The general syntax is: +the @uref{https://www.opencypher.org/, openCypher} query language. It +can also emit a CSV table with the raw data required to reconstruct the +graph using generic network analysis software like +@uref{https://igraph.org/, igraph}. With @option{--path}, it simply +displays the shortest path between two packages. The general syntax is: @example guix graph @var{options} @var{package}@dots{} @@ -15061,7 +15063,7 @@ Invoking guix graph @item --list-backends List the supported graph backends. -Currently, the available backends are Graphviz and d3.js. +Currently, the available backends are Graphviz, Cypher, d3.js, and csv. @item --path Display the shortest path between two nodes of the type specified by diff --git a/guix/graph.scm b/guix/graph.scm index 41219ab67d..6a3f802da9 100644 --- a/guix/graph.scm +++ b/guix/graph.scm @@ -255,6 +255,24 @@ (define %graphviz-backend emit-prologue emit-epilogue emit-node emit-edge)) +(define (emit-csv-prologue name port) + (display "table, from, to\n" port)) + +(define (emit-csv-epilogue port) + (display "" port)) + +(define (emit-csv-node id label port) + (format port "package, ~a, ~a\n" label id)) + +(define (emit-csv-edge id1 id2 port) + (format port "depends, ~a, ~a\n" id1 id2)) + +(define %csv-backend + (graph-backend "csv" + "Generate graph in CSV format" + emit-csv-prologue emit-csv-epilogue + emit-csv-node emit-csv-edge)) + ;;; ;;; d3js export. @@ -338,7 +356,8 @@ (define %cypher-backend (define %graph-backends (list %graphviz-backend %d3js-backend - %cypher-backend)) + %cypher-backend + %csv-backend)) (define (lookup-backend name) "Return the graph backend called NAME. Raise an error if it is not found." -- 2.37.2
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: kyle <kyle@HIDDEN> Subject: bug#61888: Acknowledgement ([PATCH] guix: add edgelist graph-backend.) Message-ID: <handler.61888.B.167764252825277.ack <at> debbugs.gnu.org> References: <0019ab80bbec15bbd5ae52e18d9a3dd6fd708a78.1677642438.git.kyle@HIDDEN> X-Gnu-PR-Message: ack 61888 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 61888 <at> debbugs.gnu.org Date: Wed, 01 Mar 2023 03:49:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): guix-patches@HIDDEN If you wish to submit further information on this problem, please send it to 61888 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 61888: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61888 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
Received: (at control) by debbugs.gnu.org; 1 Mar 2023 09:32:17 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 01 04:32:17 2023 Received: from localhost ([127.0.0.1]:52706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pXIoq-000789-Ou for submit <at> debbugs.gnu.org; Wed, 01 Mar 2023 04:32:16 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:42935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <liliana.prikler@HIDDEN>) id 1pXIop-00077p-8c for control <at> debbugs.gnu.org; Wed, 01 Mar 2023 04:32:16 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4PRTXW439cz3ws4; Wed, 1 Mar 2023 10:32:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1677663131; bh=9MDoZLRkTYDHtCfq7HStjH2/RJI8nlz/LpoAnjdG9xc=; h=Subject:From:To:Cc:Date; b=kqeVv7d7JUjfhj0Lgogs8q4Fy+7EsyVfwNqoexaO1+EyZFtghYqcNvhM0QzRdNo0X nr2tp1h6PjG4BH8jIHfkMeEWSPmf1AVR9uugXCLOvqXWORZvaTspTQQ1d33VL43tcl Mqaeoa8LO/dcDThqKfaTKArOVrGoyzKvFgyDppfM= Message-ID: <a2064a92dd87c1c6509e3096e8df7d23493e3f16.camel@HIDDEN> Subject: From: Liliana Marie Prikler <liliana.prikler@HIDDEN> To: control <at> debbugs.gnu.org Date: Wed, 01 Mar 2023 10:32:07 +0100 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: control Cc: Kyle Andrews <kyle@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.3 (-) merge 61527 61888 thanks @Kyle: Next time, use the reroll-count option of git send-email and resend your patch to the bug that's already open. Cheers=20
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.