Amazon.de Widgets
Skip to content
16.April 2009 / Patrick

Flowchart für Personen mit viel Zeit und ohne Hobbys :-)

closeDieser Beitrag wurde vor über 3 Monaten veröffentlicht. Die darin beschriebenen Informationen sind mit Vorsicht zu geniessen, da sie bereits veraltet oder nicht mehr gültig sein könnten. Solltest du von Neuerungen oder Verbesserungen wissen, so freue ich mich über einen klärenden Kommentar.

Gerade bin ich auf ein lustiges kleines JAVA-Tool gestossen: ditaa!

ditaa ist ein Konsolenprogramm, womit man aus einem ACSII-File ein Bild mit “echten” Flowcharts erstellen. Alles was man zu tun hat, ist ein Textfile zu erstellen mti zum Bespiel folgendem Inhalt:

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

Nun lässt man ditaa drüberrasen und erhält folgendes Bild als Ausgabe:

Dazu verwendet man folgenden Befehl:
java -jar ditaa.jar inputfile outputfile.png

Mittels dem Parameter -h erhält man noch weitere und feinere Einstellungsmöglickeiten angezeigt.

Doch wieso der Aufwand? ditaa beantwortet die Frage gleich selbst:

BUT WHY? Does this thing have any real use?

There are several reasons why I did this:

  1. Simply for hack value. I wanted to know if/how it could be done and how easily.
  2. Aesthetic reasons and legacy formats: there are several old FAQs with ascii diagrams lying out there. At this time and age ascii diagrams make my eyes hurt due to their ugliness. ditaa can be used to convert them to something nicer. Although ditaa would not be able to convert all of them (due to differences in drawing ‘style’ in each case), it could prove useful in the effort of modernising some of those documents without too much effort. I also know a lot of people that can make an ascii diagram easily, but when it gets to using a diagram program, they don’t do very well. Maybe this utility could help them make good-looking diagrams easily/quickly.
  3. Embedding diagrams to text-only formats: There is a number of formats that are text-based (html, docbook, LaTeX, programming language comments), but when rendered by other software (browsers, interpreters, the javadoc tool etc), they can contain images as part of their content. If ditaa was intergrated with those tools (and I’m planning to do the javadoc bit myself soon), then you would have readable/editable diagrams within the text format itself, something that would make things much easier. ditaa syntax can currently be embedded to HTML.
  4. Reusability of “code”: Suppose you make a diagram in ascii art and you render it with version 0.6b of ditaa. You keep the ascii diagram, and then version 0.8 comes out, which features some new cool effects. You re-render your old diagram with the new version of ditaa, and it looks better, with zero effort! In that sense ditaa is a diagram markup language, with very loose syntax.

Ich weiss jedoch nicht ob es daran liegt, dass ditaa noch in der Beta-Phase ist, oder ob ich einfach unfähig bin, aber bei mir wird das Bild immer ein bisschen zu schwarz, da wo eigentlich ein Pfeil sein sollte :) :

/---------------+    +---------------+
|               |    |               |
|    cRED       |    |    cPNK       |
|               |    |               |
|               |    |               |
+-------+-------/    +---------------/
    |                       ^
    |                       |
    +-----------------------+

chart

ditaa muss man einfach ausprobiert haben :D

Update

Eine aktuelle JAVA-Version ist von grossem Vorteil :D

chart1

  • Anonymous

    Habs net ausprobiert, aber versuch mal, den Pfeil mit einem Doppelpunkt anfangen zu lassen, anstatt eine Pipe am Anfang zu platzieren.
    kA ob’s hilft ;)

  • http://zerfall.com kb

    Mir würds schon reichen, wenn ich so ein Tool hätte wo man die Formen so rein ziehen kann und miteinander verbinden. Das Aussehen ist nämlich echt Top. Gibt ja nicht viele Programme, wo man solche Diagramme raus bekommt die wirklich schön sind.

  • admin

    Hi Anonymous

    Das bringt nichts… Der Doppelpunkt steht für eine gestrichelte Linie.

    grz

  • http://www.jamendo.com/de/user/killermoehre killermoehre

    @kb
    Hast du schon mal Dia verwendet? http://live.gnome.org/Dia

  • Bob

    Hi compr00t,
    c00les T00l! ;) – Die Seite habe ich mir gleich mal gebookmarked.

    @kb: Da hast du recht.

    Schöne Grüße.

  • Matthias

    Also bei mir funktioniert dein Code einwandfrei, also mit weißem Hintergund.

  • admin

    Ich nehme mal an es liegt an meiner JAVA-Version liegt :S
    Vielleicht mal updaten!

    grz