asciidoctor / asciidoctor-kroki

Asciidoctor.js extension to convert diagrams to images using Kroki!
https://kroki.io/
MIT License
146 stars 47 forks source link

[Antora+Kroki] Mermaid sequence diagramm no height/width #134

Closed mgh87 closed 3 years ago

mgh87 commented 3 years ago

Hello, I wanted to use Antora with Kroki for a Mermaid sequence diagram. It looks like that kroki, returns no sizes for this diagram type. I tried out other diagrams with kroki which worked. I tried out the kroki-fetch-diagram: true, which also did not work. This might be related to https://github.com/yuzutech/kroki/issues/151.

Example code of not working sequence diagram:

[mermaid,fetch-users]
....
sequenceDiagram;
    U->>K: A;
    activate K;
    K->>U: B;
    deactivate K;
    opt empty C;
        U->>P: D!;
        activate P;
        P->>U: E!;
        deactivate P;
    end;
    U->>PP: F;
    PP->>U: G;
....

Example code of working sequence diagram:

[mermaid,fetch-users]
....
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
....

Screenshot from the fetched image that has 0x0 size. image

ggrossetie commented 3 years ago

Hello @mgh87

This might be related to https://github.com/yuzutech/kroki/issues/151.

That's correct but the upstream issue is: https://github.com/mermaid-js/mermaid/issues/1490 In theory, we could fix it in Kroki (i.e. extract the width and height from the viewbox attribute) but it would be better to fix it directly in Mermaid. If you have time to fix it in Mermaid that would be great! :+1:

Since we won't fix this issue in Asciidoctor Kroki, I suggest that we close this issue and continue the discussion at https://github.com/mermaid-js/mermaid/issues/1490 or https://github.com/yuzutech/kroki/issues/151

mgh87 commented 3 years ago

Ty for the response. Sorry forgot about this issue. I haven't found the issue in mermaid-js and you're completely right it should be fixed there. Closing it.