all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kyle Andrews <kyle@posteo.net>
To: guix-devel@gnu.org
Subject: Help adding a graph backend
Date: Fri, 10 Feb 2023 03:10:02 +0000	[thread overview]
Message-ID: <87ilga41jh.fsf@posteo.net> (raw)


Dear Guix,

I am not very comfortable editing Guix source code. However, I would
very much like to add a new backend for `guix graph`. Right now guix
graph descriptions can only be exported into special purpose tools like
graphviz, D3, and cypher. I would like to add a fourth option which
would support loading the dependency data into general purpose network analysis software tools: an edgelist backend.

=> https://en.wikipedia.org/wiki/Edge_list

I think this code will do the job, but I don't know how to test it. So, I don't know for sure.

``` guix/graph.scm
(define (el-prologue name port)
  (display "from, to" port))

(define (el-epilogue port)
  (display "\n" port))

(define (el-node id label port)
  (display "" port))

(define (el-edge id1 id2 port)
  (format port "~a, ~a\n"))

(define %edgelist-backend
  (graph-backend "edgelist"
                 "Generate graph in CSV edge list format"
                 el-prologue el-epilogue
                 el-node el-edge))

(define %graph-backends
  (list %graphviz-backend
        %d3js-backend
        %cypher-backend
        %edgelist-backend)) ; <- the new proposed backend
```

Maybe it would be using some incantation involving ./pre-inst-env? I gave it a try following the manual:

```
cd ~/{{path/to/guix}}
guix shell -D guix
./bootstrap
./configure
```

This gave an error:

```
configure: error: chosen localstatedir '/usr/local/var' does not match that of the existing installation '/var'
Installing may corrupt /gnu/store!
Use './configure --localstatedir=/var'.
```

Since I am not that excited about corrupting my /gnu/store given that I don't know what I am doing, I didn't proceed further. 

I figured because I wanted to extend Guix with a new feature and that I
could piece together a story in my head about how the code should look, my query should be sent to this list rather than to help-guix.

Thanks in advance for any helpful suggestions towards getting this backend added to Guix!

Cheers,
Kyle


             reply	other threads:[~2023-02-10  7:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10  3:10 Kyle Andrews [this message]
2023-02-10  7:11 ` Help adding a graph backend Julien Lepiller
2023-02-10  9:25 ` Attila Lendvai
2023-02-10  9:30 ` Andreas Enge
2023-02-10 19:03   ` Kyle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilga41jh.fsf@posteo.net \
    --to=kyle@posteo.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.