From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: org-babel-execute:dot -- why isn't this working? Date: Wed, 23 Sep 2015 21:33:08 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bd76db0a8a7a505207436da Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZevPK-0004rO-MK for emacs-orgmode@gnu.org; Wed, 23 Sep 2015 21:33:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZevPJ-0003gN-CX for emacs-orgmode@gnu.org; Wed, 23 Sep 2015 21:33:10 -0400 Received: from mail-ig0-x236.google.com ([2607:f8b0:4001:c05::236]:32973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZevPJ-0003fx-6a for emacs-orgmode@gnu.org; Wed, 23 Sep 2015 21:33:09 -0400 Received: by igbkq10 with SMTP id kq10so4993481igb.0 for ; Wed, 23 Sep 2015 18:33:08 -0700 (PDT) In-Reply-To: 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: Org Mode --047d7bd76db0a8a7a505207436da Content-Type: text/plain; charset=UTF-8 sorry, I must have sent this by accident, rather than deleting it by accident as I'd thought. please see the finished email, which you've already received. On Wed, Sep 23, 2015 at 8:51 PM, Matt Price wrote: > I'm trying to draw a very simple, silly graph using dot. I'm following the > code here: > http://irreal.org/blog/?p=2866 > and here: > http://orgmode.org/worg/org-tutorials/org-dot-diagrams.html > > I have tables like this (the real ones are substantially longer): > > #+name: students-graph > | a | b | > | a | m | > | a | f | > | b | t | > > #+name: students-table > | *node* | *label* | *shape* | *fillcolor* | > |--------+-----------+---------+-------------| > | a | Omar | ellipse | green | > | b | Hindia | ellipse | orange | > | c | Yuvrai | ellipse | purple | > > > I can generate the diagram I'm looking for with this code, mostly stolen > from another : > #+name: make-dot > #+BEGIN_SRC emacs-lisp :var table=students-table graph=students-graph > :results output :exports none > (mapcar #'(lambda (x) > (princ (format "%s [label=\"%s\" shape=%s style=\"filled\" > fillcolor=\"%s\"];\n" > (car x) (second x) (nth 2 x) (nth 3 x) ))) > table) > (mapcar #'(lambda (x) > (princ (format "%s -- %s;\n" > (first x) (second x)))) graph) > > > #+END_SRC > > > --047d7bd76db0a8a7a505207436da Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
sorry, I must have sent this by accident, rather than dele= ting it by accident as I'd thought. please see the finished email, whic= h you've already received.=C2=A0
<= br>
On Wed, Sep 23, 2015 at 8:51 PM, Matt Price <= span dir=3D"ltr"><moptop99@gmail.com> wrote:
I'm trying to draw a very simple, silly graph using dot. I'm= following the code here:
http://irreal.org/blog/?p=3D2866
and here:
http= ://orgmode.org/worg/org-tutorials/org-dot-diagrams.html

<= /div>I have tables like thi= s (the real ones are substantially longer):

#+name: students-graph| a | b |
| a | m |
| a | f |
| b | t |

#+name: students-= table
| *node* | *label*=C2=A0=C2=A0 | *shape* | *fillcolor* |
|-----= ---+-----------+---------+-------------|
| a=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | Omar=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | ellipse | green=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 |
| b=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Hindia=C2=A0= =C2=A0=C2=A0 | ellipse | orange=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |
| c=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 | Yuvrai=C2=A0=C2=A0=C2=A0 | ellipse | purple= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |


I can generate the diagram I'm looking fo= r with this code, mostly stolen from another :
#+name: make-dot
#+BEG= IN_SRC emacs-lisp :var table=3Dstudents-table graph=3Dstudents-graph :resul= ts output :exports none
=C2=A0 (mapcar #'(lambda (x)
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (princ (= format "%s [label=3D\"%s\" shape=3D%s style=3D\"filled\= " fillcolor=3D\"%s\"];\n"
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (car = x) (second x) (nth 2 x) (nth 3 x) ))) table)
=C2=A0 (mapcar #'(lambd= a (x)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (princ (format "%s -- %s;\n"
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (first x) (second x)))) graph)


#+END_SRC



--047d7bd76db0a8a7a505207436da--