emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] process diagrams with dot and some glue using org


From: Rick Frankel
Subject: Re: [O] process diagrams with dot and some glue using org
Date: Sat, 20 Jul 2013 08:47:34 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jul 20, 2013 at 12:02:18PM +0100, Eric S Fraga wrote:
[...]

> For Karl's benefit, the following is the latest version of the
> graph-from-tables source code block including the above suggestion from
> Rick and also the addition of an options variable.
> 
> #+begin_src org
>   ,#+name: graph-from-tables
>   ,#+header: :var options="" :var nodes='() graph='()

nit. the extra `:var' isn't necessary:

     #+header: :var options="" nodes='() graph='()

>   ,#+BEGIN_SRC emacs-lisp :colnames yes 
>     (org-babel-execute:dot
>      (concat
>           "digraph {\n"
>           options "\n"   ;; "//rankdir=LR;\n" ;; remove comment characters 
> '//' for horizontal layout; add for vertical layout
>           (mapconcat
>            (lambda (x)
>              (format "%s [label=\"%s\" shape=%s style=\"filled\" 
> fillcolor=\"%s\"]"
>                              (car x)
>                              (nth 1 x)
>                              (if (string= "" (nth 2 x)) "box" (nth 2 x))
>                              (if (string= "" (nth 3 x)) "none" (nth 3 x))
>                              )) nodes "\n")
>           "\n"
>           (mapconcat
>            (lambda (x)
>              (format "%s -> %s [taillabel=\"%s\"]"
>                              (car x) (nth 1 x) (nth 2 x))) graph "\n")
>           "}\n") params)
>   ,#+END_SRC
> #+end_src
> 
> I can update the tutorial on Worg if desired.
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]