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

Enhancement to parse WebSequenceDiagrams #4943

Closed
jgwinner opened this issue Oct 13, 2023 · 1 comment
Closed

Enhancement to parse WebSequenceDiagrams #4943

jgwinner opened this issue Oct 13, 2023 · 1 comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@jgwinner
Copy link

jgwinner commented Oct 13, 2023

Description

I'm using Structurizr to generate dynamic views. It can export "Websequencediagrams".

They LOOK like Mermaid's SequenceDiagrams, but there are some implemenation differences.

I searched for Websequencediagrams but didn't see any issues, so I figured this was worth a request for an enhancement and/or bug fix.

Specifics:

When I generate a WebSequencediagram export , the exported lines look like this:

title ANS - Dynamic - AllFlows

actor <<Person>>\nAPI User as API User
participant <<Component>>\nAPI Gateway as API Gateway
participant <<Component>>\nManages Event definition as Manages Event definition

Yet in Notion.so, it generates this error:

Unknown error: Error: Lexical error on line 5. Unrecognized text.
... - AllFlows"actor <<Person>>\nAPI User
_______________________^

If I fix that by removing <<Person>>\n it'll generate the same errors for <<Component>>\n

This seems like a bug or at least a needed enhancement. In WebSequenceDiagrams, it looks like this:

image

That seems to be a really useful enhancement.

Also, I find Websequencediagrams uses -> to indicate a single arrow, while Mermaid expects ->> and -->>. Mermaid seems to be superior in that sense to Websequencediagrams as it can't indicate a single line, I'm not sure if this could be fixed except maybe as some kind of directive, or an entirely new type of diagram.

Maybe "webSequenceDiagram" as a type, but the label enhancements seem pretty useful.

Steps to reproduce

  1. Create a Structurizr dynamic view.
  2. Export via structurizr.sh export -w ANS.dsl -f websequencediagrams
  3. Create a Mermaid code block in Notion.so
  4. type 'sequenceDiagram' and press enter.
  5. Paste in the *.wsd file from step 2

Screenshots

image

Fixing that gives:

image

Code Sample


sequenceDiagram
    actor <<test>>\nJohn
    Alice-><<test>>\nJohn: Hello John, how are you?
    John-->Alice: Great!
    Alice-)John: See you later!

Setup

  • Mermaid version: Unsure, live Notion.so - I did check 'develop' and it errors out as well.
  • Browser and Version: Chrome on Mac, Version 117.0.5938.132 (Official Build) (arm64)

Suggested Solutions

Allow actor labels with embedded <<'s as well as translate the \n to a multiline label.

Additional Context

No response

@jgwinner jgwinner added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 13, 2023
@jgwinner
Copy link
Author

jgwinner commented Oct 16, 2023

Ah, I found out <BR /> apparently works, but not the << symbols.

Structurizr has a parameter:

            properties {
                "mermaid.sequenceDiagram" "true" 
            }

Which converts the WebSequenceDiagrams to mermaid style. I'll close the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant