unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Help adding a graph backend
@ 2023-02-10  3:10 Kyle Andrews
  2023-02-10  7:11 ` Julien Lepiller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kyle Andrews @ 2023-02-10  3:10 UTC (permalink / raw)
  To: guix-devel


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-10 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-10  3:10 Help adding a graph backend Kyle Andrews
2023-02-10  7:11 ` Julien Lepiller
2023-02-10  9:25 ` Attila Lendvai
2023-02-10  9:30 ` Andreas Enge
2023-02-10 19:03   ` Kyle

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).