yuzutech / kroki

Creates diagrams from textual descriptions!
https://kroki.io
MIT License
2.88k stars 215 forks source link

Limited width of Mermaid Gantt Diagrams generated by Kroki #1715

Open jay-blanc opened 7 months ago

jay-blanc commented 7 months ago

Hello,

I'm facing a problem trying to generate Gantt Mermaid Diagram with Kroki.

Context

I'm using Kroki with Antora in order to generate Mermaid Gantt Diagram. The issue I get is the width of the generated diagrams is limited. It seems to be a limit of 584px.

How to reproduce the behaviour

Using the Mermaid live editor for a given Gantt diagram, I get a large size allowing the user an easy-to-read diagram. Here is an example :

image

The source is attached to the issue :

gantt-diagram.txt

When you open it with Kroki through the "Actions / Kroki" button in the live editor, you can see that Kroki limits the width of the rendered diagram :

image

Naturally, I get the same behaviour using it in Antora.

Question

Could you please tell me if it is a bug or if there's a way to set a larger width in the rendered diagram ?

Thanks :)

ggrossetie commented 7 months ago

I can reproduce this issue, I guess that's because we are configuring the viewport size: https://github.com/yuzutech/kroki/blob/a5f21c24c16d0beef5eddfbfdf3b5910df2ec711/mermaid/src/worker.js#L40

jay-blanc commented 6 months ago

Hello,

Thanks for the answer :)

Would it be possible to configure it maybe through something like this :

mermaid::gantt.mmd[width="100%"]

ggrossetie commented 6 months ago

I don't recall why we did configure a viewport, we would have to test what happens if we don't specify a viewport.

ggrossetie commented 6 months ago

I'm a bit confused because we had issues with Mermaid/Puppeteer where memory limits exceeded. My guess was that we were trying to generate a huge PNG file but it seems that it can only generate a 800x600: https://github.com/yuzutech/kroki/issues/1702 🤔

imysl0 commented 5 months ago

you can try: image

jay-blanc commented 5 months ago

Hello @imysl0

Thank you for your answer !!!

Honestly, I gave up, but thanks to you, I'm ready to take it back ! It's working perfectly :)

Thanks again ;-)

image