emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Gary <orgmode@garydjones.name>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: From state table to state diagram
Date: Tue, 24 Aug 2010 18:33:45 -0600	[thread overview]
Message-ID: <878w3vedfz.fsf@gmail.com> (raw)
In-Reply-To: i50ck8$h4o$1@dough.gmane.org

Babel does support generating diagrams with graphviz via "dot" code
blocks.  Babel is also capable of converting Org-mode tables to list
objects in a number of languages, so I'd recommend writing a table->dot
script in your favorite language, and then using babel to handle the
coordination and Org-mode integration.

I'm happy to help in this regard, the first step would be something like
the following example which assumes python is your preferred scripting
language (as you can see I have no idea what your state table may look
like)...

--8<---------------cut here---------------start------------->8---
#+results: state-table
| 1 | 2 |
| 3 | 4 |

#+source: table-to-dot
#+begin_src python :var table=state-table
  python code here
#+end_src

#+begin_src dot :var text=table-to-dot(table=state-table)
  graph{
    $text
  }
#+end_src
--8<---------------cut here---------------end--------------->8---

Once this is working I think it could make a great addition to the
library of babel [1] (a collection of generally useful code blocks).

Cheers -- Eric

Gary <orgmode@garydjones.name> writes:

> Eric S Fraga wrote:
>
>> Sorry, that should have been graphviz... typing on a phone.  :-( 
>
> :))
>
> Okay, thanks. I know about graphviz, but it is not really what I am
> looking for. Ideally I would create a state transition table and then
> just "magically" get a diagram as a by-product. I can definitely see
> that the DOT language might be a good target though - generating that
> from a table should be easier than generating a diagram directly.
>
> Well, maybe it's a bit specific and nobody has done anything so I should
> look into it on my own :)

Footnotes: 
[1]  http://orgmode.org/worg/org-contrib/babel/library-of-babel.php

  parent reply	other threads:[~2010-08-25  0:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 10:38 From state table to state diagram Gary
2010-08-24 11:03 ` Eric S Fraga
2010-08-24 11:24   ` Gary
2010-08-24 11:25   ` Eric S Fraga
2010-08-24 12:06     ` Gary
2010-08-24 23:28       ` Eric S Fraga
2010-08-25  0:33       ` Eric Schulte [this message]
2010-09-23 15:02         ` Gary
2010-09-24 10:00           ` Dan Davison
2010-09-25  7:40           ` Rainer M Krug
2010-09-27  6:27             ` Gary
2010-09-27 15:21               ` Mark Elston
2010-09-28 14:04               ` Rainer M Krug
2010-11-24  1:25                 ` Vladimir Alexiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878w3vedfz.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=orgmode@garydjones.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).