From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: Process diagrams with dot and some glue using Org-mode Date: Wed, 26 Jun 2013 11:44:49 -0400 Message-ID: <5b90a6852c7b87d077016cbb0479ff23@mail.rickster.com> References: <2013-06-26T17-08-48@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urrtr-0005dV-Uq for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 11:44:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Urrtp-0006TP-5C for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 11:44:51 -0400 Received: from [204.62.15.78] (port=51908 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urrtp-0006TJ-28 for emacs-orgmode@gnu.org; Wed, 26 Jun 2013 11:44:49 -0400 In-Reply-To: <2013-06-26T17-08-48@devnull.Karl-Voit.at> 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: news1142@karl-voit.at Cc: emacs-orgmode@gnu.org On 2013-06-26 11:23, Karl Voit wrote: > Hi! > > I would like to define my diagram with the following two tables: one > for the node definitions and one for the interconnections between > notes. The syntax should be pretty self-explanatory (or at least I > hope so): > I (not an ELISP hacker) would have to use Python and write a table > parsing class which will get too complicated for my taste :-( > However, my guess is that this could be implemented in ELISP with > much less effort. > Two things: 1. You don't need to write table parsing code, as passing in a table as an argument to a code block will convert it to an array. For example: #+name: ptable | head1 | head2 | |-------+-------| | a | 1 | | b | 2 | #+BEGIN_SRC python :var t=ptable :results value return t #+END_SRC #+RESULTS: | a | 1 | | b | 2 | and the python code generated (view w/ `org-babel-expand-src-block'): t=[["a", 1], ["b", 2]] return t 2. You can also use the pydot or pygraphviz libraries for generating the graph directly from python instead of generating dot code. rick