Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

graph visualization #5

Closed
juanpr2 opened this Issue · 8 comments

4 participants

@juanpr2

Is there a way to visualize the created graphs?

@w01fe
Owner

Nothing built-in yet. We use something like this code:

(defn graph-edges [g]
  (for [[k node] g
        parent (keys (plumbing.fnk.pfnk/input-schema node))]
     [parent k]))

to generate a list of edges, and then feed this into another component that generates a .dot file for graphviz from this edge list. If there's interest we can work on open-sourcing this component -- there's not much there.

@juanpr2

Very interesting, would like to see that component. Thanks.

@w01fe
Owner

Here it is as a Gist for now, until we get the chance to clean it up and release it properly:

https://gist.github.com/w01fe/4958807

(Could probably be simplified considerably, this is part of a more general graphviz thing I wrote long ago).

@jeroenvandijk

Here is another (very minimal example): https://gist.github.com/jeroenvandijk/4959201

@w01fe
Owner

Nice -- thanks!

@w01fe
Owner

Closing for now -- we'll look into doing this at some point, but if you want something nice in the near future you're probably best off rolling your own (possibly using https://github.com/ztellman/rhizome)

@w01fe w01fe closed this
@devn

So, I know this was closed awhile back, but I can't seem to get the gist'd examples above working.

@w01fe - your gist is generating the following:

strict digraph {
 rankdir = LR;
"G__6826"[p?=clojure.core$keyword_QMARK_@1911f4af,pred-name=keyword?];
"G__6826" -> "G__6827";
"G__6827"[label=":a"];
"G__6827" -> "G__6828";
"G__6828"[label=":b"];
"G__6828" -> "G__6829";
"G__6829"[label=":c"];
"G__6826" -> "G__6828";
"G__6826" -> "G__6829";
"G__6830"[label=":in"];
"G__6830" -> "G__6827";
}

@jeroenvandijk - I can't seem to run yours either.

Any help?

Thanks in advance,
Devin

@w01fe
Owner

input-schema is now a proper Schema so it has a different representation than the old plumbing schemas which are now gone. if you change (keys (plumbing.fnk.pfnk/input-schema node)) to (keys (plumbing.fnk.schema/explicit-schema-key-map (plumbing.fnk.pfnk/input-schema node))) I think it should work (untested).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.