kroki icon indicating copy to clipboard operation
kroki copied to clipboard

Ditaa diagram options are not working

Open gladykov opened this issue 1 year ago • 3 comments

According to this https://github.com/yuzutech/kroki/issues/1279 , diagram options should work.

But when using examples from here: https://plantuml.com/ditaa

example:

@startditaa < --no-shadows, scale=0.7
+---------+  /--------\   +-------+
| cBLU    +--+cAAA    +---+Version|
|         |  |  Data  |   |   V3  |
|    +----+  |  Base  |   |cRED{d}|
|    |cPNK|  |     {s}|   +-------+
|    |    |  \---+----/
+----+----+    
@endditaa

Renders as: image

in https://kroki.io/#try

gladykov avatar Nov 07 '24 10:11 gladykov

PlantUML embeds ditaa so the following syntax is recognized only by PlantUML:

@startditaa < --no-shadows, scale=0.7
(...)
@endditaa

When using the ditaa endpoint in Kroki, you should pass diagram options as described in the documentation:

https://kroki.io/ditaa/svg/eNrT1oUBbQUFfRg7RkFBQRsmzlWjkOzkE6oAEdNOdnR0hLJ1tcNSi4oz8_NqgGpgoAaMXBJLEsEMMA4zBtIQNdpQu4Acp8TiVKia5CBXl-qUWqiamuQAP2-IOUBQXVxbg-YeqLEgIgYkBBLX54IYDTVfQQEAZBMvuw==?no-shadows
https://kroki.io/ditaa/svg/eNrT1oUBbQUFfRg7RkFBQRsmzlWjkOzkE6oAEdNOdnR0hLJ1tcNSi4oz8_NqgGpgoAaMXBJLEsEMMA4zBtIQNdpQu4Acp8TiVKia5CBXl-qUWqiamuQAP2-IOUBQXVxbg-YeqLEgIgYkBBLX54IYDTVfQQEAZBMvuw==

It seems that the scale option does not work properly. I get the following error:

java.io.FileNotFoundException: --scale 0.7 (No such file or directory) at [email protected]/java.io.FileInputStream.open0(FileInputStream.java) at [email protected]/java.io.FileInputStream.open(FileInputStream.java:219) at [email protected]/java.io.FileInputStream.(FileInputStream.java:157) at [email protected]/java.io.FileInputStream.(FileInputStream.java:112) at org.stathissideris.ditaa.core.CommandLineConverter.convert(CommandLineConverter.java:72) at org.stathissideris.ditaa.core.CommandLineConverter.main(CommandLineConverter.java:40) (exit code 1)

ggrossetie avatar Nov 10 '24 13:11 ggrossetie

I've deployed a fix and now scale is working:

https://kroki.io/ditaa/svg/eNrT1oUBbQUFfRg7RkFBQRsmzlWjkOzkE6oAEdNOdnR0hLJ1tcNSi4oz8_NqgGpgoAaMXBJLEsEMMA4zBtIQNdpQu4Acp8TiVKia5CBXl-qUWqiamuQAP2-IOUBQXVxbg-YeqLEgIgYkBBLX54IYDTVfQQEAZBMvuw==?scale=0.7

Since we have a dedicated endpoint for Ditaa (and a consistent way of defining diagram options) I don't know if we should also support the PlantUML syntax... @gladykov What do you think?

ggrossetie avatar Nov 11 '24 10:11 ggrossetie

I have no strong opinion here. Just encountered this situation while browsing examples and experimenting with Kroki.

gladykov avatar Nov 11 '24 13:11 gladykov