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

Breaking changes subgraph 8.8.1 #1704

Closed
jpsimard-nyx opened this issue Oct 2, 2020 · 5 comments · Fixed by #1709
Closed

Breaking changes subgraph 8.8.1 #1704

jpsimard-nyx opened this issue Oct 2, 2020 · 5 comments · Fixed by #1709
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@jpsimard-nyx
Copy link

A bug was introduced in 8.8.1 with link from nested subgraph to parent sibling.
I get the bug when using https://unpkg.com/mermaid@8.8.1/dist/mermaid.min.js
I assume this bug is related to #1662 & #1660

graph TD
  subgraph  main
    subgraph subcontainer
      subcontainer-child
    end
     subcontainer-child--> subcontainer-sibling
  end
Loading

Editor

Bug with 8.8.1 View
image

Yet on the same graph the SVG render is OK

And the image render is OK too
[

Expected behavior
Working with 8.8.0 and 8.7.0
image

@jpsimard-nyx jpsimard-nyx added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 2, 2020
@jpsimard-nyx
Copy link
Author

The 8.8.1 syntax to get the view working but svg/image render broken seems to be :

graph TD
  subgraph  main
  subcontainer-sibling
    subgraph subcontainer
      subcontainer-child --> subcontainer-sibling
    end
  end
Loading

Editor

@knsv
Copy link
Collaborator

knsv commented Oct 7, 2020

Thanks for reporting! The other syntax should also work. I will take a look.

@knsv
Copy link
Collaborator

knsv commented Oct 7, 2020

There is some ambiguity about what subgraph a node belongs to when it appears in several subgraphs. Should it stick to the first subgraph it appears in or should the last subgraph it gets added to be the one. In other cases like for instance the title of a node it is the latest instance that counts.

  A[Title1] --> B
  A[Title2]

It was to be consistent with this principle the behavior changed along with the fix for issue #1602. However ... I take changes that affects existing diagrams very seriously so I will revert to previous behavior. We cant expect authors of documentation to go and update their docs due to a new version of mermaid. (Even though that would make things much easier...) 😄

@ralfbetazi For your graph

flowchart TB
  subgraph container_Beta
    process_C-->Process_D
  end
  subgraph container_Alpha
    process_A-->process_B
    process_B-->|via_AWSBatch|container_Beta
    process_A-->|messages|process_C
  end

This will mean that container_Beta is inside container_Alpha and will need to move out in order to get the graph you want.

@knsv
Copy link
Collaborator

knsv commented Oct 7, 2020

Another consequence of this is that this diagram:

flowchart TB
 subgraph A
  a -->b
 end
 subgraph B 
  b
 end

Will render like this:
image

This as both a and b is first tagged as members of A.

@ralfbetazi
Copy link

@knsv Thank you for the mention and citing the effect on my previously mentioned concern. For what it's worth, I wound up having to modify the offending diagram (for unrelated reasons) and the revised layout sidesteps the issue and comports with mermaid's behavior, so all's well that ends well. I respect your decision and your consideration for current users. 👍

knsv added a commit that referenced this issue Oct 7, 2020
knsv added a commit that referenced this issue Oct 7, 2020
@knsv knsv mentioned this issue Oct 7, 2020
3 tasks
@knsv knsv closed this as completed in #1709 Oct 8, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants