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

Impossible to link from a subgraph if it contains only subgraphs (and no node) -> syntax error in text #5059

Closed
martinSDT opened this issue Nov 22, 2023 · 0 comments · Fixed by #5127
Labels
Graph: Flow Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@martinSDT
Copy link

Description

When you create a graph containing encapsulated subgraphs with with no "pure" node in the first subgraph, it is not possible to link at the same time from the first subgraph and from the second one.

Steps to reproduce

  1. Paste the following code in live editor
flowchart 

subgraph Test1[Test container]
subgraph Wireframe
WireProperty1
WireProperty2
end
subgraph Identification
IdProperty1
IdProperty2
end
end
Test1 --> OutNode1
Identification --> OutNode2
  1. This results in a "Syntax error in Text"
    image
  2. Paste now the following code that contains an Extra node in the first "Test1" subgraph
flowchart 

subgraph Test1[Test container]
ExtraNode
subgraph Wireframe
WireProperty1
WireProperty2
end
subgraph Identification
IdProperty1
IdProperty2
end
end
Test1 --> OutNode1
Identification --> OutNode2
  1. This works with the new node (from what I see, I interprete that this node is needed to get the origin of the arrow poiting outward the first subgraph?)
    image
  2. Another interesting behavior for you to analyze is that their is no error if only one output link from the first subgraph is required
flowchart 

subgraph Test1[Test container]
subgraph Wireframe
WireProperty1
WireProperty2
end
subgraph Identification
IdProperty1
IdProperty2
end
end
Test1 --> OutNode1

image
6. In this case, the "pure" node in the first subgraph does not seem required to create the output arrow

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version: 10.6.1
  • Browser and Version: Chrome

Suggested Solutions

A workaround for now is to create the Extra node with a "space" character+transparent stroke and transparent filling

flowchart 

subgraph Test1[Test container]
ExtraNode( )
style ExtraNode fill:#fff0,stroke:#fff0
subgraph Wireframe
WireProperty1
WireProperty2
end
subgraph Identification
IdProperty1
IdProperty2
end
end
Test1 --> OutNode1
Identification --> OutNode2

This nevertheless adds extra space that is not expected

image

Additional Context

Thank you for your support :)

@martinSDT martinSDT added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Nov 22, 2023
@sidharthv96 sidharthv96 added Status: Approved Is ready to be worked on Graph: Flow and removed Status: Triage Needs to be verified, categorized, etc labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Flow Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants