Giter Club home page Giter Club logo

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

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!

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?

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 🤗

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.

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.

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.

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!

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.

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.

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.

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.

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.

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.

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)?

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.

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

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

ASL 2.0

Could this code be licensed under ASL 2.0?

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.

Bad hyphen-minus

Please see the attached image.
bad_hyphen-minus
Source:

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

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.

How to set up support for Chinese

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

image

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

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------------
         |
         |

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=伺服器設定檔

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 |
+------+

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)

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'?

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)

Font size is not fixed

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

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.

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.

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

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.

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.

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!

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!

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.

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.

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.