GithubHelp home page GithubHelp logo

stathissideris / ditaa Goto Github PK

View Code? Open in Web Editor NEW
925.0 31.0 87.0 13.49 MB

ditaa is a small command-line utility that can convert diagrams drawn using ascii art ('drawings' that contain characters that resemble lines like | / - ), into proper bitmap graphics.

License: GNU Lesser General Public License v3.0

Java 98.01% HTML 1.72% CSS 0.03% Clojure 0.24%

ditaa's Introduction

DIagrams Through Ascii Art

ditaa is a small command-line utility written in Java, that can convert diagrams drawn using ascii art ('drawings' that contain characters that resemble lines like | / - ), into proper bitmap graphics. This is best illustrated by the following example -- which also illustrates the benefits of using ditaa in comparison to other methods :)

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

After conversion using ditaa, the above file becomes:

ditaa interprets ASCII art as a series of open and closed shapes, but it also uses special markup syntax to increase the possibilities of shapes and symbols that can be rendered.

ditaa is open source and free software (free as in free speech), since it is released under the GPL license.

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 integrated with those tools, 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.

Getting it

For Ubuntu, there is a package.

For MacOSX, you can install via brew.

Usage and syntax

Command line

You need the latest Java runtime (JRE) to use ditaa. The best anti-aliasing can be achieved using Java 1.5 or higher.

To start from the command line, type (where XXX is the version number):

java -jar ditaaXXX.jar

You will be presented with the command-line options help:

 -A,--no-antialias              Turns anti-aliasing off.
 -b,--background <BACKGROUND>   The background colour of the image. The
                                format should be a six-digit hexadecimal
                                number (as in HTML, FF0000 for red). Pass
                                an eight-digit hex to define transparency.
                                This is overridden by --transparent.
 -d,--debug                     Renders the debug grid over the resulting
                                image.
 -E,--no-separation             Prevents the separation of common edges of
                                shapes.

Before processing:

+---------+
| cBLU    |
|         |
|    +----+
|    |cPNK|
|    |    |
+----+----+

Common edge separation (default)

No separation (with the -E option)

 -e,--encoding <ENCODING>       The encoding of the input file.
 -h,--html                      In this case the input is an HTML file.
                                The contents of the <pre
                                class="textdiagram"> tags are rendered as
                                diagrams and saved in the images directory
                                and a new HTML file is produced with the
                                appropriate <img> tags.
    --help                      Prints usage help.
 -o,--overwrite                 If the filename of the destination image
                                already exists, an alternative name is
                                chosen. If the overwrite option is
                                selected, the image file is instead
                                overwriten.
 -r,--round-corners             Causes all corners to be rendered as round
                                corners.
 -S,--no-shadows                Turns off the drop-shadow effect.
 -s,--scale <SCALE>             A natural number that determines the size
                                of the rendered image. The units are
                                fractions of the default size (2.5 renders
                                1.5 times bigger than the default).
    --svg                       Write a SVG image as destination file.
    --svg-font-url <FONT>       SVG font URL.
 -T,--transparent               Causes the diagram to be rendered on a
                                transparent background. Overrides
                                --background.
 -t,--tabs <TABS>               Tabs are normally interpreted as 8 spaces
                                but it is possible to change that using
                                this option. It is not advisable to use
                                tabs in your diagrams.
 -v,--verbose                   Makes ditaa more verbose.
 -W,--fixed-slope               Makes sides of parallelograms and
                                trapezoids fixed slope instead of fixed
                                width.

Syntax

Round corners

If you use / and \ to connect corners, they are rendered as round corners:

/--+
|  |
+--/

Color

Color codes can be used to add color to the diagrams. The syntax of color codes is

cXXX

where XXX is a hex number. The first digit of the number represents the red component of the color, the second digit represents green and the third blue (good ol' RGB). See below for an example of use of color codes:

/----\ /----\
|c33F| |cC02|
|    | |    |
\----/ \----/

/----\ /----\
|c1FF| |c1AB|
|    | |    |
\----/ \----/

This can become a bit tedious after a while, so there are (only some for now) human readable color codes provided:

Color codes
/-------------+-------------\
|cRED RED     |cBLU BLU     |
+-------------+-------------+
|cGRE GRE     |cPNK PNK     |
+-------------+-------------+
|cBLK BLK     |cYEL YEL     |
\-------------+-------------/

As you can see above, if a colored shape contains any text, the color of the text is adjusted according to the underlying color. If the underlying color is dark, the text color is changed to white (from the default black).

Note that color codes only apply if they are within closed shapes, and they have no effect anywhere outside.

Tags

ditaa recognises some tags that change the way a rectangular shape is rendered. All tags are between { and }. See the reference below:

Document - Symbol representing a document.

+-----+
|{d}  |
|     |
|     |
+-----+

Storage - Symbol representing a form of storage, like a database or a hard disk.

+-----+
|{s}  |
|     |
|     |
+-----+

Input/Output - Symbol representing input/output.

+-----+
|{io} |
|     |
|     |
+-----+

Ellipse

+-----+
|{o}  |
|     |
|     |
+-----+

Manual operation

+-----+
|{mo} |
|     |
|     |
+-----+

Decision ("Choice")

+-----+
|{c}  |
|     |
|     |
+-----+

Trapezoid

+-----+
|{tr} |
|     |
|     |
+-----+

Dashed lines

Any lines that contain either at least one = (for horizontal lines) or at least one : (for vertical lines) are rendered as dashed lines. Only one of those characters can make a whole line dashed, so this feature "spreads". The rationale behind that is that you only have to change one character to switch from normal to dashed (and vice versa), rather than redrawing the whole line/shape. Special symbols (like document or storage symbols) can also be dashed. See below:

----+  /----\  +----+
    :  |    |  :    |
    |  |    |  |{s} |
    v  \-=--+  +----+

Point markers

If * is encountered on a line (but not at the end of the line), it is rendered as a special marker, called the point marker (this feature is still experimental). See below:

*----*
|    |      /--*
*    *      |
|    |  -*--+
*----*

Text handling

If the pattern ' o XXXXX' is encountered, where XXXXX is any text, the 'o' is interpreted and rendered as a bullet point. Note that there must be a space before the 'o' as well as after it. See below:

/-----------------\
| Things to do    |
| cGRE            |
| o Cut the grass |
| o Buy jam       |
| o Fix car       |
| o Make website  |
\-----------------/

HTML mode

When ditaa is run using the --html option, the input is an HTML file. The contents of the <pre class="textdiagram"> tags are rendered as diagrams and saved in the images directory and a new HTML file is produced with the appropriate <img> tags.

If the id parameter is present in the <pre> tag, its value is used as the filename of the rendered png. Otherwise a filename of the form ditaa_diagram_X.png is used, where X is a number. Similarly, if there is no output filename specified, the converted html file is named in the form of xxxx_processed.html, where xxxx is the filename of the original file.

In this mode, files that exist are not generated again, they are just skipped. You can force overwrite of the files using the --overwrite option.

Developers

Ditaa is going to be gradually rewritten in Clojure (starting with the tests), so it now uses Leiningen for building. In order to get a new stand-alone jar file, just switch into ditaa's top-level dir and type:

lein uberjar

This produces a stand-alone jar in the target folder with a filename of ditaa-x.xx.x-standalone.jar.

Friends and relatives

Here is a list of projects that are related to ditaa and add to its functionality:

  • Mikael Brännström's ditaa-addons offers two very interesting pieces of functionality: The Textdiagram Javadoc taglet allows you to embed ASCII diagrams to Java comments and have them rendered as ditaa diagrams in the HTML output. The ditaa Eps program allows you to render to EPS instead of PNG.
  • Mathieu Lecarme's ditaa-web allows you to install ditaa on your web server and use it as a webservice through a HTTP POST request.
  • org-mode, a major mode for emacs comes with support for ditaa. Here's how to use it.
  • There is a plugin for DocuWiki that allows you to render ditaa diagrams in the wiki pages. Written by Dennis Ploeger.
  • asciidoctor-diagram a Asciidoctor diagram extension, with support for ditaa and other. asciidoctor/asciidoctor-diagram#76 includes ditaamini-0.10.jar.
  • Markdeep has great support for generating diagrams from ASCII art among other things.
  • muextensions allows embedding ditaa art in documents rendered by Docutils (reStructuredText documents). This includes Pelican statically generated web sites, Hovercraft! presentations, and more.

Here's a list of projects that are somehow related to ditaa, and could prove useful/relevant while using it:

  • Nadim Khemir's asciio could be used for producing the ascii diagrams more easily. It would require some modifications to its default settings for the diagrams to render properly (specifically the characters used for corners should all be set to +).
  • Markus Gebhard's JavE could be used for the same purpose, although I've never tried it.
  • If you make sure to keep the lines straight, artist-mode for emacs can be used to produce ditaa-compatible diagrams.
  • Within Eclipse asciidoctor editor there is support for ditaa rendeing and special editor for .ditaa files with preview.

Contributors

  • Stathis Sideris - original author
  • Bill Baker - co-maintainer
  • Jean Lazarou - SVG rendering
  • John Tsiombikas - beta testing
  • Leonidas Tsampros - beta testing

Thanks to Steve Purcell for writing JArgs.

Thanks to Mr. Jericho for writing Jericho HTML Parser.

ditaa's People

Contributors

aadrian avatar anarazel avatar flupp avatar fommil avatar geoffholden avatar jeanlazarou avatar neolefty avatar paulvi avatar pedher-avi avatar stathissideris avatar wols avatar xakon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ditaa's Issues

Support .svg in LaTeX rendering mode

Currently it is not supported to render LaTeX formulae into .svg files.
But it is highly preferable for users who use this feature in their papers and want to reuse the diagrams in their presentations.

How to set up support for Chinese

  +--------+   +-------+   +-------+
  |   创意  | --+ 运营   +-->| 成果   |
  +---+----+   +-------+   +-------+
      :                         ^
      |       转化               |
      +-------------------------+

image

escaping of characters in text boxes

I would like to have a box containing text like :key but the colon is being stripped and sometimes gets interpreted as a dotted line indicator and "infects" the entire box.

A possible solution to CJK fonts nightmare.

I got an headache on aligning diagrams with the CJK fonts. For example,

+-------------------+                                +------------+
| {d}               |                                | {d}        |
| /etc/renderd.conf |                                | httpd.conf |
| 區塊快取設定檔           |                                | 伺服器設定檔     |
+-------------------+                                +------------+

Even if the mono fonts, like Noto Sans Mono CJK, is setup in editor, the CJK character width takes 1.5 or 2 times the width of latin character's, depending on the font setting and editor, which breaks the alignments of diagrams.

I consider a solution shown below. By introducing the labels inside the diagram, we can define the text which the label is replaced with. Note this shows only the concept and the syntax needs not to be strictly followed.

+-------------------+                                +------------+
| {d}               |                                | {d}        |
| /etc/renderd.conf |                                | httpd.conf |
| {{aaa}}           |                                | {{bbb}}    |
+-------------------+                                +------------+

aaa=區塊快取設定檔
bbb=伺服器設定檔

What determines the SVG font size? Different machines produce different results.

What determines the font size that is used when generating SVG figures?

We create some documentation, like class diagrams, going from classes to ditaa to SVG to tikz (a LaTeX figure). Most text in the SVG figures has font size 15, however, some text has size 14 or 13. The figures are mostly text in boxes, and it is roughly the case that a smaller font size is selected in order to fit text in the box (text with many Ms and Ws often has a smaller font size than text with many Is). The main problem for us is that different machines produce different results. Which means that currently we can only consistently create figures on one particular machine.

I've not yet been able to determine what influences the font size being used. As in, I tried to create a Docker container that matches the other machine as closely as I could, but it still produces different results, so I'm probably missing something.

Attached differentsizes.zip with a ditaa file and two svg files (apparently these cannot be uploaded to github directly). The diff (machine1 is the main machine, machine2 a docker container, both Ubuntu 20.04):

diff ApplyAstrom.machine1.svg ApplyAstrom.machine2.svg 
24,27c24,27
<     <text x='40' y='166' font-family='Courier' font-size='13' stroke='none' fill='#ffffff' ><![CDATA[ASTROM_HDR]]></text>
<     <text x='280' y='68' font-family='Courier' font-size='15' stroke='none' fill='#ffffff' ><![CDATA[DETRENDFINALAI_IMG or]]></text>
<     <text x='280' y='82' font-family='Courier' font-size='14' stroke='none' fill='#ffffff' ><![CDATA[DETRENDFINAL_IMG]]></text>
<     <text x='335' y='250' font-family='Courier' font-size='15' stroke='none' fill='#ffffff' ><![CDATA[apply_astrom]]></text>
---
>     <text x='41' y='166' font-family='Courier' font-size='14' stroke='none' fill='#ffffff' ><![CDATA[ASTROM_HDR]]></text>
>     <text x='280' y='69' font-family='Courier' font-size='15' stroke='none' fill='#ffffff' ><![CDATA[DETRENDFINALAI_IMG or]]></text>
>     <text x='280' y='83' font-family='Courier' font-size='15' stroke='none' fill='#ffffff' ><![CDATA[DETRENDFINAL_IMG]]></text>
>     <text x='341' y='251' font-family='Courier' font-size='15' stroke='none' fill='#ffffff' ><![CDATA[apply_astrom]]></text>

Both files are created through

java -jar ditaa-0.11.0-standalone.jar "ApplyAstrom.ditaa" -E --no-shadows --svg "ApplyAstrom.svg"

My guess is that it has something to do with the exact font that is being used. But I don't understand what font exactly is chosen or how. So maybe the font size can be made consistent by using --svg-font-url, but I don't understand how to use that either.

Please create new releases with proper git tags

Hello,

most distributions still provide very old versions of ditaa becaue you have not made any proper upstream releases since version 0.9. Please consider releasing 0.10 with a proper git tag at least (so that it appears in the "release" tag in github).

You should probably also document that ditaa moved away from sourceforge to github on http://ditaa.sourceforge.net ...

Thank you!

Sphinx (1.7.9) html build of .rst doc-n (with '.. ditaa::' directive) fails with undescriptive exception error if the path to 'ditaa_.jar' in conf.py is invalid (or the ditaa exec cannot be found otherwise)

If there is .. ditaa:: directive used in .rst documentation collection (that is tried to be built into html one) and something goes wrong with finding Ditaa java executable, the whole Sphinx build process crashes with unhandled exception:

Exception occurred:
File "/home/path/to/sphinx_1.7.9/local/lib/python2.7/site-packages/sphinxcontrib/ditaa.py", line 151, in render_ditaa
   if err.errno != ENOENT: # No such file or directory
NameError: global name 'ENOENT' is not defined

It is more or less clearly described how to set it up manually, but installing the extension (pip install sphinxcontrib-ditaa) doesn't automatically lead to working environment with the settings offered:

ditaa = "java"
ditaa_args = ["-jar", "/usr/local/Cellar/ditaa/0.10/libexec/ditaa0_10.jar"]

and for a person, who has no idea what could have gone wrong there, this kind of error message for the issue is totally undescriptive (in addition to the fact that such the exception should not be left unhandled)

Also, the official Ditaa source page [http://ditaa.sourceforge.net/] mentions links to hosted latest ver.0.9 of ditaa0_9.jar from here. From where this 0.10-th ver. /usr/local/Cellar/ditaa/0.10/libexec/ditaa0_10.jar does come from?
There are no valid links on the extension page that would lead to it.

0.10 release calls itself 0.9

When building the 0.10 release, the output jar file is still called ditaa0_9.jar.
The version.string property in release.xml didn't get updated.

ditaa slowly eats all available ram and never outputs a file

when running ditaa on the following diagram with java -jar ditaa-0.11.0-standalone.jar test.dit test.jpg, the jvm process consumes all available ram on my 32 gig system over a minute and never actually produces an image before i kill it

+------+
| test |
+------+

Remove 'o' as a bullet point pattern

Hi,
Would you consider removing 'o' as a bullet point pattern? 'o' in Portuguese ' is equivalent to the definite article 'the', which results in unintended output:

/-------------------------------------------------------------------------------------\
|Coloque um fio de azeite na frigideira.                                              |
|Se quiser, salpique um pouquinho de farinha de trigo – isso ajuda o ovo a não grudar.|
|Deixe aquecer.                                                                       |
\-------------------------------------------------------------------------------------/
      |
      v
/------------------------------------------\
|Quebre o ovo na figideira.                |
|Salpique uma pitada de sal por todo o ovo.|
\------------------------------------------/
      |
      v
/----------------------------------------------------------------\
|Mantenha em fogo baixo até a clara estar rendada e a gema, mole.|
|Retire o ovo da frigideira e sirva.                             |
\----------------------------------------------------------------/

como_fritar_ovo

As far as I can tell it would be necessary to change line 913 of src/java/org/stathissideris/ascii2image/text/TextGrid.java:

public boolean isBullet(Cell cell){
char c = get(cell);
if((c == 'o' || c == '*')
&& isBlank(cell.getEast())
&& isBlank(cell.getWest())
&& Character.isLetterOrDigit(get(cell.getEast().getEast())) )
return true;
return false;
}

Thanks!

Is it possible to write subscript?

Hello,

Thanks to maintain this piece of software, it is really an useful tool!
I was wandering if it allows to write subscript: I tried something LaTex-ish like k_1, but that does not work.
Is this supported?

Text changes size randomly

Here's an image I just created:

out

...from this:

+----+ +----+
+ 3.0| | GND+
+----+ +----+  

...using:

java -jar /tmp/ditaa-0.11.0-standalone.jar x -o out.png -s 0.75

The 3.0 text and the GND text are different sizes --- if I render as SVG, I can see that the 3.0 is 10 point and the GND is 7 point. In the full diagram (of which this is a snippet) it all looks really weird. The -s 0.75 isn't necessary, but makes things a bit more obvious as the small text is much less bold than the large text.

This is on Debian with openjdk 11.0.6-ea 2020-01-14.

Do you know what's going on (and more importantly, how to stop it)?

Current license?

What is the current license? The Readme states that the code is licensed under the GPL, but COPYING says LGPL. (I'd prefer the latter one)

diagonal lines

it would be great if diagonal lines between components would be drawn. e.g.

   +-----------------------------------+
   |                         branches  |
   |  Sonatype             /----------\|
   |                   /-=-+scala 2.11||            MELPA
   | +-------------+   |   +----------+|          +------------+
   | |ensime-server+-=-----+scala 2.10|+----------+ensime-emacs|
   | +-------------+   |   +----------+|          +------------+
   |                   \-=-+scala 2.9 ||
   |                       \----------/|
   +-----------------------------------+

I really just want to draw diagonal lines coming from ensime-server to the scala-2.11 and scala-2.9 boxes.

Official docker image

Is there interest in supporting an official ditaa docker image? I did a little work updating this old one to support the latest version of ditaa chai2010/ditaa-docker#1
and also added good unicode support chai2010/ditaa-docker#2

I think it would be a big! boost to the project if we could iterate on the above a little and document some example and make the usage flow really convenient for newcomers to the tool to make use of ditaa via the docker image and officially link it the doc.

LaTeX math mode support

It will be very useful if we can use LaTeX's math mode inside ditaa's ascii art.
That is, if we have a following ascii art,


$Box_1$                    $Box^2$
+---------------------+    +------+   /---------\
|$\sum_{i=0}^{n}x^i$  |    |$cBLU$|   |         |
|                     +--->|cRED  +-=-+cGRE$C_k$|
|{io}                 |    |cXYZ  |   |{o}      |
+----------+----------+    +---+--+   \---------/
           |                   |
           |                   :
           |                   V
           |           +-----------------+
           +---------->|$A_i$ hello $B^i$|
                       +-----------------+

$Q_u^i$, $C_k$, $B_r^{own}$, $F_{ox}$ jumps

over a lazy $d\cdot\frac{o}{g}$.


$\forall x \in X, \quad \exists y \leq \epsilon$


$\sin A \cos B =$

    $ \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right]$


$\frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x).$


 $v \sim \mathcal{N} (m,\sigma^2)$

I would see it rendered like this.

art-latexmath-1

I have already implemented this feature in my forked repository and am going to open a pull request soon. Please kindly consider merging it when it's opened.

TextGrid.seedFillOld takes considerable amount of time

The following diagram takes more than 30 seconds to produce an image:

                                                                           +-------------------+
                                                                           |  ABCD_RSTAR_MAIL  |
                                                                           | [ABCD_RSTAR_MAIL] |
                                                                           +-------------------+
                                                                                     |
  PROCESS_ALL_APPLICATIONS (//) -> subStep.each(createPod)                           V
 +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 |                                                                                   ||                                                                                                          |
 |                                                                                   || <application, packname, installeurDir>                                                                   |
 |  PROCESS_APPLICATION (+) -> each(applicationsList)                                \/                                                                                                          |
 | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
 | |                                                                                 |                                                                                                         | |
 | |                                                                                 |                                                                                                         | |
 | |            PROCESS_PREPARE_INSTALL (//)                                         V                                                                                                         | |
 | |           +----------------------------------------------------------------------------------------------------------------------------------------------------------+                    | |
 | |           |                          ||                                                                                   ||                                         |                    | |
 | |           |                          ||                                                                                   ||                                         |                    | |
 | |           |                          \/                                                   PROCESS_PREPARE_INSTALLEUR (+)  \/                                         |                    | |
 | |           |          +-----------------------------------------------+                   +----------------------------------------------------------+                |                    | |
 | |           |          |          GENERATE_PACK                        |                   |                            |                             |                |                    | |
 | |           |          | [INSTALL_APPS, INSTALL_BATCHS, GENERATE_PACK] |                   |                            |                             |                |                    | |
 | |           |          +-----------------------------------------------+                   |                            V                             |                |                    | |
 | |           |                          ||                                                  | +------------------------------------------------------+ |                |                    | |
 | |           |                          ||                                                  | |                      GET_INSTALLEUR                  | |                |                    | |
 | |           |                          ||                                                  | | [ INSTALL_EXSTR, CALL_TILOGFHSQZ_ENV, INSTALL_OTLLS] | |                |                    | |
 | |           |                          ||                                                  | +------------------------------------------------------+ |                |                    | |
 | |           |                          ||                                                  |                            |                             |                |                    | |
 | |           |                          ||                                                  |                            |                             |                |                    | |
 | |           |                          ||                                                  |                            V                             |                |                    | |
 | |           |                          ||                                                  |  +----------------------------------------------------+  |                |                    | |
 | |           |                          ||                                                  |  |                    GET_CONFIG                      |  |                |                    | |
 | |           |                          ||                                                  |  |       [ CALL_DGHUYLOMPR_STATUS_DEACTIVATE ]        |  |                |                    | |
 | |           |                          ||                                                  |  |  [ INSTALL_APPS, INSTALL_BATCHS, INSTALL_EXSTR ]   |  |                |                    | |
 | |           |                          ||                                                  |  |    [ COPY_RESOURCES_WEB, CALL_TILOGFHSQZ_ENV ]     |  |                |                    | |
 | |           |                          ||                                                  |  | [ CALL_DGHUYLOMPR_STATUS_ACTIVATE, INSTALL_OTLLS ] |  |                |                    | |
 | |           |                          ||                                                  |  +----------------------------------------------------+  |                |                    | |
 | |           |                          ||                                                  |                            |                             |                |                    | |
 | |           |                          ||                                                  |                            |                             |                |                    | |
 | |           |                          ||                                                  |                            V                             |                |                    | |
 | |           |                          ||                                                  +----------------------------------------------------------+                |                    | |
 | |           |                          ||                                                                               ||                                             |                    | |
 | |           |                          ||                                                                               ||                                             |                    | |
 | |           |                          \/                                                                               \/                                             |                    | |
 | |           +----------------------------------------------------------------------------------------------------------------------------------------------------------+                    | |
 | |                                                                                 |                                                                                                         | |
 | |                                                                                 |                                                                                                         | |
 | |            PROCESS_INIT_INSTALL (//)                                            V                                                                                                         | |
 | |           +-------------------------------------------------------------------------------------------------------------------------------------------+                                   | |
 | |           |                 ||                                       ||                                                    ||                         |                                   | |
 | |           |                 ||                                       ||                                                    ||                         |                                   | |
 | |           |                 \/                                       \/                                                    \/                         |                                   | |
 | |           | +--------------------------------+    +-------------------------------------+    +------------------------------------------------------+ |                                   | |
 | |           | |            GET_PACK            |    |       DEACTIVATE_ENV_DGHUYLOMPR     |    |                    EXEC_INSTALLEUR                   | |                                   | |
 | |           | | [INSTALL_APPS, INSTALL_BATCHS] |    | [CALL_DGHUYLOMPR_STATUS_DEACTIVATE] |    | [ INSTALL_EXSTR, CALL_TILOGFHSQZ_ENV, INSTALL_OTLLS] | |                                   | |
 | |           | +--------------------------------+    +-------------------------------------+    +------------------------------------------------------+ |                                   | |
 | |           |                 ||                                       ||                                                    ||                         |                                   | |
 | |           |                 ||                                       ||                                                    ||                         |                                   | |
 | |           |                 \/                                       \/                                                    \/                         |                                   | |
 | |           +-------------------------------------------------------------------------------------------------------------------------------------------+                                   | |
 | |                                                                                 |                                                                                                         | |
 | |                                                                                 |                                                                                                         | |
 | |  PROCESS_INSTALL (//)                                                           V                                                                                                         | |
 | | +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |
 | | |                               || <nodeType=batchs>     ||                            ||                          ||                              ||                                   | | |
 | | |                               ||                       ||                            ||                          ||                              ||                                   | | |
 | | |  PROCESS_INSTALL_BATCHS (//)  \/  [ INSTALL_BATCHS ]   ||  PROCESS_INSTALL_APPS (//) \/  [ INSTALL_APPS ]        ||   PROCESS_INSTALL_EXSTR (+)  \/  [ INSTALL_EXSTR ]                | | |
 | | | +----------------------------------------------------+ || +-----------------------------------------------+      ||  +-------------------------------------------------------------+  | | |
 | | | |                                 ||                 | || |                               ||              |      ||  |                           |                                 |  | | |
 | | | | PROCESS_INSTALL_BATCHS_NODE (+) \/                 | || | PROCESS_INSTALL_APPS_NODE (+) \/              |      ||  |                           |                                 |  | | |
 | | | | +------------------------------------------------+ | || | +-------------------------------------------+ |      ||  |                           V                                 |  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||  |                 +----------------+                          |  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||  |                 | INSTALL_EXSTR  |                          |  | | |
 | | | | |                         V                      | | || | |                     V                     | |      ||  |                 +----------------+                          |  | | |
 | | | | |                  +-------------+               | | || | |               +-----------+               | |      ||  |                           |                                 |  | | |
 | | | | |                  | STOP_BATCHS |               | | || | |               | STOP_APPS |               | |      ||  |                           |                                 |  | | |
 | | | | |                  +-------------+               | | || | |               +-----------+               | |      ||  |                           V                                 |  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||  +-------------------------------------------------------------+  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||                                                                   | | |
 | | | | |                         V                      | | || | |                     V                     | |      ||                                                                   | | |
 | | | | |               +------------------+             | | || | |            +----------------+             | |      ||                                                                   | | |
 | | | | |               | UNINSTALL_BATCHS |             | | || | |            | UNINSTALL_APPS |             | |      ||                                                                   | | |
 | | | | |               +------------------+             | | || | |            +----------------+             | |      ||                                                                   | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||                                                                   | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||                                                                   | | |
 | | | | |                         V                      | | || | |                     V                     | |      ||                                                                   | | |
 | | | | |                +----------------+              | | || | |             +--------------+              | |      ||___________________________________________                        | | |
 | | | | |                | INSTALL_BATCHS |              | | || | |             | INSTALL_APPS |              | |      ||------------------------------------------ |                       | | |
 | | | | |                +----------------+              | | || | |             +--------------+              | |      ||                                          ||                       | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||                                          ||                       | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||   PROCESS_INSTALL_RESOURCES_WEB_HELP (+) \/[ COPY_RESOURCES_WEB ] | | |
 | | | | |                         V                      | | || | |                     V                     | |      ||  +-------------------------------------------------------------+  | | |
 | | | | |                +----------------+              | | || | |              +------------+               | |      ||  |                              |                              |  | | |
 | | | | |                | STATUS_BATCHS  |              | | || | |              | RSTAR_APPS |               | |      ||  |                              |                              |  | | |
 | | | | |                +----------------+              | | || | |              +------------+               | |      ||  |                              V                              |  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||  |                   +-------------------------+               |  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||  |                   | GET_RESOURCES_WEB_HELP  |               |  | | |
 | | | | |                         |                      | | || | |                     V                     | |      ||  |                   +-------------------------+               |  | | |
 | | | | |                         |                      | | || | |              +-------------+              | |      ||  |                              |                              |  | | |
 | | | | |                         |                      | | || | |              | STATUS_APPS |              | |      ||  |                              |                              |  | | |
 | | | | |                         |                      | | || | |              +-------------+              | |      ||  |                              V                              |  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||  |                   +-------------------------+               |  | | |
 | | | | |                         |                      | | || | |                     |                     | |      ||  |                   | COPY_RESOURCES_WEB_HELP |               |  | | |
 | | | | +------------------------------------------------+ | || | +-------------------------------------------+ |      ||  |                   +-------------------------+               |  | | |
 | | | |                           |                        | || |                       |                       |      ||  |                              |                              |  | | |
 | | | |                           V                        | || |                       V                       |      ||  |                              V                              |  | | |
 | | | +---------------------------+------------------------+ || +-----------------------------------------------+      ||  +-------------------------------------------------------------+  | | |
 | | |                                                        ||                                                        ||                                                                   | | |
 | | |                                                        ||                                                        ||                                                                   | | |
 | | |                                                        ||                                                        ||                                                                   | | |
 | | |                                                        ||                                                        ||                                                                   | | |
 | | |                                                        ||                                                        ||                                                                   | | |
 | | |                                                        ||                                                        ||                                                                   | | |
 | | |                           PROCESS_INSTALL_${tool} (+)  \/ [ INSTALL_OTLLS ]   PROCESS_INSTALL_RESOURCES_WEB (+)  \/  [ COPY_RESOURCES_WEB ]                                           | | |
 | | |                          +-------------------------------------------------+ +-------------------------------------------------------------+                                          | | |
 | | |                          |                         |                       | |                              |                              |                                          | | |
 | | |                          |                         |                       | |                              |                              |                                          | | |
 | | |                          |                         V                       | |                              V                              |                                          | | |
 | | |                          |            +-------------------------+          | |                   +--------------------+                    |                                          | | |
 | | |                          |            | GET_TOOL_CONFIG_${tool} |          | |                   | GET_RESOURCES_WEB  |                    |                                          | | |
 | | |                          |            +-------------------------+          | |                   +--------------------+                    |                                          | | |
 | | |                          |                         |                       | |                              |                              |                                          | | |
 | | |                          |                         |                       | |                              |                              |                                          | | |
 | | |                          |                         V                       | |                              V                              |                                          | | |
 | | |                          |                +-----------------+              | |                   +--------------------+                    |                                          | | |
 | | |                          |                | INSTALL_${tool} |              | |                   | COPY_RESOURCES_WEB |                    |                                          | | |
 | | |                          |                +-----------------+              | |                   +--------------------+                    |                                          | | |
 | | |                          |                         |                       | |                              |                              |                                          | | |
 | | |                          |                         V                       | |                              V                              |                                          | | |
 | | |                          +-------------------------------------------------+ +-------------------------------------------------------------+                                          | | |
 | | |                                                       ||                                                    ||                                                                        | | |
 | | |                                                       ||                                                    ||                                                                        | | |
 | | |                                                       \/                                                    \/                                                                        | | |
 | | +-----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+ | |
 | |                                                                                     |                                                                                                     | |
 | |                                                                                     |                                                                                                     | |
 | |                                                                                     V                                                                                                     | |
 | |                                                                        +------------------------+                                                                                         | |
 | |                                                                        | DELIVER_ENV_DGHUYLOMPR |                                                                                         | |
 | |                                                                        | [CALL_TILOGFHSQZ_ENV]  |                                                                                         | |
 | |                                                                        +------------------------+                                                                                         | |
 | |                                                                                     |                                                                                                     | |
 | |                                                                                     |                                                                                                     | |
 | |                                                                                     V                                                                                                     | |
 | |                                                                  +------------------+------------------+                                                                                  | |
 | |                                                                  |       ACTIVATE_ENV_DGHUYLOMPR       |                                                                                  | |
 | |                                                                  |  [CALL_DGHUYLOMPR_STATUS_ACTIVATE]  |                                                                                  | |
 | |                                                                  +-------------------------------------+                                                                                  | |
 | |                                                                                     |                                                                                                     | |
 | |                                                                                     |                                                                                                     | |
 | |                                                                                     V                                                                                                     | |
 | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
 |                                                                                       ||                                                                                                      |
 |                                                                                       ||                                                                                                      |
 |                                                                                       \/                                                                                                      |
 +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
                                                                                         |
                                                                                         |
                                                                                         V
                                                                        +--------------------------------+
                                                                        |          TAG_REF_CONFIG        |
                                                                        | [INSTALL_APPS, INSTALL_BATCHS] |
                                                                        +--------------------------------+
                                                                                         |
                                                                                         |
                                                                                         V
                                                                                +-----------------+
                                                                                |  ABCD_END_MAIL  |
                                                                                | [ABCD_END_MAIL] |
                                                                                +-----------------+

Here's the flamegraph:

image

As you can see 80% of the time is spent in the TextGrid.seedFillOld method:

private CellSet seedFillOld(Cell seed, char newChar){
CellSet cellsFilled = new CellSet();
char oldChar = get(seed);
if(oldChar == newChar) return cellsFilled;
if(isOutOfBounds(seed)) return cellsFilled;
Stack<Cell> stack = new Stack<Cell>();
stack.push(seed);
while(!stack.isEmpty()){
Cell cell = (Cell) stack.pop();
set(cell, newChar);
cellsFilled.add(cell);
Cell nCell = cell.getNorth();
Cell sCell = cell.getSouth();
Cell eCell = cell.getEast();
Cell wCell = cell.getWest();
if(get(nCell) == oldChar) stack.push(nCell);
if(get(sCell) == oldChar) stack.push(sCell);
if(get(eCell) == oldChar) stack.push(eCell);
if(get(wCell) == oldChar) stack.push(wCell);
}
return cellsFilled;
}

I'm not familiar with the code base but maybe it can be optimized?

Let me know if you need more information, I will gladly provide them 🤗

transparent background

The default background colour for the entire output image is white, but it would be a lot better if the default background was transparent so that the diagrams can be included in coloured slides.

The default background colour for a box should still be white.

New release forthcoming? :)

Howdy. Is there any chance of a new release soon to incorporate the changes, bugfixes and features committed since 2018? :) I've been using PlantUML for diagramming, and I've now got the bug for text-based diagram generators. :) Cheers, and thanks for ditaa!

Customize fonts

Currently Ditaa builds diagrams using the system Dialog font, as mapped by the JVM, with point size 12.

Is anyone interested in command line parameters that allows the user to choose a font and its point size? I propose a roadmap and I'm volunteering to implement the feature myself, if more people are interested and the maintainer is willing to consider the feature.

Roadmap

  • Choose command line parameter. I propose -f, --font and -F, --font-size.
  • Decide which action to take when font isn't found on the system. Either fall back to the default Dialog and emit a warning or completely halt the program. I propose terminating right away.
  • Parse command line parameters.
  • Modify FontMeasurer to parameterize over font and point size.
  • Add error handling.
  • Add documentation about feature.

Mavenization

The current version of ditaa relies on 'leiningen' for its build. However it is less popular and has less supports from major IDE's.
To be honest, I could not figure out how to import ditaa's project directly into my IntelliJ and I had to resort to lein pom to convert project.clj.

I think it would be very helpful if we have pom.xml , which is a project descriptor in maven's ecosystem out of the box since it was not straightforward to make it work.

Actually, I have already created pom.xml in my forked repository and would open a pull request for it. Please have a look at it and consider merging it when it becomes ready.

Loses some text nodes

Hi,

I have a diagram that I've reduced to this test case:

Text 1
  |
  |
  |
  V
Text 2
  |
  |
  |
  V

Ditaa (both 0.10 from Debian, and latest version from GitHub) renders it like this:

test

Somehow the second text node is lost.

Broken link in README

In the README, the link to http://packages.ubuntu.com/precise/ditaa is broken. It's now bionic instead of precise.

Boxes and their included text are not aligned properly.

I am trying to generate a picture for the following diagram:

+-----------------------------------------------+
|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
+-----------------------------------------------+

The image that is displayed is the following:
image

This could probably be fixed under issue #38 or something similar.

Custom shapes and changed orientation possible?

Hi.

Is it possible to have user-defined shapes in ditaa (like a star triangle for example)?

Also, is it possible to change orientations of shapes? For example can we have a mirrored version of trapezoid?

Thanks a lot for making ditaa.

ASL 2.0

Could this code be licensed under ASL 2.0?

Outdated Ubuntu Version

The Ubuntu version of ditaa appears to be out of date in the aptitude (apt-get) package manager. I've been excited for a while to get the SVG image output update: #30

The man page (man ditaa) produces no hint of these changes arriving, so this may just be a documentation issue:

DITAA(1)                    General Commands Manual                   DITAA(1)

NAME
       ditaa - convert ASCII diagrams into proper bitmap graphics

SYNOPSIS
       ditaa [options] input [output]

DESCRIPTION
       This manual page documents briefly the ditaa command.

       DiTAA  is  a small command-line utility that can convert diagrams drawn
       using ASCII art  ("drawings"  that  contain  characters  that  resemble
       lines, like | / and -), into proper bitmap graphics.

       DiTAA  also uses special markup syntax to increase the possibilities of
       shapes and symbols that can be rendered.

OPTIONS
       --help Show summary of options.

       -v, --verbose
              Makes ditaa more verbose.

       -A, --no-antialias
              Turns anti-aliasing off.

       -d, --debug
              Renders the debug grid over the resulting image.

       -E, --no-separation
              Prevents the separation of common edges of shapes.

       -e ENCODING, --encoding ENCODING
              The encoding of the input file.

       -h, --html
              In this case the input is an HTML file. The contents of the <pre
              class="textdiagram">  tags are rendered as diagrams and saved in
              the images directory and a new HTML file is  produced  with  the
              appropriate <img> tags.

       -o, --overwrite
              If  the  filename  of  the  destination image already exists, an
              alternative  name  is  chosen.   If  the  overwrite  option   is
              selected, the image file is instead overwriten.

       -r, --round-corners
              Causes all corners to be rendered as round corners.

       -s SCALE, --scale SCALE
              A natural number that determines the size of the rendered image.
              The units are fractions of the default  size  (2.5  renders  1.5
              times bigger than the default).

       -S, --no-shadows
              Turns off the drop-shadow effect.

       -t TABS, --tabs TABS
              Tabs  are normally interpreted as 8 spaces but it is possible to
              change that using this option. It is not advisable to  use  tabs
              in your diagrams.

AUTHOR
       DiTAA was written by Efstathios (Stathis) Sideris.

       This  manual  page was written by David Paleino <[email protected]>, for
       the Debian project (and may be used by others).

                                April 15, 2010                        DITAA(1)

Strange Error; IndexOutOfBoundsException

I recently installed the 0.10 version of ditaa, and when I try to use it, I get the following error message:


ditaa version 0.9, Copyright (C) 2004--2009  Efstathios (Stathis) Sideris

Running with options:
Reading file: ./pipeline.txt
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at org.stathissideris.ascii2image.graphics.DiagramShape.connectEndsToAnchors(DiagramShape.java:688)
	at org.stathissideris.ascii2image.graphics.CompositeDiagramShape.connectEndsToAnchors(CompositeDiagramShape.java:217)
	at org.stathissideris.ascii2image.graphics.Diagram.<init>(Diagram.java:372)
	at org.stathissideris.ascii2image.core.CommandLineConverter.main(CommandLineConverter.java:241)

I don't know what to make of this.

Bad hyphen-minus

Please see the attached image.
bad_hyphen-minus
Source:

+--------------+
| server-node1 |
+--------------+
+---------------+
| server- node1 |
+---------------+

image in a box?

This project looks awesome, btw, and I'm looking forward to creating some diagrams for my next talk with it.

Is it possible to include an image in one of the network boxes? I would like to use some logos (e.g. of services like github/shippable/whatever) instead of their plain text names.

draw mac80211 in rectangle `c802` parse as color

  1. I use latex ctan package ditaa, draw mac80211 in rectangle, but c802 parse as color.
  +----------+
  | mac80211 |
  +----------+
  1. The result is picture below:
    image

  2. Is there any general escape method to solve problems like 'o' or 'cXXX'?

Font size is not fixed

When I have CJK characters in shapes, the same character has different sizes in different shapes.

line crossings would be nice

It would be nice if line crossings could be used.

Examples how it could look like:

  • vertical crossing

         |
         |
---------)------------
         |
         |
  • vertical crossing

         |
         |
---------n------------
         |
         |

Allow line cross box border from inside to outside

Fix lines crossing border from inside of box to outside. Either :

  • you get a line with space where you want to cross the border and need an extra line on a small box (3 lines must be switched to 5 lines)
  • the box is not draw when asking a full crossing with +
+----------+
|          |
|       ------>
|          |
+----------+

+----------+
|       ---+-->
+----------+

actual possible result is :
Capture d’écran 2020-02-11 à 00 08 08

Have a pointer symbol "*" in block

Hi,

I'm trying to have a block like this:

+------------+
|int* func() |
+------------+

* stand for pointer so I'd like to keep it exactly as *. But it will be transferred into a big blank if I do so in raw rst file. Tried \* and #* as well, none of them meets my requirements.

Is there a way to have a pointer symbol in a block? Thanks a lot

ditaa fails to build with newer batik releases

After fix of CVE-2015-0250 in batik:
https://xmlgraphics.apache.org/batik/download.html

ditaa seems to fail to build, here is log:

[javac] Compiling 33 source files to /builddir/build/BUILD/ditaa-0.10/jar-temp
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/graphics/ImageHandler.java:45: error: cannot find symbol
[javac] import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
[javac] ^
[javac] symbol: class SAXSVGDocumentFactory
[javac] location: package org.apache.batik.dom.svg
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java:32: error: cannot find symbol
[javac] import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
[javac] ^
[javac] symbol: class SAXSVGDocumentFactory
[javac] location: package org.apache.batik.dom.svg
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/core/JavadocTaglet.java:90: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac] Method configurationMethod = htmlDoclet.getClass().getMethod("configuration", null);
[javac] ^
[javac] cast to Class for a varargs call [javac] cast to Class[] for a non-varargs call and to suppress this warning
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/core/JavadocTaglet.java:91: warning: non-varargs call of varargs method with inexact argument type for last parameter;
[javac] Object config = configurationMethod.invoke(htmlDoclet, null);
[javac] ^
[javac] cast to Object for a varargs call
[javac] cast to Object[] for a non-varargs call and to suppress this warning
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java:55: error: cannot find symbol
[javac] SAXSVGDocumentFactory df = new SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
[javac] ^
[javac] symbol: class SAXSVGDocumentFactory
[javac] location: class OffScreenSVGRenderer
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java:55: error: cannot find symbol
[javac] SAXSVGDocumentFactory df = new SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
[javac] ^
[javac] symbol: class SAXSVGDocumentFactory
[javac] location: class OffScreenSVGRenderer
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java:67: error: cannot find symbol
[javac] SAXSVGDocumentFactory df = new SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
[javac] ^
[javac] symbol: class SAXSVGDocumentFactory
[javac] location: class OffScreenSVGRenderer
[javac] /builddir/build/BUILD/ditaa-0.10/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java:67: error: cannot find symbol
[javac] SAXSVGDocumentFactory df = new SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
[javac] ^
[javac] symbol: class SAXSVGDocumentFactory
[javac] location: class OffScreenSVGRenderer

Cannot plot loop between four circle

I want to plot something like the following, loop between four circles

+---+  +---+
|{o}+--+{o}|
+-+-+  +-+-+
  |      |
+-+-+  +-+-+
|{o}+--+{o}|
+---+  +---+

But ditaa treat it as a cross, it there any options to solve this? I just want a raw line, no arrow on it

IndexOutOfBoundsException / NoSuchElementException with rounded corner directly next to box

The following pictures result in exceptions:

+-+
| |
+-+\
   |

results in

ditaa version 0.11, Copyright (C) 2004--2017  Efstathios (Stathis) Sideris

Running with options:
Reading file: mapdb.ditaa.txt
Exception in thread "main" java.util.NoSuchElementException
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1447)
        at java.util.HashMap$KeyIterator.next(HashMap.java:1469)
        at org.stathissideris.ascii2image.text.CellSet.getFirst(CellSet.java:81)
        at org.stathissideris.ascii2image.graphics.CompositeDiagramShape.createOpenFromBoundaryCells(CompositeDiagramShape.java:84)
        at org.stathissideris.ascii2image.graphics.Diagram.<init>(Diagram.java:366)
        at org.stathissideris.ascii2image.core.CommandLineConverter.main(CommandLineConverter.java:252)
return value 1
+-+
| |
+-+\
   |
   |

results in

ditaa version 0.11, Copyright (C) 2004--2017  Efstathios (Stathis) Sideris

Running with options:
Reading file: mapdb.ditaa.txt
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
        at java.util.ArrayList.rangeCheck(ArrayList.java:659)
        at java.util.ArrayList.get(ArrayList.java:435)
        at org.stathissideris.ascii2image.graphics.DiagramShape.connectEndsToAnchors(DiagramShape.java:688)
        at org.stathissideris.ascii2image.graphics.CompositeDiagramShape.connectEndsToAnchors(CompositeDiagramShape.java:217)
        at org.stathissideris.ascii2image.graphics.Diagram.<init>(Diagram.java:372)
        at org.stathissideris.ascii2image.core.CommandLineConverter.main(CommandLineConverter.java:252)
return value 1

I used version 0.11.0-3 on Arch Linux.

#37 might be related.

How to centre text in a box?

I'm having difficulty centring text across 2 lines in a box, depending on the length of both lines. For example:

+--------------+
|  Some text   |
| across lines |
+--------------+

It seems that no matter what I try, when this diagram is rendered the top line is always either left or right aligned, never centred.

Would appreciate some guidance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.