From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: process diagrams with dot and some glue using org Date: Sat, 20 Jul 2013 08:47:34 -0400 Message-ID: <20130720124734.GA64556@BigDog.local> References: <87vc46ea4y.fsf@ucl.ac.uk> <87a9lh4hqd.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0WZV-0007BL-8g for emacs-orgmode@gnu.org; Sat, 20 Jul 2013 08:47:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0WZS-0005LV-Qi for emacs-orgmode@gnu.org; Sat, 20 Jul 2013 08:47:37 -0400 Received: from [204.62.15.78] (port=36414 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0WZS-0005LR-NK for emacs-orgmode@gnu.org; Sat, 20 Jul 2013 08:47:34 -0400 Content-Disposition: inline In-Reply-To: <87a9lh4hqd.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric S Fraga Cc: emacs-orgmode 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. >