Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ditaa diagram options are not working #1803

Open
gladykov opened this issue Nov 7, 2024 · 3 comments
Open

Ditaa diagram options are not working #1803

gladykov opened this issue Nov 7, 2024 · 3 comments

Comments

@gladykov
Copy link

gladykov commented Nov 7, 2024

According to this #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

@ggrossetie
Copy link
Member

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 java.base@11.0.18/java.io.FileInputStream.open0(FileInputStream.java) at java.base@11.0.18/java.io.FileInputStream.open(FileInputStream.java:219) at java.base@11.0.18/java.io.FileInputStream.(FileInputStream.java:157) at java.base@11.0.18/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
Copy link
Member

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?

@gladykov
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants