zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.06k stars 219 forks source link

BUG: Mermaid to Excalidraw Conversion Inverts The Participants for Sequence Diagrams #1856

Open kayazuko opened 3 months ago

kayazuko commented 3 months ago

Environment

Bug Description

The Mermaid to Excalidraw function in the Excalidraw plugin reverses the order of participants when converting sequence diagrams from Mermaid syntax to Excalidraw format. Screenshot 2024-06-27 161053

This issue does not occur on the Excalidraw.com website, suggesting it's specific to the Obsidian implementation.

Steps to Reproduce

  1. Open Excalidraw plugin within Obsidian.
  2. Create a new diagram and select the option "Mermaid to Excalidraw".
  3. Enter the following Mermaid syntax for a sequence diagram:
    sequenceDiagram
       participant A
       participant B
       participant C
       A->>B: Message from A to B
       B->>C: Message from B to C
       C->>A: Response from C to A
  4. Observe the generated diagram in Excalidraw, which incorrectly orders the participants from C to A instead of A to C as specified. Note: You can also just paste the code directly into the Excalidraw file, which converts to Excalidraw automatically. Same issue.

Expected Behavior

The participant order in the converted Excalidraw diagram should match the order specified in the Mermaid syntax, i.e., from A to C. It works on Excalidraw.com, as shown here: Screenshot 2024-06-27 161042

Additional Context

The problem persists even after disabling all other community plugins, indicating that it is likely an issue within the Excalidraw plugin itself. The workaround of using Excalidraw.com for conversion and copying the diagrams into Obsidian is time-consuming and not ideal for workflow efficiency.

zsviczian commented 2 months ago

this is a known issue. I am not planning to work on this. Once Obsidian moves to the newer Mermaid build I can port the updated mermaid-to-excalidraw package to Obsidian, which will fix this issue.

kayazuko commented 2 months ago

Sounds good, thank you! 👍