Ditaa: DIagrams Through Ascii Art

Tuesday 17 November 2009This is over 13 years old. Be careful.

Does ditaa do the impossible, or the unnecessary? It converts ASCII-art block diagrams into nice pictures. As the author puts it:

    +--------+   +-------+    +-------+
    |        | --+ ditaa +--> |       |
    |  Text  |   +-------+    |diagram|
    |Document|   |!magic!|    |       |
    |     {d}|   |       |    |       |
    +---+----+   +-------+    +-------+
        :                         ^
        |       Lots of work      |

After conversion using ditaa, the above file becomes:

Nicely drawn diagram

I haven’t tried it, so I don’t know where the parsing falls down, but the samples in the doc sure look better than I thought they would...


It draws nice diagrams but you still have to do layout and drawing ASCII boxes is a PITA to me.

My use case for diagrams probably isn't normal but I almost always have some sort of data that I can munge into nodes and edges. (Program call graphs, DB schema, etc) or I make up nodes and edges in a text file. Then I use GraphViz to automagically do the layout and drawing. Works great for me.
@Jay: "and drawing ASCII boxes is a PITA"

... unless you're a crusty Emacs hacker, of course.
Apparently works for LaTeX.
Yeah this looks pretty brilliant, nice find. One can draw ascii boxes very quickly in vim/emacs.
I thought of a similar thing once, but it was the other way around - diagrams to ascii-art.
I find the idea of translating vector graphics to ascii really interesting, I still hope to implement it someday.
Yep, I'm with lorg -- I've got much more use for a (good!) diagram-to-ascii tool. I have Visio (for better/worse) for drawing my own diagrams. But if I'm posting a question here, or StackOverflow, etc., I need to embed the diagram in text, and referengcing images on some random site (even my own!) is guaranteed linkrot. Currently, I spend a fair amount of time drawing ascii diagrams by hand -- I niggle over the details way too much, but tell myself that's good because it keeps me thinking about what I'm trying to represent.
There is also aafigure, which does a similar task(not quite as much functionality). It is written in Python, produces various image formats, and integrates in to sphinx with sphinxcontrib-aafig.

ditaa definitively looks nice, but I've only played with it via the web interface(no java locally). Thanks for pointing it out!
People who like this might also like yuml.me, which converts simple GET args in the url (simple enough to compose by hand) into an image containing a correponding diagram:

http://www.asciiflow.com is good for drawing the initial diagrams

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.