Re: [Haskell-cafe] Tool for visualisation of graph reduction step by step

On 14 November 2013 12:03, Miguel Ramos
(b) What tools do people use for plotting static program graphs, such as those in books, papers and slides?
Graphviz can be tamed somewhat with ranking - see the examples in the manual. If you want pretty, hand coded graphs then TikZ is a handsome option. It has the obvious edges with or without arrowheads, but also the "anchor" abstraction which is a very neat way of placing edges.

Am 14.11.2013 17:59, schrieb Stephen Tetley:
If you want pretty, hand coded graphs then TikZ is a handsome option. It has the obvious edges with or without arrowheads, but also the "anchor" abstraction which is a very neat way of placing edges.
That is my preferred way as well. I often use it through the package tkz-graph which makes defining graphs easy. [1] http://www.ctan.org/tex-archive/macros/latex/contrib/tkz/tkz-graph

Qui, 2013-11-14 às 16:59 +0000, Stephen Tetley escreveu:
On 14 November 2013 12:03, Miguel Ramos
wrote: (b) What tools do people use for plotting static program graphs, such as those in books, papers and slides?
Graphviz can be tamed somewhat with ranking - see the examples in the manual.
Thanks, I've already conquered rank. For this kind of graph, mostly tree-like, I find useful to let dot infer rank from edges, except for those few edges which form cycles, where I use [ constraint = 0 ] so that a rank constraint is not introduced for them. To whom it may interest, my best is (distilled): digraph G { graph [ splines = polyline ]; node [ ordering = out, shape = plaintext ]; edge [ arrowhead = none, headport = n ]; a0 [ label = "@", root = 1 ]; a0 -> a1; a1 [ label = "@" ]; a1 -> a2; a2 [ label = take ]; a1 -> a3; a3 [ label = 5 ]; a0 -> a4; a4 [ label = "\"Desmond\"" ]; b0 [ label = "@", root = 1, xlabel = "$" ]; b0 -> b1; b1 [ label = f ]; b0:se -> b0 [ constraint = 0, arrowhead = normal ]; // back edge is special } ... and this leaves a lot to be desired, and for my purpose, invisible nodes or edges beat the purpose of specifying only the structure of the graph, instead of computing its appearance. I'm almost giving up with graphviz.
If you want pretty, hand coded graphs then TikZ is a handsome option. It has the obvious edges with or without arrowheads, but also the "anchor" abstraction which is a very neat way of placing edges.
Thanks, I didn't know TikZ, only PSTricks. I fear a bit having to compute edge paths by hand... However, it is true that an approach such as that provides good re-use and will be easier for repetitive graphs, better than graphviz, which does not have abstraction. Thank you, M.R.
participants (3)
-
Miguel Ramos
-
Stephen Tetley
-
Thomas Horstmeyer